Bug 12363 - Breakpoints are messed after call to popen/fork
Summary: Breakpoints are messed after call to popen/fork
Status: NEW
Alias: None
Product: gdb
Classification: Unclassified
Component: gdb (show other bugs)
Version: 7.2
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-01-04 15:50 UTC by Steven Demierre
Modified: 2011-01-04 16:06 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Steven Demierre 2011-01-04 15:50:38 UTC
I ran into a really strange Problem concerning Breakpoints in gdb. 

Steps to reproduce:

I call popen, which calls some Linux tools (iconv and sort). After the call to popen (or more probably the fork which is called by popen) all the breakpoints i've set before are really messed.


Actual results:
This means, if i type "continue" some of the breakpoints which shoud be hit aren't. And if they are hit, the program is really in some other place. For instance i hit a breakpoint which is at the beginning of a function. Then i press "next" and get "Program exited with code 01.".

It also happened, that a breakpoint wasn't hit until i made a new breakpoint in main (and then "continue"d from there).

What seemed to help was to completely delete all breakpoints and enter them again after the popen call ("delete" with no parameters! deleting each breakpoint didn't work for some reason).


Build Date & Platform: 
7.2-1ubuntu3 on Ubuntu Linux Kernel 2.6.35-23.
I've also checked with the newest weekly version "7.2.0.20110104" but it has the same problems.


Additional information:
As i think it could be somehow linked to the fork, i use the following gdb settings:
follow-fork-mode: parent
follow-exec-mode: same