Skip to content

DartAPI_TypeGetParameterized fails due to inability to lookup core types #33042

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

Closed
bkonyi opened this issue May 3, 2018 · 4 comments
Closed
Assignees
Labels
area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends.
Milestone

Comments

@bkonyi
Copy link
Contributor

bkonyi commented May 3, 2018

FAILED: dartk-vm debug_x64 vm/cc/DartAPI_TypeGetParameterizedTypes
Expected: Pass
Actual: Crash

--- Command "run_vm_unittest" (took 01.000199s):
DART_CONFIGURATION=DebugX64 out/DebugX64/run_vm_tests --dfe=out/DebugX64/gen/kernel-service.dart.snapshot --ignore-unrecognized-flags --use-dart-frontend --strong DartAPI_TypeGetParameterizedTypes

exit code:
-6

stdout:
Running test: DartAPI_TypeGetParameterizedTypes

stderr:
../../runtime/vm/dart_api_impl_test.cc: 3627: error: expected 'int_type' to be a valid handle but found an error handle:
    'Type 'int' not found in library ''.'

../../runtime/vm/dart_api_impl_test.cc: 3629: error: expected 'double_type' to be a valid handle but found an error handle:
    'Type 'double' not found in library ''.'

../../runtime/vm/dart_api_impl_test.cc: 3631: error: expected 'list_type' to be a valid handle but found an error handle:
    'Type 'List' not found in library ''.'

../../runtime/vm/dart_api_impl_test.cc: 3633: error: expected 'Dart_ListSetAt(type_args, 0, int_type)' to be a valid handle but found an error handle:
    'Type 'int' not found in library ''.'

../../runtime/vm/dart_api_impl_test.cc: 3636: error: expected 'list_int_type' to be a valid handle but found an error handle:
    'Type 'List' not found in library ''.'

../../runtime/vm/dart_api_impl_test.cc: 3641: error: expected 'Dart_ListSetAt(type_args, 0, int_type)' to be a valid handle but found an error handle:
    'Type 'int' not found in library ''.'

../../runtime/vm/dart_api_impl_test.cc: 3642: error: expected 'Dart_ListSetAt(type_args, 1, double_type)' to be a valid handle but found an error handle:
    'Type 'double' not found in library ''.'

../../runtime/vm/object.cc: 16361: error: unreachable code
Dumping native stack trace for thread c32d
  [0x0000000002ccb3af] dart::Profiler::DumpStackTrace(void*)
  [0x0000000002ccb3af] dart::Profiler::DumpStackTrace(void*)
  [0x0000000002f5f852] dart::Assert::Fail(char const*, ...)
  [0x0000000002c1ee2c] Unknown symbol
  [0x0000000002adf823] dart::ClassFinalizer::ResolveType(dart::Class const&, dart::AbstractType const&)
  [0x0000000002adfa11] dart::ClassFinalizer::ResolveType(dart::Class const&, dart::AbstractType const&)
  [0x0000000002ade35c] dart::ClassFinalizer::FinalizeType(dart::Class const&, dart::AbstractType const&, dart::ClassFinalizer::FinalizationKind, dart::ZoneGrowableHandlePtrArray<dart::AbstractType const>*)
  [0x0000000002f4e590] Dart_GetType
  [0x0000000002725805] dart::Dart_TestDartAPI_TypeGetParameterizedTypes()
  [0x00000000026dc58c] dart::TestCase::Run()
  [0x00000000026dc63b] dart::TestCaseBase::RunTest()
  [0x0000000002852a37] dart::TestCaseBase::RunAll()
  [0x00000000026dc82c] Unknown symbol
  [0x00000000026dc6d9] main
-- End of DumpStackTrace

--- Re-run this test:
python tools/test.py -m debug -c dartk -r vm --strong vm/cc/DartAPI_TypeGetParameterizedTypes
@bkonyi bkonyi added the area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. label May 3, 2018
@bkonyi bkonyi self-assigned this May 3, 2018
@bkonyi bkonyi added this to the Dart2Stable milestone May 3, 2018
@bkonyi
Copy link
Contributor Author

bkonyi commented May 17, 2018

If we explicitly add:

import 'dart:core';

This test passes. It appears that the frontend doesn't explicitly include dart:core in the returned kernel, which explains why the types aren't found in the library.

@peter-ahe-google
Copy link
Contributor

@bkonyi the frontend is supposed to implicitly import dart:core (if it isn't explicitly imported).

However, it is obvious that it isn't working correctly in your situation. Can you help guide me to how you invoke the frontend?

@peter-ahe-google
Copy link
Contributor

Never mind. @mkustermann helped me debug it, and it seems like he identified the root cause of the problem.

dart-bot pushed a commit that referenced this issue Jun 1, 2018
This test was looking up "int", "List" ... in a generated test library
instead of the "dart:core" library.

It seems like the old lookup has succeded because the C++ parser adds all
imports to the library object and the lookup mechanism uses the library scope,
which most likely falls back to the import scope.

Issue #33042

Change-Id: I37ea756fe53fe5dcbd8efe24053591816d5fc4af
Reviewed-on: https://dart-review.googlesource.com/57821
Reviewed-by: Ben Konyi <[email protected]>
Commit-Queue: Ben Konyi <[email protected]>
@mkustermann
Copy link
Member

This issue should be fixed now.

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.
Projects
None yet
Development

No branches or pull requests

3 participants