Closed Bug 897919 Opened 12 years ago Closed 12 years ago

Handle lazy scripts in debugger.

Categories

(Core :: JavaScript Engine, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla25

People

(Reporter: till, Assigned: jimb)

References

Details

Attachments

(1 file, 1 obsolete file)

I stumbled upon this while debugging another issue. I can reproduce a crash caused by the `nonLazyScript` in `DebuggerObject_getScript`, but the STR are kinda annoying. I can provide them, if you want me to, of course, but this is a pretty straight-forward change. The other changed locations look equally fishy to me, but maybe with some knowledge about how exactly they're used, one can be sure that they never deal with lazy scripts. In that case, I'd happily revert them, of course.
Attached patch Handle lazy scripts in debugger (obsolete) — Splinter Review
Attachment #780902 - Flags: review?(jimb)
Summary: Handle lazy scripts in debugger. r=:jimb → Handle lazy scripts in debugger.
Comment on attachment 780902 [details] [diff] [review] Handle lazy scripts in debugger Review of attachment 780902 [details] [diff] [review]: ----------------------------------------------------------------- I think this definitely needs regression tests. Is it possible to capture the steps to reproduce in a js/src/jit-test/tests/debug test?
Attachment #780902 - Flags: review?(jimb)
For the record, I'm quite confident the fix is correct. But I'm mystified as to why this wasn't caught by the unit tests. There must be some systemic reason our tests never hit lazy functions, which is quite worrisome. I'd very much like to understand that part of the story before we proceed; we might be able to catch many other bugs. For what it's worth: the patch covers both DebuggerObject_getScript and DebuggerFrame_getScript. In the latter case, the use of nonLazyScript might be justified: we can't have stack frames running lazy scripts, can we?
This patch has regression tests, deals with cross-compartment issues, and assumes that once a stack frame is running a function, it's no longer lazy.
Assignee: till → jimb
Attachment #780902 - Attachment is obsolete: true
Status: NEW → ASSIGNED
Attachment #784102 - Flags: review?(sphink)
Comment on attachment 784102 [details] [diff] [review] Correctly de-lazify functions before trying to inspect their scripts. Review of attachment 784102 [details] [diff] [review]: ----------------------------------------------------------------- Seems reasonable, based only on staring at the patch.
Attachment #784102 - Flags: review?(sphink) → review+
Flags: in-testsuite+
Target Milestone: --- → mozilla25
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Should we uplift this to Firefox 25 to resolve Bug 898867 ? Not sure if this already made it.
Flags: needinfo?(jimb)
Yes, this patch is in Firefox 25; that's why I set the "target milestone" to "mozilla25". Isn't that our process for answering these questions? I checked the mozilla-aurora head to be sure, and the patch's changes are present there.
Flags: needinfo?(jimb)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: