# ps axuww |grep test root 6177 0.6 0.0 1664 68 pts/0 D 18:58 0:00 ./test root 6180 0.0 0.1 2800 800 pts/1 S+ 18:58 0:00 grep test # gdb -se ./test -d ~/work/deb/glibc/eglibc-2.10.1/stdio-common/ -p 6177 GNU gdb (GDB) 7.0-ubuntu Copyright (C) 2009 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "i486-linux-gnu". For bug reporting instructions, please see: ... Reading symbols from /home/jir/cp/external/test...done. Attaching to program: /home/jir/cp/external/test, process 6177 Reading symbols from /lib/tls/i686/cmov/libc.so.6...Reading symbols from /usr/lib/debug/lib/tls/i686/cmov/libc-2.10.1.so...done. (no debugging symbols found)...done. Loaded symbols for /lib/tls/i686/cmov/libc.so.6 Reading symbols from /lib/ld-linux.so.2...Reading symbols from /usr/lib/debug/lib/ld-2.10.1.so...done. (no debugging symbols found)...done. Loaded symbols for /lib/ld-linux.so.2 0xb78ac430 in __kernel_vsyscall () (gdb) n Single stepping until exit from function __kernel_vsyscall, which has no line number information. 0xb77eba50 in __nanosleep_nocancel () from /lib/tls/i686/cmov/libc.so.6 (gdb) n Single stepping until exit from function __nanosleep_nocancel, which has no line number information. __sleep (seconds=0) at ../sysdeps/unix/sysv/linux/sleep.c:139 139 if (result == 0 && seconds != 0) (gdb) n 148 } (gdb) main () at test.c:33 33 for(i=0;i<10;i++) { (gdb) 34 fprintf(fp,"%d\n",i); (gdb) s __fprintf (stream=0x93b3008, format=0x8048801 "%d\n") at fprintf.c:27 27 __fprintf (FILE *stream, const char *format, ...) (gdb) 33 done = vfprintf (stream, format, arg); (gdb) s _IO_vfprintf_internal (s=0x93b3008, format=0x8048801 "%d\n", ap=0xbf9c5448 "\004") at vfprintf.c:210 210 { (gdb) 245 int save_errno = errno; (gdb) 210 { (gdb) n 245 int save_errno = errno; (gdb) p save_errno $1 = 2 (gdb) p errno Cannot find thread-local variables on this target (gdb) n Program received signal SIGSEGV, Segmentation fault. _IO_vfprintf_internal (s=0x93b3008, format=0x8048801 "%d\n", ap=0xbf9c5448 "\004") at vfprintf.c:245 245 int save_errno = errno; (gdb)