Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dart2js explodes with "No error location for error" during an argument number mismatch #7003

Closed
efortuna opened this issue Nov 28, 2012 · 8 comments
Assignees
Labels
P3 A lower priority bug or feature request web-dart2js

Comments

@efortuna
Copy link
Contributor

The code causing the problem was this line:

    JS('void', '#(#, #, #, #, #, #, #, #, #, #, #)', this, function, type,
        canBubble, cancelable, view, keyIdentifier, keyLocation, ctrlKey,
        altKey, shiftKey, metaKey, altGraphKey);

This issue is this is one additional argument passed to the JS function than there are # slots (the "this" should be removed).
OS: Mac OSX Mountain Lion
Revision number: 15458

I was working on html libs, and wrote a new test (along with new functionality) where this showed up. I've attached the test file and the compiled js output just for info.

Here's the full output:
FAILED: dart2js-chrome release_ia32 html/keyboard_event_test
Expected: pass
Actual: crash
Unexpected compile-time error.

stdout:
sdk/lib/html/dart2js/html_dart2js.dart:11368:8: Error: The compiler crashed when compiling this element.
  void $dom_initKeyboardEvent(String type, bool canBubble, bool cancelable,
       ^^^^^^^^^^^^^^^^^^^^^^
The compiler is broken.

When compiling the above element, the compiler crashed. It is not
possible to tell if this is caused by a problem in your program or
not. Regardless, the compiler should not crash.

Internal error: No error location for error: Internal error: Wrong number of arguments for JS: #(#, #, #, #, #, #, #, #, #, #, #)

­0 Compiler.cancel (file:///Users/efortuna/git-dart/dart/sdk/lib/_internal/compiler/implementation/compiler.dart:310:7)

­1 Compiler.internalError (file:///Users/efortuna/git-dart/dart/sdk/lib/_internal/compiler/implementation/compiler.dart:278:11)

­2 Printer.visitLiteralExpression (file:///Users/efortuna/git-dart/dart/sdk/lib/_internal/compiler/implementation/js/printer.dart:803:29)

­3 LiteralExpression.accept (file:///Users/efortuna/git-dart/dart/sdk/lib/_internal/compiler/implementation/js/nodes.dart:441:64)

­4 Printer.visit (file:///Users/efortuna/git-dart/dart/sdk/lib/_internal/compiler/implementation/js/printer.dart:94:16)

­5 Printer.visitNestedExpression (file:///Users/efortuna/git-dart/dart/sdk/lib/_internal/compiler/implementation/js/printer.dart:435:12)

­6 Printer.visitExpressionStatement (file:///Users/efortuna/git-dart/dart/sdk/lib/_internal/compiler/implementation/js/printer.dart:166:26)

­7 ExpressionStatement.accept (file:///Users/efortuna/git-dart/dart/sdk/lib/_internal/compiler/implementation/js/nodes.dart:182:66)

­8 Printer.visit (file:///Users/efortuna/git-dart/dart/sdk/lib/_internal/compiler/implementation/js/printer.dart:94:16)

­9 Printer.blockOutWithoutBraces.blockOutWithoutBraces (file:///Users/efortuna/git-dart/dart/sdk/lib/_internal/compiler/implementation/js/printer.dart:144:12)

­10 List.forEach (dart:core-patch:860:8)

­11 Printer.blockOut (file:///Users/efortuna/git-dart/dart/sdk/lib/_internal/compiler/implementation/js/printer.dart:153:28)

­12 Printer.blockBody (file:///Users/efortuna/git-dart/dart/sdk/lib/_internal/compiler/implementation/js/printer.dart:124:15)

­13 Printer.functionOut (file:///Users/efortuna/git-dart/dart/sdk/lib/_internal/compiler/implementation/js/printer.dart:401:14)

­14 Printer.visitFun (file:///Users/efortuna/git-dart/dart/sdk/lib/_internal/compiler/implementation/js/printer.dart:710:16)

­15 Fun.accept (file:///Users/efortuna/git-dart/dart/sdk/lib/_internal/compiler/implementation/js/nodes.dart:699:50)

­16 Printer.visit (file:///Users/efortuna/git-dart/dart/sdk/lib/_internal/compiler/implementation/js/printer.dart:94:16)

­17 prettyPrint (file:///Users/efortuna/git-dart/dart/sdk/lib/_internal/compiler/implementation/js/printer.dart:942:16)

­18 SsaCodeGeneratorTask.prettyPrint (file:///Users/efortuna/git-dart/dart/sdk/lib/_internal/compiler/implementation/ssa/codegen.dart:41:30)

­19 SsaCodeGeneratorTask.generateMethod.<anonymous closure> (file:///Users/efortuna/git-dart/dart/sdk/lib/_internal/compiler/implementation/ssa/codegen.dart:99:25)

­20 CompilerTask.measure (file:///Users/efortuna/git-dart/dart/sdk/lib/_internal/compiler/implementation/compiler.dart:871:24)

­21 SsaCodeGeneratorTask.generateMethod (file:///Users/efortuna/git-dart/dart/sdk/lib/_internal/compiler/implementation/ssa/codegen.dart:67:19)

­22 SsaCodeGeneratorTask.generateCode (file:///Users/efortuna/git-dart/dart/sdk/lib/_internal/compiler/implementation/ssa/codegen.dart:50:28)

­23 JavaScriptBackend.codegen (file:///Users/efortuna/git-dart/dart/sdk/lib/_internal/compiler/implementation/js_backend/backend.dart:893:51)

­24 Compiler.codegen (file:///Users/efortuna/git-dart/dart/sdk/lib/_internal/compiler/implementation/compiler.dart:686:20)

­25 WorkItem.run (file:///Users/efortuna/git-dart/dart/sdk/lib/_internal/compiler/implementation/compiler.dart:57:21)

­26 Compiler.processQueue.<anonymous closure>.<anonymous closure> (file:///Users/efortuna/git-dart/dart/sdk/lib/_internal/compiler/implementation/compiler.dart:578:54)

­27 Compiler.withCurrentElement (file:///Users/efortuna/git-dart/dart/sdk/lib/_internal/compiler/implementation/compiler.dart:153:15)

­28 Compiler.withCurrentElement (file:///Users/efortuna/git-dart/dart/sdk/lib/_internal/compiler/implementation/compiler.dart:173:7)

­29 Compiler.processQueue.<anonymous closure> (file:///Users/efortuna/git-dart/dart/sdk/lib/_internal/compiler/implementation/compiler.dart:578:25)

­30 Enqueuer.forEach (file:///Users/efortuna/git-dart/dart/sdk/lib/_internal/compiler/implementation/enqueue.dart:397:8)

­31 Compiler.processQueue (file:///Users/efortuna/git-dart/dart/sdk/lib/_internal/compiler/implementation/compiler.dart:577:18)

­32 Compiler.runCompiler (file:///Users/efortuna/git-dart/dart/sdk/lib/_internal/compiler/implementation/compiler.dart:547:17)

­33 Compiler.run (file:///Users/efortuna/git-dart/dart/sdk/lib/_internal/compiler/implementation/compiler.dart:344:18)

­34 Compiler.run (file:///Users/efortuna/git-dart/dart/sdk/lib/_internal/compiler/implementation/compiler.dart:345:7)

­35 Compiler.run (file:///Users/efortuna/git-dart/dart/sdk/lib/_internal/compiler/implementation/apiimpl.dart:158:29)

­36 compile (file:///Users/efortuna/git-dart/dart/sdk/lib/_internal/compiler/compiler.dart:55:15)

­37 compile (file:///Users/efortuna/git-dart/dart/sdk/lib/_internal/compiler/implementation/dart2js.dart:289:28)

­38 compilerMain (file:///Users/efortuna/git-dart/dart/sdk/lib/_internal/compiler/implementation/dart2js.dart:342:10)

­39 main (file:///Users/efortuna/git-dart/dart/sdk/lib/_internal/compiler/implementation/dart2js.dart:460:17)


Attachments:
html_dart2js.dart (821.03 KB)
keyboard_event_test.dart (707 Bytes)

@kasperl
Copy link

kasperl commented Nov 29, 2012

Added this to the Later milestone.

@kasperl
Copy link

kasperl commented May 23, 2013

Added TriageForM5 label.

@kasperl
Copy link

kasperl commented May 28, 2013

Removed this from the Later milestone.
Added this to the M5 milestone.
Removed TriageForM5 label.

@kasperl
Copy link

kasperl commented May 28, 2013

Removed this from the M5 milestone.
Added this to the Later milestone.

@kasperl
Copy link

kasperl commented Jul 10, 2014

Removed this from the Later milestone.
Added Oldschool-Milestone-Later label.

@kasperl
Copy link

kasperl commented Aug 4, 2014

Removed Oldschool-Milestone-Later label.

@sigmundch
Copy link
Member

given that JS() is used only by the dart: libraries, I'm inclined to not spend much effort on this at this time.

@rakudrama - do you agree or do you think we should make the compiler more resilient to these kind of mismatches?

@sigmundch sigmundch reopened this Sep 18, 2015
@sigmundch sigmundch added P3 A lower priority bug or feature request and removed Priority-Medium labels Sep 18, 2015
@rakudrama rakudrama self-assigned this Sep 19, 2015
@rakudrama
Copy link
Member

Trivial to fix this: https://chromiumcodereview.appspot.com/1353243002/

@kevmoo kevmoo removed the triaged label Mar 1, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P3 A lower priority bug or feature request web-dart2js
Projects
None yet
Development

No branches or pull requests

5 participants