[lkml]   [2007]   [Nov]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectUnkillable gdb process gets system unusably slow
Fully reproducible with me. v2.6.23.1 x86-64 SMP kernel, Core 2 CPU, gdb

gdb ./hang
fr 1
p (char*)base

p command hangs and the entire system becomes unusably slow. kill -9
doesn't kill gdb.

/* gcc hang.c -o hang -g -Wall */
#include <stdio.h>
#include <string.h>
#include <fcntl.h>
#include <unistd.h>
#include <sys/mman.h>

int main(void)
int fd;
char buf[100];
void *base;

fd = open("hang.tmp", O_RDWR | O_CREAT, 0600);
if (fd == -1) perror("open");

base = mmap(NULL, 100, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0);
if (base == MAP_FAILED)
memcpy(buf, base, sizeof(buf));
return 0;

[unhandled content-type:application/pgp-signature]
 \ /
  Last update: 2007-11-23 06:01    [W:0.030 / U:0.560 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site