Script started on Sat Mar 20 12:33:47 2004 root@localhost# uname -a Linux localhost.localdomain 2.4.9-e.3enterprise #1 SMP Fri May 3 16:35:33 EDT 2002 i686 unknown root@localhost# gcc -o sig -g ./sig.c root@localhost# cat sig.c #include #include void handle(int sig) { int *pt = NULL; printf("handled\n"); *pt = 10; } void func1() { signal(SIGUSR1, handle); raise(SIGUSR1); } func2() { func1(); } main() { func2(); } root@localhost# ./sig handled Segmentation fault (core dumped) root@localhost# gdb ./sig core GNU gdb Red Hat Linux (5.1-1) Copyright 2001 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "i386-redhat-linux"... Core was generated by `./sig'. Program terminated with signal 11, Segmentation fault. Reading symbols from /lib/i686/libc.so.6...wdone. Loaded symbols for /lib/i686/libc.so.6 Reading symbols from /lib/ld-linux.so.2...done. Loaded symbols for /lib/ld-linux.so.2 #0 0x080484f0 in handle (sig=10) at ./sig.c:7 7 *pt = 10; (gdb) where #0 0x080484f0 in handle (sig=10) at ./sig.c:7 #1 #2 0x40051b11 in __kill () from /lib/i686/libc.so.6 #3 0x400518ea in raise (sig=10) at ../sysdeps/posix/raise.c:27 #4 0x0804851a in func1 () at ./sig.c:12 #5 0x0804852b in func2 () at ./sig.c:16 #6 0x0804853b in main () at ./sig.c:20 #7 0x4003f657 in __libc_start_main (main=0x8048530
, argc=1, ubp_av=0xbffed204, init=0x804832c <_init>, fini=0x8048580 <_fini>, rtld_fini=0x4000dcd4 <_dl_fini>, stack_end=0xbffed1fc) at ../sysdeps/generic/libc-start.c:129 (gdb) quit Script done on Sat Mar 20 12:34:29 2004