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

VM Crash while debugging - 2.1.0-dev.0.0 - si_signo=Segmentation fault: 11(11), si_code=1, si_addr=0x54b17a9c0 #34134

Closed
kevmoo opened this issue Aug 13, 2018 · 10 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

Comments

@kevmoo
Copy link
Member

kevmoo commented Aug 13, 2018

Here's the repo I've found. Notice the line below where the breakpoint should be placed!

import 'dart:async';

main() async {
  print(
      await pooledIterator(10, Iterable<int>.generate(10, (i) => i), _getValue)
          .toList());
}

Future<int> _getValue(int i) async {
  // Commenting out the next line avoids the crash
  await Future.delayed(const Duration(milliseconds: 1));

  // Put breakpoint on the next line
  return i * 10;
}

Stream<T> pooledIterator<S, T>(
  int poolSize,
  Iterable<S> sourceItems,
  Future<T> action(S source),
) async* {
  final controller = StreamController<T>();

  final items = Future.wait(sourceItems.map((item) async {
    controller.add(await action(item));
  })).whenComplete(() async {
    await controller.close();
  });

  yield* controller.stream;

  await items;
}
===== CRASH =====
version=2.2.0-edge.644d92497878d19a1445f05649caa79da6e774b3 (Mon Dec 10 14:56:15 2018 +0000) on "macos_x64"
si_signo=Segmentation fault: 11(11), si_code=1, si_addr=0x5409bded8
thread=10247, isolate=i34134_test.dart:main()(0x7f8b23053e00)
  [0x000000010acefd93] dart::ActivationFrame::GetAsyncStreamControllerStreamAwaiter(dart::Object const&)
  [0x000000010acefd93] dart::ActivationFrame::GetAsyncStreamControllerStreamAwaiter(dart::Object const&)
  [0x000000010acecae1] dart::Debugger::CollectAwaiterReturnStackTrace()
  [0x000000010acf915a] dart::Debugger::PauseBreakpoint()
  [0x000000010ae3d95f] dart::DRT_BreakpointRuntimeHandler(dart::NativeArguments)
  [0x000000010c240f42] Unknown symbol
  [0x000000010c241ee1] Unknown symbol
  [0x000000010effda2f] Unknown symbol
  [0x00000001104cde2f] Unknown symbol
  [0x00000001104cda06] Unknown symbol
  [0x00000001104cd645] Unknown symbol
  [0x00000001104cc7b9] Unknown symbol
  [0x00000001104cb18c] Unknown symbol
  [0x00000001104cabd1] Unknown symbol
  [0x00000001104ca9f9] Unknown symbol
  [0x000000010efc98d9] Unknown symbol
  [0x00000001104c9b11] Unknown symbol
  [0x00000001104c7af8] Unknown symbol
  [0x00000001104c76da] Unknown symbol
  [0x000000010efc98d9] Unknown symbol
  [0x000000010efe7d70] Unknown symbol
  [0x000000010c2413a6] Unknown symbol
  [0x000000010ace68b0] dart::DartEntry::InvokeFunction(dart::Function const&, dart::Array const&, dart::Array const&, unsigned long)
  [0x000000010ace985f] dart::DartLibraryCalls::HandleMessage(dart::Object const&, dart::Instance const&)
  [0x000000010ad1810b] dart::IsolateMessageHandler::HandleMessage(dart::Message*)
  [0x000000010ad4774e] dart::MessageHandler::HandleMessages(dart::MonitorLocker*, bool, bool)
  [0x000000010ad47dc6] dart::MessageHandler::TaskCallback()
  [0x000000010ae854df] dart::ThreadPool::Worker::Loop()
  [0x000000010ae85367] dart::ThreadPool::Worker::Main(unsigned long)
  [0x000000010ade3777] dart::OSThread::GetMaxStackSize()
  [0x00007fff5f3bf661] _pthread_body
  [0x00007fff5f3bf50d] _pthread_body
  [0x00007fff5f3bebf9] thread_start
-- End of DumpStackTrace
@kevmoo kevmoo added area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. P2 A bug or feature request we're likely to work on crash Process exits with SIGSEGV, SIGABRT, etc. An unhandled exception is not a crash. labels Aug 13, 2018
@a-siva
Copy link
Contributor

a-siva commented Aug 14, 2018

Can you provide any information about how to reproduce this or a description of what you were doing when this happened.

@kevmoo
Copy link
Member Author

kevmoo commented Dec 11, 2018

Hitting this again with 2.2.0-edge. 644d924 and 2.2.0-dev.0.0

I can reproduce, @a-siva if someone wants to look!

@kevmoo kevmoo added P1 A high priority bug; for example, a single project is unusable or has many test failures and removed P2 A bug or feature request we're likely to work on labels Dec 11, 2018
@kevmoo
Copy link
Member Author

kevmoo commented Dec 11, 2018

Seems to be related to setting a breakpoint within a async* function. Will try to get a repro.

@kevmoo
Copy link
Member Author

kevmoo commented Dec 11, 2018

Updated the first comment w/ a repro (that doesn't require a package)

@aam
Copy link
Contributor

aam commented Dec 11, 2018

Thanks for the repro.
I tried reproducing the crash in observatory launching the test from command line out/ReleaseX64/dart --observe --pause-isolates-on-start crash-34134.dart , setting breakpoint line 14, resuming and continuing through the breakpoints. The test completes successfully for me.
This is on 2.2.0-edge.679108ea7b807efd92167c8ba8e99395f9d3b8d3.

@kevmoo
Copy link
Member Author

kevmoo commented Dec 11, 2018 via email

@aam
Copy link
Contributor

aam commented Dec 11, 2018

Just tried IJ on Linux(with dart sdk pointing to the same 2.2.0-edge.679108ea7b807efd92167c8ba8e99395f9d3b8d3), set up breakpoint at return i * 10, started, resumed after breakpoint was hit and saw the program complete fine.

Does it crash on the first breakpoint hit for you? Is this on Linux/Mac/Windows?

@kevmoo
Copy link
Member Author

kevmoo commented Dec 11, 2018

  1. See the updated repro. You need the await Future.delayed
  2. mac
  3. I set a breakpoint in IntelliJ and it crashes without ever getting to the breakpoint

@aam
Copy link
Contributor

aam commented Dec 11, 2018

Okay with line 11 uncommented, I am able to repro the crash.

dart-bot pushed a commit that referenced this issue Dec 13, 2018
Until this CL variables are assumed to be found in current context only even though they could come from parent's contexts.

Bug: #34134
Change-Id: Ibcfe1449558086d0c82a85cfd213667e8c917fe0
Reviewed-on: https://dart-review.googlesource.com/c/87163
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
@aam
Copy link
Contributor

aam commented Dec 13, 2018

Should be fixed at the head.

@aam aam closed this as completed Dec 13, 2018
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

3 participants