Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 370454 - gdb internal-error and core dump of the target after fork() system calls
Summary: gdb internal-error and core dump of the target after fork() system calls
Status: NEW
Alias: None
Product: CDT
Classification: Tools
Component: cdt-debug-dsf-gdb (show other bugs)
Version: 8.1.0   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact: Jonah Graham CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-02-02 10:38 EST by Holger Machens CLA
Modified: 2020-09-04 15:22 EDT (History)
4 users (show)

See Also:


Attachments
example C source code to reproduce the problem (812 bytes, text/plain)
2012-02-02 10:43 EST, Holger Machens CLA
no flags Details
gdb traces (13.40 KB, text/plain)
2012-02-03 05:12 EST, Holger Machens CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Holger Machens CLA 2012-02-02 10:38:29 EST
Build Identifier: 20110916-0149

This problem does not occur in a gdb session without Eclipse/CDT (tested with plain gdb and DDD).

Debugging a simple program with remarkable footprint (e.g. linked with pthread or rt) results in a gdb error message stating: "/build/buildd/gdb-7.2/gdb/thread.c:598: internal-error: is_thread_state: Assertion `tp' failed."

The error seems to be deterministic, because it occurs after a certain amount of calls to fork. The amount of successful calls changes with the footprint of the executable.


Information on System and Debug Configuration
---------------------------------------------

Debug configuration with the following flags enabled:
- Non-stop mode: enabled
- Automatically debug child processes: enabled

Used no ~/.gdbinit

Eclipse Indigo SR1

uname -a:
Linux <hostname> 2.6.38-13-generic #54-Ubuntu SMP Tue Jan 3 13:38:12 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux

GNU gdb (Ubuntu/Linaro 7.2-1ubuntu11) 7.2
gcc version 4.5.2 (Ubuntu/Linaro 4.5.2-8ubuntu4) 

Intel(R) Core(TM)2 Duo CPU     E8400  @ 3.00GHz
MemTotal:        3987052 kB
MemFree:           95304 kB
Cached:          1609884 kB


Reproducible: Always

Steps to Reproduce:
1. Compile the attached example (main.c) by typing:
   gcc -lrt -g -O0 -o main main.c
2. Debug with "Non-stop mode" and "Automatically debug child processes" enabled
Comment 1 Holger Machens CLA 2012-02-02 10:43:33 EST
Created attachment 210455 [details]
example C source code to reproduce the problem
Comment 2 Marc Khouzam CLA 2012-02-02 10:48:02 EST
Can you look and maybe attach the gdb traces to see what command sequence is causing gdb to crash?
http://wiki.eclipse.org/CDT/User/FAQ#I.27ve_been_asked_for_.27gdb_traces.27.2C_where_can_I_find_them.3F

GDB 7.2 had a few problems with multi-process which were solved in GDB 7.3.  In fact, GDB 7.4 is now available.  I strongly suggest trying to use a more recent GDB to see if it fixed the problem.
Comment 3 Holger Machens CLA 2012-02-03 05:12:56 EST
Created attachment 210500 [details]
gdb traces

This is the output from gdb traces console in eclipse. I've cut out the process (thread group) listings due to confidential content.
Comment 4 Marc-André Laperle CLA 2012-02-27 22:50:37 EST
This look similar to
http://sourceware.org/bugzilla/show_bug.cgi?id=12905