Closed
Bug 1254295
Opened 9 years ago
Closed 8 years ago
gdb frame filter should compute function and script info
Categories
(Core :: JavaScript Engine, defect)
Core
JavaScript Engine
Tracking
()
RESOLVED
FIXED
mozilla52
Tracking | Status | |
---|---|---|
firefox52 | --- | fixed |
People
(Reporter: tromey, Assigned: tromey)
References
(Blocks 3 open bugs)
Details
Attachments
(3 files, 3 obsolete files)
Once the unwinder is added (see bug 1232712), we should update the included
frame filter to find the function and script info and return it.
I'll attach a patch that adds function info and shows where the script
info should be added. I'm not 100% sure this is correct but it has at
least once printed information that was useful...
Assignee | ||
Comment 1•9 years ago
|
||
MozReview-Commit-ID: LJEr9sNtdMV
Assignee | ||
Comment 2•9 years ago
|
||
See https://bugzilla.mozilla.org/show_bug.cgi?id=1232712#c20 to understand what
is wrong with this patch.
Assignee | ||
Comment 3•9 years ago
|
||
I've updated this patch (will attach soon) but it is still a bit wrong.
It shows:
#33 0x00007f0d1c475f61 in <<JitFrame_Exit>> ()
#34 0x00007f0cdadc5bd3 in <<JitFrame_BaselineStub>> ()
#35 0x00007f0c903720bc in <<JitFrame_BaselineJS "Handler.prototype.process">> ()
#36 0x00007f0cd8bd3e44 in <<JitFrame_BaselineStub>> ()
#37 0x00007f0c90483488 in <<JitFrame_BaselineJS "this.PromiseWalker.walkerLoop">> ()
#38 0x00007f0cd8bd3e44 in <<JitFrame_BaselineStub>> ()
#39 0x00007f0c90721072 in <<JitFrame_BaselineJS "bound ">> ()
#40 0x00007f0cd8bd3e44 in <<JitFrame_BaselineStub>> ()
#41 0x00007f0c90721072 in <<JitFrame_BaselineJS "bound bound ">> ()
#42 0x00007f0d1c474d94 in <<JitFrame_Entry "callFunctionWithAsyncStack">> ()
What would be correct here? I gather that these are generally off by one;
does that include moving the function name from frame #35 onto frame #34?
Also, "bound bound" seems pretty unfriendly and I'm wondering if there's a better
way to extract the name. Currently it's using the "atom_" member of JSFunction.
Flags: needinfo?(nicolas.b.pierron)
Assignee | ||
Comment 4•9 years ago
|
||
Updated for changes in final unwinder patch.
MozReview-Commit-ID: LJEr9sNtdMV
Attachment #8727595 -
Attachment is obsolete: true
Assignee | ||
Comment 5•9 years ago
|
||
I also tried adding arguments here, but sometimes I get strange values
for numActualArgs_. For example I can easily get a trace where this is
140737488348144. I did verify in this case that the callee token claims
this is a function call.
When the value is correct we can now print some arguments:
#6 0x00007ffff7ff20f3 in <<JitFrame_BaselineStub "f1">> (this=JSVAL_VOID, arg1=$jsval(4700))
There's also this buglet:
#7 0x00007ffff7fc096b in <<JitFrame_BaselineJS <error reading variable: Cannot access memory at address 0xfff9000000000000>>> ()
Comment 6•9 years ago
|
||
(In reply to Tom Tromey :tromey from comment #5)
> When the value is correct we can now print some arguments:
>
> #6 0x00007ffff7ff20f3 in <<JitFrame_BaselineStub "f1">> (this=JSVAL_VOID,
> arg1=$jsval(4700))
Only BaselineJS and IonJS should have a calleeToken associated to them. I will look at the patch to see what might be going wrong, but the BaselineStub header are not supposed to have a JitFrameLayout.
> There's also this buglet:
>
> #7 0x00007ffff7fc096b in <<JitFrame_BaselineJS <error reading variable:
> Cannot access memory at address 0xfff9000000000000>>> ()
0xfff90… is a JS::Value which is "undefined", and this is probably because you are interpreting the content of the stack as a JitFrameLayout while it is not supposed to be one.
I will look at the patch.
Flags: needinfo?(nicolas.b.pierron)
Assignee | ||
Comment 7•9 years ago
|
||
(In reply to Nicolas B. Pierron [:nbp] from comment #6)
> Only BaselineJS and IonJS should have a calleeToken associated to them.
This happened due to moving callee information to the next frame;
which is wrong, but I don't really understand what is going on here.
I'll attach my WIP patch that adds arguments as well.
Assignee | ||
Comment 8•9 years ago
|
||
MozReview-Commit-ID: LJEr9sNtdMV
Attachment #8729114 -
Attachment is obsolete: true
Assignee | ||
Updated•9 years ago
|
Assignee: nobody → ttromey
Status: NEW → ASSIGNED
Assignee | ||
Updated•8 years ago
|
Attachment #8729575 -
Attachment is obsolete: true
Assignee | ||
Comment 9•8 years ago
|
||
The patch I'm about to attach adds function names, parameters, and filenames to the backtrace.
It doesn't add line numbers, as that's more complicated; I'll file a follow-up bug.
It also has one hack to work around bug 987069 for now; I'll file a follow-up for this as well.
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Comment 13•8 years ago
|
||
mozreview-review |
Comment on attachment 8806004 [details]
Bug 1254295 - add function name to gdb frame filter;
https://reviewboard.mozilla.org/r/89578/#review89742
::: js/src/gdb/mozilla/unwind.py:178
(Diff revision 1)
> + except gdb.MemoryError:
> + function = "(could not read function name)"
> + script = fptr['u']['i']['s']['script_']
> + elif tag == self.cache.CalleeToken_Script:
> + script = gdb.Value(calleetoken).cast(self.cache.JSScript)
> + return [function, script]
nit: using a dictionary would make this easier to extend as needed.
::: js/src/gdb/mozilla/unwind.py:223
(Diff revision 1)
> + calleetoken = long(this_frame['calleeToken_'])
> + tag = calleetoken & 3
> + if tag != self.cache.CalleeToken_Function and tag != self.cache.CalleeToken_FunctionConstructing:
> + return FrameDecorator.frame_args(self)
nit: Use _decode_jitframe and test if function is None.
Attachment #8806004 -
Flags: review?(nicolas.b.pierron) → review+
Comment 14•8 years ago
|
||
mozreview-review |
Comment on attachment 8806005 [details]
Bug 1254295 - fix a few typos in JS headers;
https://reviewboard.mozilla.org/r/89580/#review89752
Attachment #8806005 -
Flags: review?(nicolas.b.pierron) → review+
Comment 15•8 years ago
|
||
mozreview-review |
Comment on attachment 8806006 [details]
Bug 1254295 - add "flushregs" advice to unwinder instructions;
https://reviewboard.mozilla.org/r/89582/#review89754
Attachment #8806006 -
Flags: review?(nicolas.b.pierron) → review+
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Comment 19•8 years ago
|
||
Pushed by ttromey@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/1e2587f668f4
add function name to gdb frame filter; r=nbp
https://hg.mozilla.org/integration/autoland/rev/52736ea528a9
fix a few typos in JS headers; r=nbp
https://hg.mozilla.org/integration/autoland/rev/5ba29d0fdd6d
add "flushregs" advice to unwinder instructions; r=nbp
Comment 20•8 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/1e2587f668f4
https://hg.mozilla.org/mozilla-central/rev/52736ea528a9
https://hg.mozilla.org/mozilla-central/rev/5ba29d0fdd6d
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
status-firefox52:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla52
You need to log in
before you can comment on or make changes to this bug.
Description
•