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

Dart 2-dev.63 crashes: Segmentation fault #33430

Closed
chalin opened this issue Jun 12, 2018 · 12 comments
Closed

Dart 2-dev.63 crashes: Segmentation fault #33430

chalin opened this issue Jun 12, 2018 · 12 comments
Assignees
Labels
area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. crash Process exits with SIGSEGV, SIGABRT, etc. An unhandled exception is not a crash. P1 A high priority bug; for example, a single project is unusable or has many test failures
Milestone

Comments

@chalin
Copy link
Contributor

chalin commented Jun 12, 2018

Environment

Dart VM version: 2.0.0-dev.61.0 to -dev.63.0 on "macos_x64"

Steps to reproduce

  1. Clone https://github.com/chalin/linkcheck
  2. Checkout the chalin-dart-2-runtime-0612 branch (Use master now.)
  3. pub upgrade
  4. dart --preview-dart-2 test/e2e_test.dart

Expected result

The tests should run, but instead dart crashes:

> dart --preview-dart-2 test/e2e_test.dart
00:00 +0: linkcheck e2e reports no errors or warnings for a site without issues
2018-06-12T14:17:40.675072  0:00:00.026956 GET     [200] /
2018-06-12T14:17:40.722348  0:00:00.001239 GET     [404] /robots.txt
2018-06-12T14:17:40.844328  0:00:00.000416 GET     [200] /main.css

===== CRASH =====
version=2.0.0-dev.61.0 (Mon Jun 11 15:46:09 2018 +0200) on "macos_x64"
si_signo=Segmentation fault: 11(11), si_code=1, si_addr=0x0
Dumping native stack trace for thread 2903
  [0x000000010c91f470] dart::Instance::CheckAndCanonicalizeFields(dart::Thread*, char const**) const

===== CRASH =====
version=2.0.0-dev.61.0 (Mon Jun 11 15:46:09 2018 +0200) on "macos_x64"
si_signo=Segmentation fault: 11(11), si_code=1, si_addr=0x0
Aborting re-entrant request for stack trace.
Abort trap: 6

cc @kwalrath @kevmoo @natebosch

@kevmoo kevmoo added area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. crash Process exits with SIGSEGV, SIGABRT, etc. An unhandled exception is not a crash. labels Jun 12, 2018
@chalin
Copy link
Contributor Author

chalin commented Jun 12, 2018

FYI, it seems to run w/o issue under Linux as can be seen from this Travis log.

@chalin
Copy link
Contributor Author

chalin commented Jun 12, 2018

Oops, no, I take that back: test run fine w/o the --preview-dart-2 flag, but with --preview-dart-2 it crashes under Linux too, as can be seen from this Travis log.

chalin added a commit to chalin/linkcheck that referenced this issue Jun 12, 2018
@chalin
Copy link
Contributor Author

chalin commented Jun 13, 2018

FYI, it is still crashing under 2-dev.62, see this Travis log.

chalin added a commit to dart-lang/site-www that referenced this issue Jun 13, 2018
chalin added a commit to dart-lang/site-www that referenced this issue Jun 13, 2018
* chore: globally set DART_VM_OPTIONS=--preview-dart-2

* Revert setting of env var in travis.yml

(Until dart-lang/sdk#33430 is fixed)
chalin added a commit to chalin/linkcheck that referenced this issue Jun 14, 2018
chalin added a commit to chalin/linkcheck that referenced this issue Jun 14, 2018
@kevmoo kevmoo added the P1 A high priority bug; for example, a single project is unusable or has many test failures label Jun 14, 2018
@chalin
Copy link
Contributor Author

chalin commented Jun 15, 2018

Just keeping y'all up-to-date: it is still crashing under 2-dev.63.

@kevmoo kevmoo changed the title Dart 2-dev.61 crashes: Segmentation fault Dart 2-dev.63 crashes: Segmentation fault Jun 15, 2018
@kevmoo
Copy link
Member

kevmoo commented Jun 15, 2018

CC @dgrove @a-siva

@dgrove dgrove added this to the Dart2Stable milestone Jun 15, 2018
@dgrove
Copy link
Contributor

dgrove commented Jun 15, 2018

Initially assigning to @a-siva

@a-siva
Copy link
Contributor

a-siva commented Jun 19, 2018

Seems to fail in dart::Instance::CheckAndCanonicalizeFields while reading an isolate message

#3  0x00005555570e6bf7 in dart::Assert::Fail (this=<optimized out>, 
    format=<optimized out>) at ../../runtime/platform/assert.cc:43
#4  0x0000555556d902d1 in dart::Instance::CheckAndCanonicalizeFields (
    this=0x555558d21600, thread=<optimized out>, error_str=<optimized out>)
    at ../../runtime/vm/object.cc:15938
#5  0x0000555556d90359 in dart::Instance::CheckAndCanonicalize (
    this=0x555558d21600, thread=0x555558392900, error_str=0x0)
    at ../../runtime/vm/object.cc:15972
#6  0x0000555556ee005d in dart::SnapshotReader::ReadInstance (
    this=<optimized out>, object_id=<optimized out>, tags=2, 
    as_reference=false) at ../../runtime/vm/snapshot.cc:582
#7  0x0000555556edca93 in ReadObjectImpl (as_reference=false, 
    patch_object_id=-1, patch_offset=0, this=<optimized out>)
    at ../../runtime/vm/snapshot.cc:448
#8  dart::SnapshotReader::ReadObject (this=0x7fffd84bea90)
    at ../../runtime/vm/snapshot.cc:226
#9  0x0000555556cd75a6 in dart::IsolateMessageHandler::HandleMessage (
    this=0x555557b86460, message=0x55555886ac40)
    at ../../runtime/vm/isolate.cc:533
#10 0x0000555556d0f91a in dart::MessageHandler::HandleMessages (
    this=0x555557b86460, ml=0x7fffd84bec40, allow_normal_messages=true, 
    allow_multiple_normal_messages=true)
    at ../../runtime/vm/message_handler.cc:231
#11 0x0000555556d104fc in dart::MessageHandler::TaskCallback (
    this=0x555557b86460) at ../../runtime/vm/message_handler.cc:426
#12 0x0000555556f0ce57 in dart::ThreadPool::Worker::Loop (this=0x555557b7a6e0)
    at ../../runtime/vm/thread_pool.cc:381
#13 0x0000555556f0cb78 in dart::ThreadPool::Worker::Main (args=93825032234720)
    at ../../runtime/vm/thread_pool.cc:436

@a-siva a-siva assigned rmacnak-google and unassigned a-siva Jun 19, 2018
@chalin
Copy link
Contributor Author

chalin commented Jun 21, 2018

Still crashing under 2.0.0-dev.64.1, as shown in this Travis log.

@a-siva
Copy link
Contributor

a-siva commented Jun 21, 2018

@chalin we are investigating this crash and will update status here once it is fixed.

dart-bot pushed a commit that referenced this issue Jun 21, 2018
…on in isolate messages.

Type canonicalization is deferred between in may involve cycles. Instances are canonicalized eagerly, but their type arguments are not necessarily canonical yet, which can lead to incorrect canonicalization of the instance.

The work around is to include the most popular type arguments in the serializer's set of base objects, bypassing deferred canonicalization. Other type arguments will continue to fail.

Bug: #33430
Change-Id: Ia992b3ebc2974b54acb5c88b3e1d836f6ec1f1b8
Reviewed-on: https://dart-review.googlesource.com/61721
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
@a-siva
Copy link
Contributor

a-siva commented Jun 22, 2018

The CL https://dart-review.googlesource.com/c/sdk/+/61721 fixes the crash.
Will open a separate bug for addressing the longer term issue of dealing with the interaction between
deferred canonicalization of type arguments and canonicalization of instances.

chalin added a commit to filiph/linkcheck that referenced this issue Jun 22, 2018
chalin added a commit to filiph/linkcheck that referenced this issue Jun 22, 2018
Trivial code tweak to avoid triggering dart-lang/sdk#33430
chalin added a commit to filiph/linkcheck that referenced this issue Jun 22, 2018
Trivial code tweak to avoid triggering canonicalization issue dart-lang/sdk#33430
@dgrove
Copy link
Contributor

dgrove commented Jun 22, 2018

Can this one be closed since https://dart-review.googlesource.com/c/sdk/+/61721 has landed?

@chalin
Copy link
Contributor Author

chalin commented Jun 22, 2018

In case you are wondering which two lines caused the crash in linkcheck, see https://github.com/filiph/linkcheck/pull/16/files#diff-e29ff10915c7af85fedd110a8cb724ef.

Essentially (and as a workaround while awaiting the fix), I changed two lines of this form:

const unrecognizedMessage = const {verbKey: unrecognizedVerb};

To this form:

final unrecognizedMessage = {verbKey: unrecognizedVerb};

(Well at least I've learned that const canonicalization is done lazily.) /cc @filiph

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. crash Process exits with SIGSEGV, SIGABRT, etc. An unhandled exception is not a crash. P1 A high priority bug; for example, a single project is unusable or has many test failures
Projects
None yet
Development

No branches or pull requests

5 participants