This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 210468 - gdb fails to start with watches
Summary: gdb fails to start with watches
Status: RESOLVED FIXED
Alias: None
Product: cnd
Classification: Unclassified
Component: Debugger (show other bugs)
Version: 7.2
Hardware: PC Linux
: P2 normal (vote)
Assignee: Egor Ushakov
URL:
Keywords:
: 206784 210930 212055 212534 212966 (view as bug list)
Depends on:
Blocks:
 
Reported: 2012-03-30 23:32 UTC by tbrunhoff
Modified: 2012-05-25 12:06 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
gdb log (2.12 KB, text/x-log)
2012-03-30 23:32 UTC, tbrunhoff
Details

Note You need to log in before you can comment on or make changes to this bug.
Description tbrunhoff 2012-03-30 23:32:48 UTC
Created attachment 117586 [details]
gdb log

Over several start-stop debug sessions I accumulated about 15 breakpoints. Near the end I added a "variable" breakpoint, which worked quite well (thank you!) After that I started three more gdb sessions. Each time the variable breakpoint fired because some memory changed in the new session which was described in the variable breakpoint, which looked like this:

    ((MediaClipDesc*)0x8688698)->m_seqCoding

So then I would try to change the expression to a valid address which is when I ran into this exception: http://netbeans.org/bugzilla/show_bug.cgi?id=210461

So from then I settled into deleting the variable breakpoint and recreating it each time. Finally, in an effort to retest the code I deleted all the breakpoints and started the debugger. However, every time, the ide would stop, hung in the debugger.

The gdb log (attached) shows that a gdb variable is being created for the variable breakpoint that was deleted! Gdb then dies a horrible death.
Comment 1 tbrunhoff 2012-03-30 23:40:59 UTC
It turns out to be watches that are stored in ~/.netbeans/dev/config/Services/org-netbeans-modules-debugger-Settings.properties:debugger.watches.0.expression:


debugger.watches:# array
debugger.watches.0:# org.netbeans.api.debugger.Watch
debugger.watches.0.enabled:true
debugger.watches.0.expression:"(MediaClipDesc*)0x8688698"
debugger.watches.1:# org.netbeans.api.debugger.Watch
debugger.watches.1.enabled:true
debugger.watches.1.expression:"(MediaClipDesc*)0x8688698"
debugger.watches.2:# org.netbeans.api.debugger.Watch
debugger.watches.2.expression:"nearest"
debugger.watches.3:# org.netbeans.api.debugger.Watch
debugger.watches.3.expression:"this->dumpList(1)"
debugger.watches.4:# org.netbeans.api.debugger.Watch
debugger.watches.4.expression:"thisFoundIndex.page->getEuLength()"
debugger.watches.5:# org.netbeans.api.debugger.Watch
debugger.watches.5.expression:"this->getPath(0)"
debugger.watches.array_type:org.netbeans.api.debugger.Watch
debugger.watches.length:1

In the UI, only watch 0 shows up in the watch list. The others I do not recognize. and are probably pretty old.
Comment 2 tbrunhoff 2012-04-02 14:26:24 UTC
If I
 - exiit the ide
 - remove all watches from org-netbeans-modules-debugger-Settings.properties
 - start the ide
 - start the debugger
 - add a watch value 'i'
 - exit the ide

... then org-netbeans-modules-debugger-Settings.properties contains the watch entries for 'i', like this:

debugger.watches:# array
debugger.watches.0:# org.netbeans.api.debugger.Watch
debugger.watches.0.enabled:true
debugger.watches.0.expression:"i"
debugger.watches.array_type:org.netbeans.api.debugger.Watch
debugger.watches.length:0

If I then
 - start the ide
 - delete the watch from the watch pane
 - exit the ide

... I can see that org-netbeans-modules-debugger-Settings.properties has been rewritten, but it still contains the watch entries. It seems likely that while the watch may be unhooked logically, it may remain in a state where it is still evaluated, leading how gdb got upset.
Comment 3 Egor Ushakov 2012-04-03 09:50:07 UTC
this may be related to the recent changes described in the bug 209787, will investigate
Comment 4 Egor Ushakov 2012-04-03 15:18:49 UTC
info in the org-netbeans-modules-debugger-Settings file does not matter, because it reads only the debugger.watches.length number of items.
What really breaks the debugger is this address watch "(MediaClipDesc*)0x8688698" applied on startup.
See also bug 206784
Comment 5 Egor Ushakov 2012-04-03 15:19:03 UTC
*** Bug 206784 has been marked as a duplicate of this bug. ***
Comment 6 Egor Ushakov 2012-04-04 13:18:08 UTC
easy steps to reproduce:
- create a watch for 0x1234567 (any address)
- start the debugging session
It will hang because gdb silently dies with internal assert
Comment 7 Egor Ushakov 2012-04-04 13:18:42 UTC
we should not evaluate watches before gdb start the application
Comment 8 Egor Ushakov 2012-04-04 14:51:05 UTC
fixed in:
http://hg.netbeans.org/cnd-main/rev/ab7797b325d8
Comment 9 Quality Engineering 2012-04-05 09:38:25 UTC
Integrated into 'main-golden', will be available in build *201204050400* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/ab7797b325d8
User: Egor Ushakov <gorrus@netbeans.org>
Log: fixed #210468 - gdb fails to start with watches
Comment 10 Egor Ushakov 2012-04-12 09:19:30 UTC
*** Bug 210930 has been marked as a duplicate of this bug. ***
Comment 11 Egor Ushakov 2012-05-04 11:47:55 UTC
*** Bug 212055 has been marked as a duplicate of this bug. ***
Comment 12 Egor Ushakov 2012-05-21 08:53:35 UTC
*** Bug 212534 has been marked as a duplicate of this bug. ***
Comment 13 Egor Ushakov 2012-05-25 12:06:19 UTC
*** Bug 212966 has been marked as a duplicate of this bug. ***