Sdk: native stack trace when running a simple test from IntelliJ

Created on 28 Feb 2017  路  8Comments  路  Source: dart-lang/sdk

Testing started at 14:47 ...
Observatory listening on http://127.0.0.1:45907/

Dumping native stack trace for thread 539d
  [0x00000000006d06dd] dart::ActivationFrame::ExtractTokenPositionFromAsyncClosure()
  [0x00000000006d06dd] dart::ActivationFrame::ExtractTokenPositionFromAsyncClosure()
  [0x00000000006d468c] dart::Debugger::CollectAwaiterReturnStackTrace()
  [0x00000000006d4dd2] dart::Debugger::PauseException(dart::Instance const&)
  [0x00000000006e59c6] dart::Exceptions::Throw(dart::Thread*, dart::Instance const&)
  [0x00000000009a498c] dart::DRT_Throw(dart::NativeArguments)
  [0x00007f795814061b] [Stub] CallToRuntime
  [0x00007f7959f489dd] int._throwFormatException
  [0x00007f7959f49e70] int._parse
  [0x00007f7959f4a960] int.parse
  [0x00007f7959f4ab66] Version._splitParts.<anonymous closure>
  [0x00007f7959ef2f40] _Closure.call
  [0x00007f7959f30bb3] MappedListIterable.elementAt
  [0x00007f7959f3cdae] ListIterable.toList
  [0x00007f7959f48715] Version._splitParts
  [0x00007f7959f4b0e1] Version.Version._
  [0x00007f7959f4b8fc] Version.Version.parse
  [0x00007f7959f4c271] _getVersion
  [0x00007f7956f25112] version
  [0x00007f79581409d9] [Stub] InvokeDartCode
  [0x00000000006c8420] dart::DartEntry::InvokeFunction(dart::Function const&, dart::Array const&, dart::Array const&, unsigned long)
  [0x00000000006b7062] dart::Compiler::EvaluateStaticInitializer(dart::Field const&)
  [0x0000000000804cd7] dart::Field::EvaluateInitializer() const
  [0x00000000009ac926] dart::DRT_InitStaticField(dart::NativeArguments)
  [0x00007f795814061b] [Stub] CallToRuntime
  [0x00007f7959f4ca62] version
  [0x00007f7959f895b5] PubCommandRunner.runCommand
  [0x00007f7959ef353d] _Closure.call
  [0x00007f7959f83c9d] Future.Future.microtask.<anonymous closure>
  [0x00007f7959ef353d] _Closure.call
  [0x00007f7959ef379d] _microtaskLoop
  [0x00007f7959ef3920] _startMicrotaskLoop
  [0x00007f7959ef3c14] _startMicrotaskLoop
  [0x00007f7959ef353d] _Closure.call
  [0x00007f7959f938d8] _runPendingImmediateCallback
  [0x00007f7959f9463f] _RawReceivePortImpl._handleMessage
  [0x00007f79581409d9] [Stub] InvokeDartCode
  [0x00000000006c8420] dart::DartEntry::InvokeFunction(dart::Function const&, dart::Array const&, dart::Array const&, unsigned long)
  [0x00000000006cb665] dart::DartLibraryCalls::HandleMessage(dart::Object const&, dart::Instance const&)
  [0x0000000000795f87] dart::IsolateMessageHandler::HandleMessage(dart::Message*)
  [0x00000000007bdaa6] dart::MessageHandler::HandleMessages(dart::MonitorLocker*, bool, bool)
  [0x00000000007bdf74] dart::MessageHandler::TaskCallback()
-- End of DumpStackTrace

Process finished with exit code 134 (interrupted by signal 6: SIGABRT)
library onlywomen_api_client.test.simple_connect;

import 'package:http/http.dart' show IOClient;
import 'package:onlywomen_api_client/src/client.dart' show ApiClient;
import 'package:test/test.dart';


void main() {

  group('onlywomen_api_client.test.simple_connect', () {
    setUp(() {

    });

    tearDown(() {});

    test('basic', () {
      // set up
      final dynamic result = new ApiClient(new IOClient()).connect();
      var done = expectAsync0<dynamic>(() {});
      // exercise
      // verification
      expect('', equals(''));
      // tear down
    });
  });
}

```dart
import 'package:http/http.dart' show BaseClient;
import 'dart:convert' show JSON, UTF8;

class ApiClient {
final BaseClient client;
ApiClient(this.client);

dynamic connect() async {
final body = UTF8.encode(JSON.encode(_createRequest()));
final response = await client.post('https://api.onlywomen.com/v3/', headers: {'Datingnode-Api-Version': '3.1', 'Datingnode-Client': 'website', 'Accept-Language': 'en-gb,en;q=0.8'}, body: body);
return response;
}

Map _createRequest() {
return {
"queries": [
{
"type": "auth:password_log_in",
"input": {
"email": "[email protected]",
"password": "password123",
"client": "api-explorer",
"returnProfile": false,
"returnPhotos": false
}
}
]
};
}
}

```yml
name: onlywomen_api_client
version: 0.0.1
description: A simple console application.
#dependencies:
#  foo_bar: '>=1.0.0 <2.0.0'
dependencies:
  http: '>=0.11.3+9 <0.12.0'

dev_dependencies:
  source_gen: '>=0.5.4+2 <0.6.0'
  build: '>=0.7.2 <0.8.0'
  build_runner: '>=0.3.0 <0.4.0'
  test: '>=0.12.20 <0.13.0'
area-vm vm-debugger

Most helpful comment

@alexander-doroshko this isn't related to IntelliJ at all- I've tracked this down to a bug in how we serialize code objects in the new app-jit snapshots.

All 8 comments

Dart VM version: 1.23.0-edge.804f3dfdd8c4cbe3cc2c517f98b7d4a192256a0e (Tue Feb 28 02:51:01 2017) on "linux_x64"

pub run test from command line

 $ pub run test
00:30 +0 -1: test/simple_connect_test.dart: onlywomen_api_client.test.simple_connect basic         
  TimeoutException after 0:00:30.000000: Test timed out after 30 seconds.
  dart:isolate  _RawReceivePortImpl._handleMessage

00:30 +0 -1: Some tests failed.    

I get the exception only when I use the Debug tests in ... context menu, with Run tests in ... I don't get the stack trace.

@floitschG seems like a VM issue to me. How is the analyzer involved?

Argh. I misread the first lines. Fixed and thanks.

main() {}

in a test file is enough to reproduce

Still the same in
Dart VM version: 1.23.0-edge.890dff146ac4733018c059b36bc4d67c45da3232 (Fri Mar 3 14:52:14 2017) on "linux_x64"

Probably @johnmccutchan?

Is the stack trace from this issue description enough to understand the problem?

I see the same stack trace on Mac.
On Windows I see "dart.exe has stopped working" OS window.
100% reproducible with SDK 1.23_dev4.0. Occurs only when trying to start Dart VM tests for debugging from IntelliJ IDEA, but I believe IntelliJ IDEA is not doing anything wrong while communicating via the VM Service protocol. IDE starts the VM using the following command:

dart --pause_isolates_on_start --enable-vm-service:45907 /path/to/sdk/bin/snapshots/pub.dart.snapshot run test

Here's the example of IDE <-> VM comminucation (the same on Mac and Windows)

VM connection open: ws://127.0.0.1:45907/ws 
Sent: {"id":"1","method":"getVersion","params":{}} 
VM message: {"jsonrpc":"2.0", "result":{"type":"Version","major":3,"minor":5,"_privateMajor":0,"_privateMinor":0},"id":"1"} 
Difference in protocol version: client=3.6 vm=3.5 
Sent: {"id":"2","method":"streamListen","params":{"streamId":"Debug"}} 
VM message: {"jsonrpc":"2.0","id":"2","result":{"type":"Success"}} 
Sent: {"id":"3","method":"streamListen","params":{"streamId":"Isolate"}} 
VM message: {"jsonrpc":"2.0","id":"3","result":{"type":"Success"}} 
Sent: {"id":"4","method":"getVM","params":{}} 
VM message: {"jsonrpc":"2.0", "result":{"type":"VM","name":"vm","architectureBits":64,"targetCPU":"x64","hostCPU":"Intel(R) Core(TM) i7-4710MQ CPU @ 2.50GHz","version":"1.23.0-dev.4.0 (Mon Mar 06 01:33:37 2017) on \"windows_x64\"","_profilerMode":"Dart","_nativeZoneMemoryUsage":0,"pid":20072,"_maxRSS":46129152,"startTime":1489064133328,"isolates":[{"type":"@Isolate","fixedId":true,"id":"isolates\/1034908803","name":"pub.dart.snapshot$main","number":"1034908803"}]},"id":"4"} 
Sent: {"id":"5","method":"getIsolate","params":{"isolateId":"isolates/1034908803"}} 
VM message: {"jsonrpc":"2.0", "result":{"type":"Isolate","fixedId":true,"id":"isolates\/1034908803","name":"pub.dart.snapshot$main","number":"1034908803","_originNumber":"1034908803","startTime":1489064133330,"_heaps":{"new":{"type":"HeapSpace","name":"new","vmName":"Scavenger","collections":0,"avgC...points":[],"exceptionPauseMode":"None","_debuggerSettings":{"_exceptions":"none"},"_threads":[{"type":"_Thread","id":"threads\/10032","kind":"kMutatorTask","_memoryHighWatermark":"200704"}]},"id":"5"} 
Sent: {"id":"6","method":"setExceptionPauseMode","params":{"isolateId":"isolates/1034908803","mode":"Unhandled"}} 
VM message: {"jsonrpc":"2.0","method":"streamNotify","params":{"streamId":"Debug","event":{"type":"Event","kind":"_DebuggerSettingsUpdate","isolate":{"type":"@Isolate","fixedId":true,"id":"isolates\/1034908803","name":"pub.dart.snapshot$main","number":"1034908803"},"timestamp":1489064133591,"_debuggerSettings":{"_exceptions":"unhandled"}}}} 
VM message: {"jsonrpc":"2.0", "result":{"type":"Success"},"id":"6"} 
Sent: {"id":"7","method":"resume","params":{"isolateId":"isolates/1034908803"}} 
VM message: {"jsonrpc":"2.0","method":"streamNotify","params":{"streamId":"Debug","event":{"type":"Event","kind":"Resume","isolate":{"type":"@Isolate","fixedId":true,"id":"isolates\/1034908803","name":"pub.dart.snapshot$main","number":"1034908803"},"timestamp":1489064133593}}} 
VM message: {"jsonrpc":"2.0", "result":{"type":"Success"},"id":"7"} 
VM message: {"jsonrpc":"2.0","method":"streamNotify","params":{"streamId":"Isolate","event":{"type":"Event","kind":"ServiceExtensionAdded","isolate":{"type":"@Isolate","fixedId":true,"id":"isolates\/1034908803","name":"pub.dart.snapshot$main","number":"1034908803"},"timestamp":1489064133601,"extensionRPC":"ext.dart.io.getOpenFiles"}}} 
VM message: {"jsonrpc":"2.0","method":"streamNotify","params":{"streamId":"Isolate","event":{"type":"Event","kind":"ServiceExtensionAdded","isolate":{"type":"@Isolate","fixedId":true,"id":"isolates\/1034908803","name":"pub.dart.snapshot$main","number":"1034908803"},"timestamp":1489064133602,"extensionRPC":"ext.dart.io.getFileByID"}}} 
VM connection closed: ws://127.0.0.1:61210/ws 
Process finished with exit code -1073741819 (0xC0000005) 

@alexander-doroshko this isn't related to IntelliJ at all- I've tracked this down to a bug in how we serialize code objects in the new app-jit snapshots.

Was this page helpful?
0 / 5 - 0 ratings