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

Segfault running dart migrate #43884

Closed
nshahan opened this issue Oct 21, 2020 · 10 comments
Closed

Segfault running dart migrate #43884

nshahan opened this issue Oct 21, 2020 · 10 comments
Labels
area-vm Use area-vm for VM related issues, including code coverage, FFI, and the AOT and JIT backends. NNBD Issues related to NNBD Release P1 A high priority bug; for example, a single project is unusable or has many test failures
Milestone

Comments

@nshahan
Copy link
Contributor

nshahan commented Oct 21, 2020

In my local flutter repo I am at commit 78f05dfb9f3400135225ad5515cc8013086e0e1e
I'm running MacOS 10.15.7 (19H2)

I attempted to run flutter/bin/dart migrate in the flutter/exaples/hello_world directory and got a random segfault. I copied the output from my terminal below. You can see after the segfault I checked for changes by running git status. It shows that the analysis_options.yaml file was updated. Then I tried running the migrator tool again and it worked.

$ /Users/nshahan/code/flutter/flutter/bin/dart migrate
Migrating /Users/nshahan/code/flutter/flutter/examples/hello_world

Note: this tool is currently running on an SDK version where null safety is not yet enabled by default. You may encounter issues in the migration process - some aspects of the toolchain assume that they are running on an SDK where null safety has been enabled by default.

See https://dart.dev/go/null-safety-migration for a migration guide.

Analyzing project...
[--------------------------------------------------------------\                                                                                               ]
===== CRASH =====
si_signo=Segmentation fault: 11(11), si_code=1, si_addr=0xb0
version=2.11.0-242.0.dev (dev) (Wed Oct 21 00:38:45 2020 -0700) on "macos_x64"
pid=2052, thread=8971, isolate_group=(nil)(0x0), isolate=(nil)(0x0)
isolate_instructions=0, vm_instructions=1030ab040
  pc 0x000000010313dc8b fp 0x00007000023fb300 sk_num+0x1b
  pc 0x00000001030ec700 fp 0x00007000023fb330 CRYPTO_get_ex_data+0x30
  pc 0x00000001030a1379 fp 0x00007000023fb440 dart::bin::TrustEvaluateHandler(long long, _Dart_CObject*)+0x59
  pc 0x00000001032cb4ff fp 0x00007000023fbdb0 dart::NativeMessageHandler::HandleMessage(std::__1::unique_ptr<dart::Message, std::__1::default_delete<dart::Message> >)+0xbf
  pc 0x00000001032c83f6 fp 0x00007000023fbe30 dart::MessageHandler::HandleMessages(dart::MonitorLocker*, bool, bool)+0x136
  pc 0x00000001032c8a34 fp 0x00007000023fbe90 dart::MessageHandler::TaskCallback()+0x1e4
  pc 0x00000001033ff7a2 fp 0x00007000023fbf20 dart::ThreadPool::WorkerLoop(dart::ThreadPool::Worker*)+0x152
  pc 0x00000001033ffa6f fp 0x00007000023fbf50 dart::ThreadPool::Worker::Main(unsigned long)+0x6f
  pc 0x0000000103362f0a fp 0x00007000023fbfb0 dart::ThreadStart(void*)+0xba
  pc 0x00007fff70c83109 fp 0x00007000023fbfd0 _pthread_start+0x94
  pc 0x00007fff70c7eb8b fp 0x00007000023fbff0 thread_start+0xf
-- End of DumpStackTrace
/Users/nshahan/code/flutter/flutter/bin/internal/shared.sh: line 224:  2052 Abort trap: 6           "$DART" "$@"
$ git status
On branch master
Your branch is up to date with 'origin/master'.

Untracked files:
  (use "git add <file>..." to include in what will be committed)
	analysis_options.yaml

nothing added to commit but untracked files present (use "git add" to track)
$ /Users/nshahan/code/flutter/flutter/bin/dart migrate
Migrating /Users/nshahan/code/flutter/flutter/examples/hello_world

Note: this tool is currently running on an SDK version where null safety is not yet enabled by default. You may encounter issues in the migration process - some aspects of the toolchain assume that they are running on an SDK where null safety has been enabled by default.

See https://dart.dev/go/null-safety-migration for a migration guide.

Analyzing project...
[--------------------------------------------------------------------------------------------------------------------------------------------------------------]No analysis issues found.

Generating migration suggestions...
[--------------------------------------------------------------------------------------------------------------------------------------------------------------]

View the migration suggestions by visiting:

  http://127.0.0.1:51829/Users/nshahan/code/flutter/flutter/examples/hello_world?authToken=7ReblMvlujk%3D

Use this interactive web view to review, improve, or apply the results.
When finished with the preview, hit ctrl-c to terminate this process.
@nshahan nshahan added area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. analyzer-nnbd-migration NNBD Issues related to NNBD Release labels Oct 21, 2020
@vsmenon
Copy link
Member

vsmenon commented Oct 22, 2020

I just hit similar on Flutter gallery:

[/Users/vsm/git/gallery] flutter --version
Flutter 1.24.0-2.0.pre.104 • channel master • git@github.com:flutter/flutter.git
Framework • revision 0884236504 (24 hours ago) • 2020-10-21 12:13:10 -0700
Engine • revision c2c74ed708
Tools • Dart 2.11.0 (build 2.11.0-240.0.dev)

[/Users/vsm/git/gallery] ~/git/flutter/flutter/bin/dart migrate
Migrating /Users/vsm/git/gallery

Note: this tool is currently running on an SDK version where null safety is not yet enabled by default. You may encounter issues in the migration process - some aspects of the toolchain assume that they are running on an SDK where null safety has been enabled by default.

See https://dart.dev/go/null-safety-migration for a migration guide.

Analyzing project...
[-                                                                                                                                                             [\                                                                                                                                                            ]
===== CRASH =====
si_signo=Segmentation fault: 11(11), si_code=1, si_addr=0x100
version=2.11.0-240.0.dev (dev) (Tue Oct 20 16:27:23 2020 -0700) on "macos_x64"
pid=69702, thread=5891, isolate_group=(nil)(0x0), isolate=(nil)(0x0)
isolate_instructions=0, vm_instructions=106e3c040
  pc 0x0000000106f42eda fp 0x000070000303a2f0 SSL_in_init+0x1a
  pc 0x0000000106f4881c fp 0x000070000303a310 SSL_get_session+0x1c
  pc 0x0000000106f4af4b fp 0x000070000303a330 SSL_get_peer_full_cert_chain+0x1b
  pc 0x0000000106e323c7 fp 0x000070000303a440 dart::bin::TrustEvaluateHandler(long long, _Dart_CObject*)+0xa7
  pc 0x000000010705c4ff fp 0x000070000303adb0 dart::NativeMessageHandler::HandleMessage(std::__1::unique_ptr<dart::Message, std::__1::default_delete<dart::Message> >)+0xbf
  pc 0x00000001070593f6 fp 0x000070000303ae30 dart::MessageHandler::HandleMessages(dart::MonitorLocker*, bool, bool)+0x136
  pc 0x0000000107059a34 fp 0x000070000303ae90 dart::MessageHandler::TaskCallback()+0x1e4
  pc 0x00000001071907a2 fp 0x000070000303af20 dart::ThreadPool::WorkerLoop(dart::ThreadPool::Worker*)+0x152
  pc 0x0000000107190a6f fp 0x000070000303af50 dart::ThreadPool::Worker::Main(unsigned long)+0x6f
  pc 0x00000001070f3f0a fp 0x000070000303afb0 dart::ThreadStart(void*)+0xba
  pc 0x00007fff7103c109 fp 0x000070000303afd0 _pthread_start+0x94
  pc 0x00007fff71037b8b fp 0x000070000303aff0 thread_start+0xf
-- End of DumpStackTrace
/Users/vsm/git/flutter/flutter/bin/internal/shared.sh: line 224: 69702 Abort trap: 6           "$DART" "$@"

@vsmenon
Copy link
Member

vsmenon commented Oct 22, 2020

@devoncarew @a-siva - does this trace mean anything to you? Both seem to hit TrustEvaluateHandler.

@leafpetersen leafpetersen added area-vm Use area-vm for VM related issues, including code coverage, FFI, and the AOT and JIT backends. and removed analyzer-nnbd-migration area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. labels Oct 27, 2020
@leafpetersen
Copy link
Member

Moved this to area-vm, since a segfault doesn't seem like a tool issue.

@alexmarkov
Copy link
Contributor

@aam

@aam
Copy link
Contributor

aam commented Oct 27, 2020

How easy it is to reproduce this issue for you folks?
This might be caused by recent refactoring of ssl handshake on mac/ios to allow for non-blocking certification evaluation.
I tried dart migrate several times on both repositories and could not get the crash.
Was there anything special about your network connectivity(too slow/flaky) when it crashed?

@a-siva a-siva added the P1 A high priority bug; for example, a single project is unusable or has many test failures label Oct 28, 2020
@a-siva a-siva added this to the November 2020 milestone Oct 28, 2020
@a-siva a-siva added this to Needs triage in Dart VM support for Null Safe feature via automation Oct 28, 2020
@a-siva a-siva moved this from Needs triage to Null Safe SDK Beta (Flutter Framework + Core Packages Migrated) in Dart VM support for Null Safe feature Oct 28, 2020
@a-siva
Copy link
Contributor

a-siva commented Oct 28, 2020

If the crash is not easily reproducible then please lower the priority to P2

@aam
Copy link
Contributor

aam commented Oct 28, 2020

I was able to reproduce the crash by running three dart migrate in parallel.

@mraleph
Copy link
Member

mraleph commented Oct 28, 2020

If the crash is not easily reproducible then please lower the priority to P2

This is also affecting Flutter apps in the wild with multiple reports so priority should not be lower than P1 (if not P0) (flutter/flutter#68603)

@mit-mit
Copy link
Member

mit-mit commented Oct 28, 2020

Tagging with beta epic until we at least understand this better

@aam
Copy link
Contributor

aam commented Oct 28, 2020

https://dart-review.googlesource.com/c/sdk/+/169300 attempts to fix the crashes.

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, FFI, and the AOT and JIT backends. NNBD Issues related to NNBD Release P1 A high priority bug; for example, a single project is unusable or has many test failures
Development

No branches or pull requests

8 participants