public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug gdb/10510] New: Use of follow-fork-mode child causes GDB to crash
@ 2009-08-11 12:11 avi at checkpoint dot com
  2009-08-16 14:05 ` [Bug gdb/10510] " pedro at codesourcery dot com
  2009-09-01 10:00 ` avi at checkpoint dot com
  0 siblings, 2 replies; 4+ messages in thread
From: avi at checkpoint dot com @ 2009-08-11 12:11 UTC (permalink / raw)
  To: gdb-prs

I try to debug a child process spawned by the process attached to be GDB. For 
this I set follow-fork-mode child (prior to fork) and continue the parent 
process. GDB crashes.

Program runs on Linux 2.6.18.
GDB is compiled using gcc 3.2.3
Program is compiled using gcc 3.2.3

Full scenario:
1. The parent process runs
2. GDB <executable> <pid>
3. break <some lines prior to fork>
4. continue and trigger spawning. GDB stops in the breakpoint
5. set follow-fork-mode child
6. continue
After some seconds GDB crashes. Its backtrace:

#0  0x080987fd in clear_lwpid_callback (thread=0xade2428, dummy=0x0)
    at linux-thread-db.c:762
#1  0x0810c6f7 in iterate_over_threads (
    callback=0x80987f4 <clear_lwpid_callback>, data=0x0) at thread.c:212
#2  0x08098852 in thread_db_resume (ptid={pid = 4363, lwp = 4363, tid = 0},
    step=1, signo=TARGET_SIGNAL_0) at linux-thread-db.c:779
#3  0x08103221 in resume (step=1, sig=TARGET_SIGNAL_0) at infrun.c:651
#4  0x08105f63 in keep_going (ecs=0x7fa17310) at infrun.c:2915
#5  0x0810430f in handle_inferior_event (ecs=0x7fa17310) at infrun.c:2721
#6  0x081038f2 in wait_for_inferior (treat_exec_as_sigtrap=0) at infrun.c:1042
#7  0x08103686 in proceed (addr=1, siggnal=TARGET_SIGNAL_HUP, step=0)
    at infrun.c:844
#8  0x081007cc in continue_command (proc_count_exp=0x0, from_tty=1)
    at infcmd.c:653
#9  0x080b3cf6 in do_cfunc (c=0xade2428, args=0x0, from_tty=1)
    at ../gdb/cli/cli-decode.c:60
#10 0x080b571e in cmd_func (cmd=0x92bd810, args=0x0, from_tty=1)
    at ../gdb/cli/cli-decode.c:1663
#11 0x0808470b in execute_command (p=0x92a3129 "", from_tty=1) at top.c:449
#12 0x08111211 in command_handler (command=0x92a3128 "c") at event-top.c:518
#13 0x081116a1 in command_line_handler (rl=0xd012548 "H08\r`g9\r")
    at event-top.c:804
#14 0x081a4894 in rl_callback_read_char () at callback.c:205
#15 0x08110ba7 in rl_callback_read_char_wrapper (client_data=0x0)
    at event-top.c:177
#16 0x0811111e in stdin_event_handler (error=0, client_data=0xade2428)
    at event-top.c:431
#17 0x08110484 in handle_file_event (event_file_desc=0) at event-loop.c:728
#18 0x0810ffc8 in process_event () at event-loop.c:341
#1

-- 
           Summary: Use of follow-fork-mode child causes GDB to crash
           Product: gdb
           Version: 6.8
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: gdb
        AssignedTo: unassigned at sourceware dot org
        ReportedBy: avi at checkpoint dot com
                CC: gdb-prs at sourceware dot org


http://sourceware.org/bugzilla/show_bug.cgi?id=10510

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug gdb/10510] Use of follow-fork-mode child causes GDB to crash
  2009-08-11 12:11 [Bug gdb/10510] New: Use of follow-fork-mode child causes GDB to crash avi at checkpoint dot com
@ 2009-08-16 14:05 ` pedro at codesourcery dot com
  2009-09-01 10:00 ` avi at checkpoint dot com
  1 sibling, 0 replies; 4+ messages in thread
From: pedro at codesourcery dot com @ 2009-08-16 14:05 UTC (permalink / raw)
  To: gdb-prs


------- Additional Comments From pedro at codesourcery dot com  2009-08-16 14:05 -------
Many bugs were fixed in the follow-fork-mode support since 6.8 was
released, over a year ago.  In addition, the clear_lwpid_callback function
was deleted from CVS on 2008/03.  Please try a recent snapshot or CVS HEAD,
and let us know how it goes.


-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |WAITING


http://sourceware.org/bugzilla/show_bug.cgi?id=10510

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug gdb/10510] Use of follow-fork-mode child causes GDB to crash
  2009-08-11 12:11 [Bug gdb/10510] New: Use of follow-fork-mode child causes GDB to crash avi at checkpoint dot com
  2009-08-16 14:05 ` [Bug gdb/10510] " pedro at codesourcery dot com
@ 2009-09-01 10:00 ` avi at checkpoint dot com
  1 sibling, 0 replies; 4+ messages in thread
From: avi at checkpoint dot com @ 2009-09-01 10:00 UTC (permalink / raw)
  To: gdb-prs


------- Additional Comments From avi at checkpoint dot com  2009-09-01 10:00 -------
I tried using a snapshot from August the 18th (version 6.8.50.20090817-cvs). 
Machine configuration and program compilation is as before.

Using this snapshot, GDB does not crash, yet it fails to debug the child. 
Following is GDB output:

  (gdb) set follow-fork-mode child
  (gdb) c
  Continuing.
  [New process 3538]
  [Thread debugging using libthread_db enabled]
  Executing new program: <our child program>
  Error in re-setting breakpoint 1: Can't find member of namespace, class, 
struct, or union named <function with break>
  Hint: try '<function with break><TAB> or '<function with break><ESC-?>
  (Note leading single quote.)
  [Thread debugging using libthread_db enabled]
  [New Thread 0x6cbb2bb0 (LWP 3542)]
  infrun.c:2398: internal-error: handle_inferior_event: Assertion `inf' failed.
  A problem internal to GDB has been detected,
  further debugging may prove unreliable.
  Quit this debugging session? (y or n) n
  infrun.c:2398: internal-error: handle_inferior_event: Assertion `inf' failed.
  A problem internal to GDB has been detected,
  further debugging may prove unreliable.
  Create a core file of GDB? (y or n) y
  (gdb) bt 
  Target is executing.
  (gdb) quit
  A debugging session is active.
   
          Inferior 2 [process 3538] will be detached.
   
  Quit anyway? (y or n) y
  Detaching from program: <our child program>, process 3538

[Please note that the child program crashed following the detach (this crash 
does not happen when not debugged).]

Following is the backtrace of GDB, extracted from the GDB core file:

  (gdb) bt
  #0  0x77d7bd4f in sigpending () from /lib/tls/libc.so.6
  #1  0x77d7d555 in _quicksort () from /lib/tls/libc.so.6
  #2  0x0808a4ac in ?? ()
  #3  0x77e89ce4 in tmpbuf.0 () from /lib/tls/libc.so.6
  #4  0x00000000 in ?? ()


-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |NEW
     Ever Confirmed|                            |1


http://sourceware.org/bugzilla/show_bug.cgi?id=10510

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug gdb/10510] Use of follow-fork-mode child causes GDB to crash
       [not found] <bug-10510-4717@http.sourceware.org/bugzilla/>
@ 2012-10-24 15:42 ` palves at redhat dot com
  0 siblings, 0 replies; 4+ messages in thread
From: palves at redhat dot com @ 2012-10-24 15:42 UTC (permalink / raw)
  To: gdb-prs

http://sourceware.org/bugzilla/show_bug.cgi?id=10510

Pedro Alves <palves at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |palves at redhat dot com
         Resolution|                            |FIXED

--- Comment #3 from Pedro Alves <palves at redhat dot com> 2012-10-24 15:42:02 UTC ---
Yet many more fixes in the fork support have gone in since that snapshot.
Our fork tests in the testsuite pass, so I'm closing this.  If this is still a
problem with current GDB, please reopen.

Thanks.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-10-24 15:42 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-08-11 12:11 [Bug gdb/10510] New: Use of follow-fork-mode child causes GDB to crash avi at checkpoint dot com
2009-08-16 14:05 ` [Bug gdb/10510] " pedro at codesourcery dot com
2009-09-01 10:00 ` avi at checkpoint dot com
     [not found] <bug-10510-4717@http.sourceware.org/bugzilla/>
2012-10-24 15:42 ` palves at redhat dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).