Hi, some programs fork(2)-off a child process for some part of its run. It was seen on the LMbench `bin/bw_mem' program. User sets a breakpoint which is silently missed and nobody notices there were multiple processes being run. If you would set set debug lin-lwp 1 you would see a message Detaching after fork from child process 11741. but it is clear nobody runs with `set debug lin-lwp 1' set as default. I did put there at least a warning message giving advice there is a fork: [Detaching after fork from child process 20372. (Try `set detach-on-fork off'.)] Regards, Jan Current version: ---------------- /tmp/lmbench-3.0-a9$ upstream-gdb --args bin/x86_64-linux-gnu/bw_mem 1000 rd GNU gdb 6.7.50.20071205-cvs Copyright (C) 2007 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 "x86_64-unknown-linux-gnu"... (gdb) b init_loop Breakpoint 1 at 0x4028a1: file bw_mem.c, line 150. (gdb) r Starting program: /tmp/lmbench-3.0-a9/bin/x86_64-linux-gnu/bw_mem 1000 rd warning: no loadable sections found in added symbol-file system-supplied DSO at 0x7fff1a1fc000 GETOPT ind=1 n=1 arg= av[1]='1000' 0.001000 56284.07 Program exited normally. (gdb) _ Patched GDB at least giving a hint: ----------------------------------- /tmp/lmbench-3.0-a9$ upstream-gdb --args bin/x86_64-linux-gnu/bw_mem 1000 rd GNU gdb 6.7.50.20071205-cvs Copyright (C) 2007 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 "x86_64-unknown-linux-gnu"... (gdb) b init_loop Breakpoint 1 at 0x4028a1: file bw_mem.c, line 150. (gdb) r Starting program: /tmp/lmbench-3.0-a9/bin/x86_64-linux-gnu/bw_mem 1000 rd warning: no loadable sections found in added symbol-file system-supplied DSO at 0x7fff19ffd000 GETOPT ind=1 n=1 arg= av[1]='1000' [Detaching after fork from child process 20372. (Try `set detach-on-fork off'.)] 0.001000 56557.02 Program exited normally. (gdb) _ How to catch the breakpoint the right way in this case: ------------------------------------------------------- /tmp/lmbench-3.0-a9$ upstream-gdb --args bin/x86_64-linux-gnu/bw_mem 1000 rd GNU gdb 6.7.50.20071205-cvs Copyright (C) 2007 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 "x86_64-unknown-linux-gnu"... (gdb) set follow-fork-mode child (gdb) b init_loop Breakpoint 1 at 0x4028a1: file bw_mem.c, line 150. (gdb) r Starting program: /tmp/lmbench-3.0-a9/bin/x86_64-linux-gnu/bw_mem 1000 rd warning: no loadable sections found in added symbol-file system-supplied DSO at 0x7fff57bfd000 GETOPT ind=1 n=1 arg= av[1]='1000' [Switching to process 19531] Breakpoint 1, init_loop (iterations=0, cookie=0x7fff57aa4600) at bw_mem.c:150 150 { (gdb) _ How to catch the breakpoint the suggested way in this case: ----------------------------------------------------------- /tmp/lmbench-3.0-a9$ upstream-gdb --args bin/x86_64-linux-gnu/bw_mem 1000 rd GNU gdb 6.7.50.20071205-cvs Copyright (C) 2007 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 "x86_64-unknown-linux-gnu"... (gdb) set detach-on-fork off (gdb) b init_loop Breakpoint 1 at 0x4028a1: file bw_mem.c, line 150. (gdb) r Starting program: /tmp/lmbench-3.0-a9/bin/x86_64-linux-gnu/bw_mem 1000 rd warning: no loadable sections found in added symbol-file system-supplied DSO at 0x7fff329fc000 GETOPT ind=1 n=1 arg= av[1]='1000' Program received signal SIGINT, Interrupt. 0x00000031668cdda3 in __select_nocancel () from /lib64/libc.so.6 (gdb) info forks 1 process 19596 at 0x316689ad22, file fork.c, line 127 * 0 process 19593 (main process) at 0x31668cdda3, <__select_nocancel> (gdb) fork 1 Switching to process 19596 #0 0x000000316689ad22 in __libc_fork () at ../nptl/sysdeps/unix/sysv/linux/fork.c:127 127 pid = ARCH_FORK (); (gdb) c Continuing. Program received signal SIGINT, Interrupt. 0x000000316689ad22 in __libc_fork () at ../nptl/sysdeps/unix/sysv/linux/fork.c:127 127 pid = ARCH_FORK (); (gdb) c Continuing. Breakpoint 1, init_loop (iterations=0, cookie=0x7fff328613c0) at bw_mem.c:150 150 { (gdb) _