New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 679727 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Jan 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Windows , Mac
Pri: 1
Type: Bug



Sign in to add a comment

Crash in v8::internal::AstNumberingVisitor::VisitAssignment

Reported by gksgudtj...@gmail.com, Jan 10 2017

Issue description

UserAgent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36

Steps to reproduce the problem:
1. Load test.html what I attached
2. 
3. 

What is the expected behavior?

What went wrong?
#0  0x085f749f in v8::internal::AstNumberingVisitor::VisitAssignment(v8::internal::Assignment*) ()
#1  0x085f8b25 in v8::internal::AstNumberingVisitor::VisitNoStackOverflowCheck(v8::internal::AstNode*) ()
#2  0x085f8eae in v8::internal::AstNumberingVisitor::VisitNoStackOverflowCheck(v8::internal::AstNode*) ()
#3  0x085f74e7 in v8::internal::AstNumberingVisitor::VisitAssignment(v8::internal::Assignment*) ()
#4  0x085f8b25 in v8::internal::AstNumberingVisitor::VisitNoStackOverflowCheck(v8::internal::AstNode*) ()
#5  0x085f8eae in v8::internal::AstNumberingVisitor::VisitNoStackOverflowCheck(v8::internal::AstNode*) ()
#6  0x085f88f6 in v8::internal::AstNumberingVisitor::VisitNoStackOverflowCheck(v8::internal::AstNode*) ()
#7  0x085f91ce in v8::internal::AstNumberingVisitor::VisitNoStackOverflowCheck(v8::internal::AstNode*) ()
#8  0x085f8eae in v8::internal::AstNumberingVisitor::VisitNoStackOverflowCheck(v8::internal::AstNode*) ()
#9  0x085f9296 in v8::internal::AstNumberingVisitor::VisitNoStackOverflowCheck(v8::internal::AstNode*) ()
#10 0x085f74e7 in v8::internal::AstNumberingVisitor::VisitAssignment(v8::internal::Assignment*) ()
#11 0x085f8b25 in v8::internal::AstNumberingVisitor::VisitNoStackOverflowCheck(v8::internal::AstNode*) ()
#12 0x085f8eae in v8::internal::AstNumberingVisitor::VisitNoStackOverflowCheck(v8::internal::AstNode*) ()
#13 0x085f88f6 in v8::internal::AstNumberingVisitor::VisitNoStackOverflowCheck(v8::internal::AstNode*) ()
#14 0x085f8386 in v8::internal::AstNumberingVisitor::Renumber(v8::internal::FunctionLiteral*) ()
#15 0x085f86a2 in v8::internal::AstNumbering::Renumber(v8::internal::Isolate*, v8::internal::Zone*, v8::internal::FunctionLiteral*) ()
#16 0x081aa0ea in v8::internal::Compiler::Analyze(v8::internal::ParseInfo*) ()
#17 0x081ac709 in v8::internal::(anonymous namespace)::GetUnoptimizedCode(v8::internal::CompilationInfo*) ()
#18 0x081aa6f8 in v8::internal::Compiler::Compile(v8::internal::Handle<v8::internal::JSFunction>, v8::internal::Compiler::ClearExceptionFlag) ()
#19 0x087b4164 in v8::internal::Runtime_CompileLazy(int, v8::internal::Object**, v8::internal::Isolate*) ()
#20 0x5100623e in ?? ()
#21 0x510064e2 in ?? ()
#22 0x345065d5 in ?? ()
#23 0x51048cde in ?? ()
#24 0x5101fe78 in ?? ()
#25 0x082b5f85 in v8::internal::(anonymous namespace)::Invoke(v8::internal::Isolate*, bool, v8::internal::Handle<v8::internal::Object>, v8::internal::Handle<v8::internal::Object>, int, v8::internal::Handle<v8::internal::Object>*, v8::internal::Handle<v8::internal::Objec
t>) ()
#26 0x082b5d25 in v8::internal::Execution::Call(v8::internal::Isolate*, v8::internal::Handle<v8::internal::Object>, v8::internal::Handle<v8::internal::Object>, int, v8::internal::Handle<v8::internal::Object>*) ()
#27 0x08072be1 in v8::Script::Run(v8::Local<v8::Context>) ()
#28 0x0804da01 in v8::Shell::ExecuteString(v8::Isolate*, v8::Local<v8::String>, v8::Local<v8::Value>, bool, bool) ()
#29 0x080561dd in v8::SourceGroup::Execute(v8::Isolate*) ()
#30 0x080582ac in v8::Shell::RunMain(v8::Isolate*, int, char**, bool) ()
#31 0x0805b669 in v8::Shell::Main(int, char**) ()
#32 0x0805b904 in main ()

Crashed report ID: 

How much crashed? Just one tab

Is it a problem with a plugin? N/A 

Did this work before? N/A 

Chrome version: 55.0.2883.87  Channel: stable
OS Version: 10.0
Flash Version: Shockwave Flash 24.0 r0
 
test.html
86 bytes View Download
Cc: kkaluri@chromium.org
Components: Infra>Client>V8 Blink>JavaScript
Labels: hasbisect-per-revision M-57 OS-Linux OS-Mac
Owner: dpranke@chromium.org
Status: Assigned (was: Unconfirmed)
Able to reproduce this issue on Windows 10, Ubuntu 14.04  with chrome version 55.0.2883.87 and Mac 10.12.2 on chrome stable version 55.0.2883.95 and also in current canary version #57.0.2977.0
Issue is broken in M54.

Bisect Info:
===========
Good build : 54.0.2806.0,  Revision Range -407375
Bad build  : 54.0.2807.0,  Revision Range -407480

After executing the per-revision bisect script , i got the following CL's between good and bad build versions
===========================================
https://chromium.googlesource.com/chromium/src/+log/8cac25c661e66d12de27fb04d33605b7dce0ecd3..29b30bf368f96d99ea5067b66a9ac2b662f4510b


The suspecting Change Log is :
-----------
https://chromium.googlesource.com/v8/v8/+/682a41db33afada6052997f8d2ee5f20c3069787

From the above CL suspecting the below change
---------------------------
Review-Url: https://codereview.chromium.org/2173343002

dpranke@- Could you please look into this issue, if it's related to your change?  if not could you please help us to reassign this issue to the right owner.

Owner: machenb...@chromium.org
I'd be kinda surprised if this caused the issue. I think this change would either be fine, or nothing would work at all.

Michael, thoughts?
Cc: nikolaos@chromium.org
Owner: jochen@chromium.org
Why not https://chromium.googlesource.com/v8/v8/+/ad6ea932272a1f8f74535c31882aaff3fb8ee6d4 from that V8 roll?

Jochen could you route this to an owner? nikolaos on cc.
Components: -Infra>Client>V8

Comment 5 by jochen@chromium.org, Jan 12 2017

Cc: jochen@chromium.org adamk@chromium.org verwa...@chromium.org
Owner: marja@chromium.org
Marja, can you triage please

Comment 6 by marja@chromium.org, Jan 12 2017

Minimal repro case:

f = (e=({} = {} = 1)) => {}
f(1);

and nikolaos@'s commit is indeed the culprit. It's weird, the commit is supposedly just refactoring with no functional changes.


Investigating further.
I can take a look at it in the afternoon.  Sorry, I'm in a class right now.
Minimal repro case I found:

out.gn/x64.debug/d8 -e "((e = ({} = {} = {})) => {})()"

It seems that two {} assignments are necessary and the arrow function must
have a body (not an expression) for it to crash.

Comment 9 by marja@chromium.org, Jan 12 2017

Guessing that the bug is that InitializerRewriter is now a subclass of AstTravelsalVisitor instead of AstExpressionVisitor, and now it does something differently so that ast numbering is confused later. (AstNumberingVisitor is still a subclass of AstVisitor; that didn't change by the CL.)

It's curious that this only happens for lazy arrow function params.
I'm trying to compile the alleged culprit (commit ad6ea93), back from July,
and gclient sync fails with a Python error:

...
________ running '/usr/bin/python
v8/build/linux/sysroot_scripts/install-sysroot.py --running-as-hook' in
'/data/nickie/gaa'
Installing Debian Wheezy amd64 root image:
/data/nickie/gaa/v8/build/linux/debian_wheezy_amd64-sysroot
Downloading
https://commondatastorage.googleapis.com/chrome-linux-sysroot/toolchain/c52471d9dec240c8d0a88fa98aa1eefeee32e22f/debian_wheezy_amd64_sysroot.tgz
...
OSError: [Errno 2] No such file or directory
Error: Command '/usr/bin/python
v8/build/linux/sysroot_scripts/install-sysroot.py --running-as-hook'
returned non-zero exit status 1 in /data/nickie/gaa

I also tried to use an older version of depot_tools (from July) but this
did not work either.

Any idea what's happening?

Comment 11 by marja@chromium.org, Jan 12 2017

Some more debugging (but, nikolaos@, if you have time to take over, that'd be great):

Indeed, when renumbering, we get these expressions in AstNumberingVisitor::VisitReference:

Good:
VAR PROXY local[2] (mode = LET) "e"
VAR PROXY local[0] (mode = TEMPORARY) ""
VAR PROXY local[1] (mode = TEMPORARY) ""

Bad:
VAR PROXY local[1] (mode = LET) "e"
VAR PROXY local[0] (mode = TEMPORARY) ""
OBJ LITERAL at 13
. literal_index = 1


Comment 12 by marja@chromium.org, Jan 12 2017

nikolaos@; I confirmed that the example fails at revision 37998 and succeeds at the previous revision 37997 so I'm pretty confident that it's the culprit.

Sorry, no idea about the gclient sync error; I was able to run gclient sync on both revisions (the culprit and the previous one) just fine. :/

Hmm, I wonder what file is not found.
I thought it was the debian_wheezy_amd64_sysroot.tgz
<https://commondatastorage.googleapis.com/chrome-linux-sysroot/toolchain/c52471d9dec240c8d0a88fa98aa1eefeee32e22f/debian_wheezy_amd64_sysroot.tgz>
that
was missing, but it seems to be there...  Anyway, I'm on it and I hope I'll
be able to compile it.

Comment 14 by marja@chromium.org, Jan 12 2017

Great that you got it working. I think the error message is coming from being unable to open a *local* file, not being unable to download from the link.

I don't understand this bug yet but I'd like to. Maybe you can already tell me what's wrong, based on this:

In the good case, we call Parser::PatternRewriter::RewriteDestructuringAssignment twice (probably because of the foo = bar = baz construct), in the bad case only once.

The two calls in the good cases are coming from:

1)

#0  v8::internal::InitializerRewriter::VisitExpression (this=0x7fffffffb188, expr=0x1930800)
    at ../../src/parsing/parser.cc:4646
#1  0x0000000000db8e96 in v8::internal::AstExpressionVisitor::VisitRewritableExpression (
    this=0x7fffffffb188, expr=0x1930800) at ../../src/ast/ast-expression-visitor.cc:161
#2  0x0000000000db861e in v8::internal::AstTraversalVisitor::Visit (this=0x7fffffffb188, node=0x1930800)
    at ../../src/ast/ast.h:3066
#3  0x0000000000db8017 in v8::internal::AstExpressionVisitor::Run (this=0x7fffffffb188)
    at ../../src/ast/ast-expression-visitor.cc:23
#4  0x0000000000aaec5f in v8::internal::Parser::RewriteParameterInitializer (this=0x7fffffffc988, 
    expr=0x1930800, scope=0x1930850) at ../../src/parsing/parser.cc:4667
#5  0x0000000000aaef72 in v8::internal::Parser::BuildParameterInitializationBlock (this=0x7fffffffc988, 
    parameters=..., ok=0x7fffffffc1bf) at ../../src/parsing/parser.cc:4701
#6  0x0000000000aad3ba in v8::internal::Parser::ParseEagerFunctionBody (this=0x7fffffffc988, 
    function_name=0x0, pos=-1, parameters=..., kind=v8::internal::kArrowFunction, 
    function_type=v8::internal::FunctionLiteral::kAnonymousExpression, ok=0x7fffffffc1bf)
    at ../../src/parsing/parser.cc:4915
#7  0x0000000000ac310e in v8::internal::ParserTraits::ParseEagerFunctionBody (this=0x7fffffffc988, 
    name=0x0, pos=-1, parameters=..., kind=v8::internal::kArrowFunction, 
    function_type=v8::internal::FunctionLiteral::kAnonymousExpression, ok=0x7fffffffc1bf)
    at ../../src/parsing/parser.h:1175
#8  0x0000000000a9849a in v8::internal::ParserBase<v8::internal::ParserTraits>::ParseArrowFunctionLiteral (this=0x7fffffffc988, accept_IN=true, formal_parameters=..., is_async=false, formals_classifier=..., 
    ok=0x7fffffffc1bf) at ../../src/parsing/parser-base.h:3376

2)

#0  v8::internal::InitializerRewriter::VisitExpression (this=0x7fffffffb188, expr=0x1931720)
    at ../../src/parsing/parser.cc:4646
#1  0x0000000000db8706 in v8::internal::AstExpressionVisitor::VisitDoExpression (this=0x7fffffffb188, 
    expr=0x1931720) at ../../src/ast/ast-expression-visitor.cc:36
#2  0x0000000000db85ff in v8::internal::AstTraversalVisitor::Visit (this=0x7fffffffb188, node=0x1931720)
    at ../../src/ast/ast.h:3066
#3  0x0000000000dc975f in v8::internal::AstTraversalVisitor::VisitRewritableExpression (
    this=0x7fffffffb188, expr=0x1930800) at ../../src/ast/ast.cc:1219
#4  0x0000000000db8ea6 in v8::internal::AstExpressionVisitor::VisitRewritableExpression (
    this=0x7fffffffb188, expr=0x1930800) at ../../src/ast/ast-expression-visitor.cc:162
#5  0x0000000000db861e in v8::internal::AstTraversalVisitor::Visit (this=0x7fffffffb188, node=0x1930800)
    at ../../src/ast/ast.h:3066
#6  0x0000000000db8017 in v8::internal::AstExpressionVisitor::Run (this=0x7fffffffb188)
    at ../../src/ast/ast-expression-visitor.cc:23
#7  0x0000000000aaec5f in v8::internal::Parser::RewriteParameterInitializer (this=0x7fffffffc988, 
    expr=0x1930800, scope=0x1930850) at ../../src/parsing/parser.cc:4667
#8  0x0000000000aaef72 in v8::internal::Parser::BuildParameterInitializationBlock (this=0x7fffffffc988, 
    parameters=..., ok=0x7fffffffc1bf) at ../../src/parsing/parser.cc:4701
#9  0x0000000000aad3ba in v8::internal::Parser::ParseEagerFunctionBody (this=0x7fffffffc988, 
    function_name=0x0, pos=-1, parameters=..., kind=v8::internal::kArrowFunction, 
    function_type=v8::internal::FunctionLiteral::kAnonymousExpression, ok=0x7fffffffc1bf)
    at ../../src/parsing/parser.cc:4915
#10 0x0000000000ac310e in v8::internal::ParserTraits::ParseEagerFunctionBody (this=0x7fffffffc988, 
    name=0x0, pos=-1, parameters=..., kind=v8::internal::kArrowFunction, 
    function_type=v8::internal::FunctionLiteral::kAnonymousExpression, ok=0x7fffffffc1bf)
    at ../../src/parsing/parser.h:1175
#11 0x0000000000a9849a in v8::internal::ParserBase<v8::internal::ParserTraits>::ParseArrowFunctionLiteral (this=0x7fffffffc988, accept_IN=true, formal_parameters=..., is_async=false, formals_classifier=..., 
    ok=0x7fffffffc1bf) at ../../src/parsing/parser-base.h:3376

So maybe it's VisitRewritableExpression where the difference is?

Comment 15 by marja@chromium.org, Jan 12 2017

Iow, maybe VisitRewritableExpression doesn't now recurse properly if there's another RewritableExpression inside it?

Comment 16 by marja@chromium.org, Jan 12 2017

Aha, suspecting that either InitializerRewriter::VisitRewritableExpression should recurse properly, or we should have InitializerRewriter overwrite VisitExpression instead of VisitRewritableExpression. Preparing a fix...

Comment 17 by marja@chromium.org, Jan 12 2017

Cc: ca...@igalia.com
Some more details about this:

State before the refactoring:

InitializerRewriter is a subclass of AstVisitor. It overrides VisitExpression. And AstVisitor::VisitRewritableExpression does this:

void AstExpressionVisitor::VisitRewritableExpression(
    RewritableExpression* expr) {
  VisitExpression(expr); << this will be InitializerRewriter::VisitExpression
  AstTraversalVisitor::VisitRewritableExpression(expr); << recurse!
}

After the refactoring, InitializerRewriter is a subclass over AstTraversalVisitor, and overrides VisitRewritableExpression directly. And it doesn't recurse.
Project Member

Comment 18 by bugdroid1@chromium.org, Jan 12 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/v8/v8.git/+/aff64e9dfa436f62555325daf788e81f59b810fb

commit aff64e9dfa436f62555325daf788e81f59b810fb
Author: marja <marja@chromium.org>
Date: Thu Jan 12 15:52:00 2017

Parser: Fix InitializerRewriter.

The bug was caused by AstTraversalVisitor refactoring:
https://codereview.chromium.org/2169833002/

InitializerRewriter::VisitRewritableExpression in parser.cc didn't recurse; so
it fails when a rewritable expression contains another rewritable expression.

See the bug for more details.

BUG= chromium:679727 

Review-Url: https://codereview.chromium.org/2629623002
Cr-Commit-Position: refs/heads/master@{#42274}

[modify] https://crrev.com/aff64e9dfa436f62555325daf788e81f59b810fb/src/parsing/parser.cc
[add] https://crrev.com/aff64e9dfa436f62555325daf788e81f59b810fb/test/mjsunit/regress/regress-679727.js

Project Member

Comment 19 by bugdroid1@chromium.org, Jan 12 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/v8/v8.git/+/aff64e9dfa436f62555325daf788e81f59b810fb

commit aff64e9dfa436f62555325daf788e81f59b810fb
Author: marja <marja@chromium.org>
Date: Thu Jan 12 15:52:00 2017

Parser: Fix InitializerRewriter.

The bug was caused by AstTraversalVisitor refactoring:
https://codereview.chromium.org/2169833002/

InitializerRewriter::VisitRewritableExpression in parser.cc didn't recurse; so
it fails when a rewritable expression contains another rewritable expression.

See the bug for more details.

BUG= chromium:679727 

Review-Url: https://codereview.chromium.org/2629623002
Cr-Commit-Position: refs/heads/master@{#42274}

[modify] https://crrev.com/aff64e9dfa436f62555325daf788e81f59b810fb/src/parsing/parser.cc
[add] https://crrev.com/aff64e9dfa436f62555325daf788e81f59b810fb/test/mjsunit/regress/regress-679727.js

Thanks Marja, for taking care of this.

Comment 21 by marja@chromium.org, Jan 12 2017

Alright, fixed. Thanks for the bug report, OP, this was a good bug report. And a great catch!

Comment 22 by marja@chromium.org, Jan 12 2017

Status: Fixed (was: Assigned)
Labels: -Pri-2 -M-57 merge-review-5.6 NodeJS-Backport-Review M-55 Pri-1
We should merge this fix back to at least 56 when it has Canary coverage.

Comment 24 by marja@chromium.org, Jan 19 2017

Now there's probably canary coverage; how do we merge it back?

(Otoh, there were quite many stable revisions already where this was broken... half a year worth of stable revisions, so, around 4 +- 1.)
Labels: -merge-review-5.6

Sign in to add a comment