Closed
Bug 908472
Opened 11 years ago
Closed 11 years ago
Crash [@ fun_isGenerator] or Assertion failure: isInterpretedLazy() && u.i.s.lazy_, at jsfun.h
Categories
(Core :: JavaScript Engine, defect)
Core
JavaScript Engine
Tracking
()
RESOLVED
FIXED
mozilla26
People
(Reporter: gkw, Assigned: till)
References
Details
(Keywords: assertion, regression, testcase, Whiteboard: [jsbugmon:update])
Crash Data
Attachments
(3 files)
[0].some(Function.isGenerator, [].map)
asserts js debug shell on m-c changeset d58fc624899c without any CLI arguments at Assertion failure: isInterpretedLazy() && u.i.s.lazy_, at jsfun.h
Assignee | ||
Comment 1•11 years ago
|
||
Urgh. JSFunction::generatorKind doesn't work for self-hosted lazy functions, only for lazy-parsed ones.
Shouldn't be too hard to fix, though.
Assignee: general → till
Status: NEW → ASSIGNED
Assignee | ||
Comment 2•11 years ago
|
||
As discussed on IRC, this patch makes JSFunction::generatorKind always return js::NotGenerator for lazy self-hosted functions.
To ensure that it doesn't incorrectly do so, JSRuntime::cloneSelfHostedFunctionScript asserts that the cloned function isn't a generator.
Attachment #794313 -
Flags: review?(jwalden+bmo)
Assignee | ||
Updated•11 years ago
|
Reporter | ||
Comment 3•11 years ago
|
||
autoBisect shows this is probably related to the following changeset:
The first bad revision is:
changeset: http://hg.mozilla.org/mozilla-central/rev/26d92ba69fe6
user: Andy Wingo
date: Tue Aug 20 11:03:24 2013 +0200
summary: Bug 666399 - New Harmony syntax for generators. r=Waldo
Yes, bug 666399 seems to be the regressor.
Comment 4•11 years ago
|
||
Comment on attachment 794313 [details] [diff] [review]
make JSFunction::generatorKind() treat lazy self-hosted functions as non-generators.
Review of attachment 794313 [details] [diff] [review]:
-----------------------------------------------------------------
Yes, it looks like I misunderstood the interactions between lazyscript, script, and self-hosted functions. Thanks for looking at this; patch looks good to me!
Reporter | ||
Comment 5•11 years ago
|
||
This also crashes js opt shell at fun_isGenerator, likely a null deref though.
Reporter | ||
Updated•11 years ago
|
Crash Signature: [@ fun_isGenerator]
Summary: Assertion failure: isInterpretedLazy() && u.i.s.lazy_, at jsfun.h → Crash [@ fun_isGenerator] or Assertion failure: isInterpretedLazy() && u.i.s.lazy_, at jsfun.h
Comment 6•11 years ago
|
||
Comment on attachment 794313 [details] [diff] [review]
make JSFunction::generatorKind() treat lazy self-hosted functions as non-generators.
Review of attachment 794313 [details] [diff] [review]:
-----------------------------------------------------------------
::: js/src/jsfun.h
@@ +290,5 @@
> + if (hasScript())
> + return nonLazyScript()->generatorKind();
> + js::LazyScript *lazy = lazyScriptOrNull();
> + if (lazy)
> + return lazy->generatorKind();
if (js::LazyScript *lazy = lazyScriptOrNull())
return lazy->generatorKind();
is a little more compact.
::: js/src/vm/SelfHosting.cpp
@@ +936,5 @@
> return false;
>
> RootedFunction sourceFun(cx, &funVal.toObject().as<JSFunction>());
> + // JSFunction::generatorKind can't handle lazy self-hosted function, so we make sure there
> + // aren't any.
"functions"
Attachment #794313 -
Flags: review?(jwalden+bmo) → review+
Assignee | ||
Comment 7•11 years ago
|
||
Pushed with nits addressed:
https://hg.mozilla.org/integration/mozilla-inbound/rev/799ed2cf9e82
Comment 8•11 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla26
You need to log in
before you can comment on or make changes to this bug.
Description
•