Skip to content
New issue

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

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

Already on GitHub? # to your account

Dart2JS Compiler Crash Error #24057

Closed
curtis-robert opened this issue Aug 12, 2015 · 6 comments
Closed

Dart2JS Compiler Crash Error #24057

curtis-robert opened this issue Aug 12, 2015 · 6 comments
Assignees
Labels
P2 A bug or feature request we're likely to work on web-dart2js

Comments

@curtis-robert
Copy link

D:\projectFolder\web>dart2js --out=main.dart.js main.dart
main.dart:
Internal Error: The compiler crashed when compiling this element.

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.

The Dart team would greatly appreciate if you would take a moment to
report this problem at http://dartbug.com/new.

Please include the following information:

  • the name and version of your operating system: Windows 7 Enterprise, 64 Bit
  • the Dart SDK build number (1.11.1), and
  • the entire message you see here (including the full stack trace
    below as well as the source location above).

The compiler crashed: Stack Overflow
#0 Compiler.run.<run_async_body> (file:///e:/b/build/slave/dart-sdk-windows

-stable/build/sdk/pkg/compiler/lib/src/apiimpl.dart)
#1 _asyncCatchHelper. (dart:core-patch/core_patch.dart:1

#2 _RootZone.runBinary (dart:async/zone.dart:1171)
#3 _Future._propagateToListeners.handleError (dart:async/future_impl.dart:5

#4 _Future._propagateToListeners (dart:async/future_impl.dart:580)
#5 _Future._completeWithValue (dart:async/future_impl.dart:368)
#6 _Future._asyncComplete. (dart:async/future_impl.dart:

#7 _microtaskLoop (dart:async/schedule_microtask.dart:43)
#8 _microtaskLoopEntry (dart:async/schedule_microtask.dart:52)
#9 _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:96)
#10 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dar

t:149)
#11 _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:96)
#12 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dar

t:149)
#13 _Future._asyncComplete. (dart:async/future_impl.dart:

#14 _microtaskLoop (dart:async/schedule_microtask.dart:43)
#15 _microtaskLoopEntry (dart:async/schedule_microtask.dart:52)
#16 _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:96)
#17 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dar

t:149)

@harryterkelsen
Copy link
Contributor

Can you provide the dart file that cause the crash?

@harryterkelsen harryterkelsen self-assigned this Aug 12, 2015
@curtis-robert
Copy link
Author

It's the main file for an entire project. UIInteraction initializes a lot of different classes and objects for a web application.

But here's the main.dart file contents itself:

import 'UIInteraction.dart';

void main() {
UIInteraction init = new UIInteraction();
}

@harryterkelsen
Copy link
Contributor

Is the project somewhere I can access?

On Wed, Aug 12, 2015, 11:54 AM curtis-robert notifications@github.com
wrote:

It's the main file for an entire project. UIInteraction initializes a lot
of different classes and objects for a web application.

But here's the main.dart file contents itself:

import 'UIInteraction.dart';

void main() {
UIInteraction init = new UIInteraction();
}


Reply to this email directly or view it on GitHub
#24057 (comment).

@curtis-robert
Copy link
Author

Alright, sorry about the delay.

I couldn't figure out how to upload the file here, so it's at this link, named "problemFile.DART":
https://sites.google.com/site/horizonmapdata/home

I went through my project and found that this file was the point where the conversion failed.

I've figured out that it is able to add a few of the <key, value> pairs to the Map, but at a certain point the Dart2JS conversion fails. I say certain point because it's not the same point every time. For example, the conversion works when I put a return statement at line 646, right before adding the key "Line31" to the the map, but then it doesn't if I remove the return statement (which makes it look like that key may be the problem). However, if I comment out the adding of keys "Line16", "Line19", "Line22", "Line25", and "Line28", and then put the return statement after "Line31" it works.

@rakudrama
Copy link
Member

You could try a couple of things:

  1. Use a static initializer. This does less inlining, so it might be compiling a smaller function.
class MapOverlayDictionary {
    Map horizonCoordinates;

    MapOverlayDictionary() {
        initializeMap();
    }

    void initializeMap() {
        horizonCoordinates = _data; 
    }

    static var _data = {
        "Bus1": [new LatLng(46.7545166, -122.865112), 
            new LatLng(46.7545204, -122.864334), 
            new LatLng(46.7536354, -122.864288), 
            new LatLng(46.7534904, -122.864418), 
            new LatLng(46.7534904, -122.864632), 
            new LatLng(46.7536507, -122.864784), 
            new LatLng(46.7541847, -122.864822), 
            new LatLng(46.7542534, -122.864868), 
            new LatLng(46.7544022, -122.865112), 
            new LatLng(46.7545166, -122.865112)],
      "Bus2": [ ... ]
    };
}
  1. Break it up into some local functions (which will not be inlined by the current compiler)
class MapOverlayDictionary {
    Map horizonCoordinates;

    MapOverlayDictionary() {
        initializeMap();
    }

    void initializeMap() {
      horizonCoordinates = new Map();
      part1() {
        horizonCoordinates["Bus1"] = [
            new LatLng(46.7545166, -122.865112), 
            new LatLng(46.7545204, -122.864334), 
            new LatLng(46.7536354, -122.864288), 
            new LatLng(46.7534904, -122.864418), 
            new LatLng(46.7534904, -122.864632), 
            new LatLng(46.7536507, -122.864784), 
            new LatLng(46.7541847, -122.864822), 
            new LatLng(46.7542534, -122.864868), 
            new LatLng(46.7544022, -122.865112), 
            new LatLng(46.7545166, -122.865112)
        ];
      }
      part2() { ... }
      ...

      part1();
      part2();
     ...
    }

@rakudrama
Copy link
Member

I'm moving this to #24635 since I have added a test for this problem.

@kevmoo kevmoo added P2 A bug or feature request we're likely to work on and removed Priority-Medium labels Mar 1, 2016
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
P2 A bug or feature request we're likely to work on web-dart2js
Projects
None yet
Development

No branches or pull requests

6 participants