Closed Bug 36742 Opened 25 years ago Closed 23 years ago

DumpJSStack crashes gdb (developer problem only)

Categories

(Core :: XPConnect, defect, P3)

x86
Linux
defect

Tracking

()

RESOLVED WORKSFORME
Future

People

(Reporter: alecf, Assigned: shaver)

Details

(Keywords: crash, helpwanted)

Attachments

(1 file)

With a stock Redhat 6.1 distribution, I call DumpJSStack while I'm stopped inside nsDebug::Assertion: Breakpoint 2, nsDebug::Assertion (aStr=0x40add3f7 "write me", aExpr=0x40170a62 "NotYetImplemented", aFile=0x40adcc9a "nsXULElement.cpp", aLine=2144) at nsDebug.cpp:150 150 InitLog(); (gdb) call DumpJSStack() Segmentation fault I have loaded the shared libraries mozjs, jsdom, xpconnect, and various other libraries, and it ALWAYS crashes gdb.
bummer. I never tried it with gdb. It still works with the Win32 debugger. Does it dump a stack correctly on Linux if you stick a 'debugger;' statement in the JS code? This runs through almost all the same code paths. Also, is it possible to get any kind of useful stack out of that core dump? I wonder if the function needs any special sig to be called from gdb.
Status: NEW → ASSIGNED
what's interesting is that I can put a DumpJSStack(); in my code and it will dump the stack, though it always just says something like <Toplevel> and nothing else..(i.e. no other stack or contextual information)
Attached file sample .js file that uses "debugger;" (deleted) —
I don't know what is going on in gdb. The .js file I attached above can be run in xpcshell. On both NT and Linux it gives identical results for me... ------------------------------------------------------------------------ Hit JavaScript "debugger" keyword. JS call stack... 0 f(arg1 = [function], arg2 = "bar") ["debug.js":5] local1 = 1 local2 = "second local" this = [object global] 1 anonymous(a = [function], b = "bar") ["debug.js":8] this = [object Object] 2 g(a1 = [function], a2 = "bar", a3 = [object Object], a4 = 1,2,3, "extra", 123) ["debug.js":14] alocal = "something" l4 = 1,2,3 localFromArg = [function] this = [object global] 3 <TOP LEVEL> ["debug.js":17] this = [object global] ------------------------------------------------------------------------ There is very little different from the path to xpc_DumpJSStack from the public DumpJSStack() entry point and xpc_DebuggerKeywordHandler called by the JS engine. AFAICT anything that fails on those paths *ought* to fail safely and printf an error. http://lxr.mozilla.org/seamonkey/search?string=xpc_DumpJSStack A just added some code to check both the rv and resultant pointer after the WITH_SERVICE calls. This should not be necessary, but...
Adding crash keyword.
Keywords: crash
This is only a problem when trying to call this function from gdb. I don't know how to fix it. The work around is to not try to call the function from gdb. I would *love* for a power gdb user to solve this problem.
Keywords: helpwanted
Summary: DumpJSStack crashes gdb → DumpJSStack crashes gdb (developer problem only)
Target Milestone: --- → Future
cc'ing shaver. (I thought of this after talk of DumpJSObject). Maybe he has insight. I have not been doing *any* debugging on Linux for a long time. I'd be happy if someone figured out how to fix this - or if it is even fixable.
mass reassign of xpconnect bugs to dbradley@netscape.com
Assignee: jband → dbradley
Status: ASSIGNED → NEW
shaver, would you look at this?
Assignee: dbradley → shaver
I can't reproduce this. alecf: do you still see this, with a modern gdb?
Still can't reproduce it. WFM!
Status: NEW → RESOLVED
Closed: 23 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: