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

Build error in dart2js #43791

Closed
fidlip opened this issue Oct 14, 2020 · 3 comments
Closed

Build error in dart2js #43791

fidlip opened this issue Oct 14, 2020 · 3 comments
Labels
area-web Use area-web for Dart web related issues, including the DDC and dart2js compilers and JS interop. dart2js-crash web-dart2js

Comments

@fidlip
Copy link

fidlip commented Oct 14, 2020

[SEVERE] build_web_compilers|entrypoint on web/main.dart:
Dart2Js finished with:

packages/KPMG_journey_frontend/src/utils/bpmn/viewer_options.dart:21:3:
Internal Error: The compiler crashed when compiling this element.
ViewerOptions.internal();
^
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,

  • the Dart SDK build number (2.1.0), and

  • the entire message you see here (including the full stack trace
    below as well as the source location above).

The compiler crashed: RangeError (index): Invalid value: Valid value range is empty: 0
#0 List.[] (dart:core/runtime/libgrowable_array.dart:145:60)
#1 SsaLoadElimination.visitCreate. (file:///tmp/tmpqIBfjJ/dart-2.1.0/dart/pkg/compiler/lib/src/ssa/optimize.dart:2752:54)
#2 CodegenWorldBuilderImpl.forEachInstanceField. (file:///tmp/tmpqIBfjJ/dart-2.1.0/dart/pkg/compiler/lib/src/universe/codegen_world_builder.dart:674:55)
#3 JsToElementMapBase._forEachClassMember. (file:///tmp/tmpqIBfjJ/dart-2.1.0/dart/pkg/compiler/lib/src/js_model/element_map_impl.dart:650:8)
#4 JClassEnvImpl.forEachMember. (file:///tmp/tmpqIBfjJ/dart-2.1.0/dart/pkg/compiler/lib/src/js_model/env.dart:277:8)
#5 List.forEach (dart:core/runtime/libgrowable_array.dart:278:8)
#6 JClassEnvImpl.forEachMember (file:///tmp/tmpqIBfjJ/dart-2.1.0/dart/pkg/compiler/lib/src/js_model/env.dart:276:14)
#7 JsToElementMapBase._forEachClassMember (file:///tmp/tmpqIBfjJ/dart-2.1.0/dart/pkg/compiler/lib/src/js_model/element_map_impl.dart:649:9)
#8 JsElementEnvironment.forEachClassMember (file:///tmp/tmpqIBfjJ/dart-2.1.0/dart/pkg/compiler/lib/src/js_model/element_map_impl.dart:1280:16)
#9 CodegenWorldBuilderImpl.forEachInstanceField (file:///tmp/tmpqIBfjJ/dart-2.1.0/dart/pkg/compiler/lib/src/universe/codegen_world_builder.dart:672:25)
#10 SsaLoadElimination.visitCreate (file:///tmp/tmpqIBfjJ/dart-2.1.0/dart/pkg/compiler/lib/src/ssa/optimize.dart:2740:36)
#11 HCreate.accept (file:///tmp/tmpqIBfjJ/dart-2.1.0/dart/pkg/compiler/lib/src/ssa/nodes.dart:1586:39)
#12 SsaLoadElimination.visitBasicBlock (file:///tmp/tmpqIBfjJ/dart-2.1.0/dart/pkg/compiler/lib/src/ssa/optimize.dart:2682:19)
#13 SsaLoadElimination.visitGraph (file:///tmp/tmpqIBfjJ/dart-2.1.0/dart/pkg/compiler/lib/src/ssa/optimize.dart:2641:7)
#14 SsaOptimizerTask.optimize.runPhase. (file:///tmp/tmpqIBfjJ/dart-2.1.0/dart/pkg/compiler/lib/src/ssa/optimize.dart:58:46)
#15 CompilerTask.measureSubtask (file:///tmp/tmpqIBfjJ/dart-2.1.0/dart/pkg/compiler/lib/src/common/tasks.dart:178:35)
#16 SsaOptimizerTask.optimize.runPhase (file:///tmp/tmpqIBfjJ/dart-2.1.0/dart/pkg/compiler/lib/src/ssa/optimize.dart:58:7)
#17 List.forEach (dart:core/runtime/libgrowable_array.dart:278:8)
#18 SsaOptimizerTask.optimize. (file:///tmp/tmpqIBfjJ/dart-2.1.0/dart/pkg/compiler/lib/src/ssa/optimize.dart:114:14)
#19 CompilerTask.measure (file:///tmp/tmpqIBfjJ/dart-2.1.0/dart/pkg/compiler/lib/src/common/tasks.dart:63:51)
#20 SsaOptimizerTask.optimize (file:///tmp/tmpqIBfjJ/dart-2.1.0/dart/pkg/compiler/lib/src/ssa/optimize.dart:68:5)
#21 SsaFunctionCompiler.compile (file:///tmp/tmpqIBfjJ/dart-2.1.0/dart/pkg/compiler/lib/src/ssa/ssa.dart:46:15)
#22 JavaScriptBackend.codegen (file:///tmp/tmpqIBfjJ/dart-2.1.0/dart/pkg/compiler/lib/src/js_backend/backend.dart:692:26)
#23 KernelCodegenWorkItem.run (file:///tmp/tmpqIBfjJ/dart-2.1.0/dart/pkg/compiler/lib/src/js_model/js_strategy.dart:1138:21)
#24 Compiler.emptyQueue..... (file:///tmp/tmpqIBfjJ/dart-2.1.0/dart/pkg/compiler/lib/src/compiler.dart:434:70)
#25 CompilerTask.measureSubtask (file:///tmp/tmpqIBfjJ/dart-2.1.0/dart/pkg/compiler/lib/src/common/tasks.dart:178:35)
#26 Compiler.emptyQueue.... (file:///tmp/tmpqIBfjJ/dart-2.1.0/dart/pkg/compiler/lib/src/compiler.dart:434:32)
#27 CompilerTask.measureSubtask (file:///tmp/tmpqIBfjJ/dart-2.1.0/dart/pkg/compiler/lib/src/common/tasks.dart:178:35)
#28 Compiler.emptyQueue... (file:///tmp/tmpqIBfjJ/dart-2.1.0/dart/pkg/compiler/lib/src/compiler.dart:432:28)
#29 CompilerDiagnosticReporter.withCurrentElement (file:///tmp/tmpqIBfjJ/dart-2.1.0/dart/pkg/compiler/lib/src/compiler.dart:755:15)
#30 Compiler.emptyQueue.. (file:///tmp/tmpqIBfjJ/dart-2.1.0/dart/pkg/compiler/lib/src/compiler.dart:430:18)
#31 CodegenEnqueuer._forEach (file:///tmp/tmpqIBfjJ/dart-2.1.0/dart/pkg/compiler/lib/src/js_backend/enqueuer.dart:240:12)
#32 CodegenEnqueuer.forEach (file:///tmp/tmpqIBfjJ/dart-2.1.0/dart/pkg/compiler/lib/src/js_backend/enqueuer.dart:255:5)
#33 Compiler.emptyQueue. (file:///tmp/tmpqIBfjJ/dart-2.1.0/dart/pkg/compiler/lib/src/compiler.dart:426:16)
#34 CompilerTask.measureSubtask (file:///tmp/tmpqIBfjJ/dart-2.1.0/dart/pkg/compiler/lib/src/common/tasks.dart:178:35)
#35 Compiler.emptyQueue (file:///tmp/tmpqIBfjJ/dart-2.1.0/dart/pkg/compiler/lib/src/compiler.dart:425:14)
#36 Compiler.processQueue. (file:///tmp/tmpqIBfjJ/dart-2.1.0/dart/pkg/compiler/lib/src/compiler.dart:451:7)
#37 CompilerTask.measureSubtask (file:///tmp/tmpqIBfjJ/dart-2.1.0/dart/pkg/compiler/lib/src/common/tasks.dart:178:35)
#38 Compiler.processQueue (file:///tmp/tmpqIBfjJ/dart-2.1.0/dart/pkg/compiler/lib/src/compiler.dart:444:14)
#39 Compiler.generateJavaScriptCode (file:///tmp/tmpqIBfjJ/dart-2.1.0/dart/pkg/compiler/lib/src/compiler.dart:370:5)
#40 Compiler.compileLoadedLibraries. (file:///tmp/tmpqIBfjJ/dart-2.1.0/dart/pkg/compiler/lib/src/compiler.dart:395:9)
#41 CompilerTask.measureSubtask (file:///tmp/tmpqIBfjJ/dart-2.1.0/dart/pkg/compiler/lib/src/common/tasks.dart:178:35)
#42 Compiler.compileLoadedLibraries (file:///tmp/tmpqIBfjJ/dart-2.1.0/dart/pkg/compiler/lib/src/compiler.dart:389:14)
#43 Compiler.runInternal (file:///tmp/tmpqIBfjJ/dart-2.1.0/dart/pkg/compiler/lib/src/compiler.dart:276:5)

#44 Compiler.run.. (file:///tmp/tmpqIBfjJ/dart-2.1.0/dart/pkg/compiler/lib/src/compiler.dart:216:38)
#45 new Future.sync (dart:async/future.dart:224:31)
#46 Compiler.run. (file:///tmp/tmpqIBfjJ/dart-2.1.0/dart/pkg/compiler/lib/src/compiler.dart:216:20)
#47 CompilerTask.measureSubtask (file:///tmp/tmpqIBfjJ/dart-2.1.0/dart/pkg/compiler/lib/src/common/tasks.dart:178:35)
#48 Compiler.run (file:///tmp/tmpqIBfjJ/dart-2.1.0/dart/pkg/compiler/lib/src/compiler.dart:213:41)
#49 CompilerImpl.run.. (file:///tmp/tmpqIBfjJ/dart-2.1.0/dart/pkg/compiler/lib/src/apiimpl.dart:148:22)
#50 _RootZone.runUnary (dart:async/zone.dart:1379:54)
#51 _FutureListener.handleValue (dart:async/future_impl.dart:129:18)
#52 Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:642:45)
#53 Future._propagateToListeners (dart:async/future_impl.dart:671:32)
#54 Future._completeWithValue (dart:async/future_impl.dart:486:5)
#55 Future._asyncComplete. (dart:async/future_impl.dart:516:7)
#56 _microtaskLoop (dart:async/schedule_microtask.dart:41:21)
#57 _startMicrotaskLoop (dart:async/schedule_microtask.dart:50:5)
#58 _runPendingImmediateCallback (dart:isolate/runtime/libisolate_patch.dart:115:13)
#59 _RawReceivePortImpl._handleMessage (dart:isolate/runtime/libisolate_patch.dart:172:5)

  • Dart VM version: 2.1.0 (Unknown timestamp) on "linux_x64"
  • Linux Ubuntu 20.04 LTS 64-bit
  • Chrome
@sigmundch sigmundch added area-web Use area-web for Dart web related issues, including the DDC and dart2js compilers and JS interop. dart2js-crash needs-info We need additional information from the issue author (auto-closed after 14 days if no response) web-dart2js labels Oct 14, 2020
@sigmundch
Copy link
Member

Thanks for reporting the issue.

To make it easier for us to investigate, could you provide a small code snippet that triggers this?

Also, Dart 2.1.0 is a few months old, does this issue show up on the latest stable release (2.10.1)?

@fidlip
Copy link
Author

fidlip commented Oct 15, 2020

Thank you for reply. Project is very huge to realize what could really reproduce this error, but what I can read from message, it could be this class

@anonymous
@JS()
class ViewerOptions {
  Element container;
  dynamic width;
  dynamic height;
  Object moddleExtensions;
  List<Object> modules;
  List<Object> additionalModules;
  ViewerOptions.internal();

  factory ViewerOptions({Element container, dynamic width, dynamic height, Object moddleExtensions, List<Object> modules, List<Object> additionalModules}) {
    var options = ViewerOptions.internal();
    options.container = container;
    options.width = width;
    options.height = height;
    options.moddleExtensions = moddleExtensions;
    options.modules = modules;
    options.additionalModules = additionalModules;
    return options;
  }
}

Upgrade to newest SDK would be hard fight and unfortunately it is not on the agenda for our customer yet.

@no-response no-response bot removed the needs-info We need additional information from the issue author (auto-closed after 14 days if no response) label Oct 15, 2020
@fidlip
Copy link
Author

fidlip commented Oct 15, 2020

I just tried to update at least to 2.2.0 and it seems the issue disappears. I am closing issue. Thank you.

@fidlip fidlip closed this as completed Oct 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-web Use area-web for Dart web related issues, including the DDC and dart2js compilers and JS interop. dart2js-crash web-dart2js
Projects
None yet
Development

No branches or pull requests

2 participants