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

crash in dart::TypeParameter::set_parameterized_class #28072

Closed
Hixie opened this issue Dec 12, 2016 · 14 comments

Comments

@Hixie
Copy link
Contributor

commented Dec 12, 2016

Trying to run the Flutter tool after all the generic type parameter comments have been turned into real type parameters crashes:

Dumping native stack trace for thread 94d
  [0x000000000078e7f1] dart::TypeParameter::set_parameterized_class(dart::Class const&) const
  [0x000000000078e7f1] dart::TypeParameter::set_parameterized_class(dart::Class const&) const
  [0x00000000009605c8] dart::TypeParameter::ReadFrom(dart::SnapshotReader*, long, long, dart::Snapshot::Kind, bool)
  [0x00000000008c89a7] dart::SnapshotReader::ReadObjectImpl(long, bool, long, long)
  [0x00000000009609b8] dart::TypeArguments::ReadFrom(dart::SnapshotReader*, long, long, dart::Snapshot::Kind, bool)
  [0x00000000008c84d6] dart::SnapshotReader::ReadObjectImpl(long, bool, long, long)
  [0x0000000000964cac] dart::Function::ReadFrom(dart::SnapshotReader*, long, long, dart::Snapshot::Kind, bool)
  [0x00000000008c851a] dart::SnapshotReader::ReadObjectImpl(long, bool, long, long)
  [0x00000000008cb8bd] dart::SnapshotReader::ArrayReadFrom(long, dart::Array const&, long, long)
  [0x0000000000963438] dart::Array::ReadFrom(dart::SnapshotReader*, long, long, dart::Snapshot::Kind, bool)
  [0x00000000008c8cff] dart::SnapshotReader::ReadObjectImpl(long, bool, long, long)
  [0x00000000008cb4d7] dart::SnapshotReader::ReadObject()
  [0x00000000008cb628] dart::SnapshotReader::ReadScriptSnapshot()
-- End of DumpStackTrace

See also the logs here: https://travis-ci.org/flutter/flutter/builds/183108649

@sethladd

This comment has been minimized.

Copy link
Member

commented Dec 12, 2016

cc @a-siva

@sethladd sethladd added the type-bug label Dec 12, 2016

@fsc8000

This comment has been minimized.

Copy link
Member

commented Dec 12, 2016

@crelier

This comment has been minimized.

Copy link
Member

commented Dec 12, 2016

It looks like RawTypeParameter::WriteTo() and TypeParameter::ReadFrom() in raw_object_snapshot.cc do not support function type parameters yet. Oops.
Working on it.

@crelier

This comment has been minimized.

Copy link
Member

commented Dec 12, 2016

Never mind. These functions should work as long as the parameterized_class_id_ field of a generic function type parameter is properly initialized to kIllegalCid. Reading the source, I cannot find a place where we would not initialize it. And from the stack trace, I cannot see if this is really the problem.
Is there a way to reproduce the crash locally?

@Hixie

This comment has been minimized.

Copy link
Contributor Author

commented Dec 12, 2016

Apply the patch from flutter/flutter#7235 to a local Flutter checkout and run the flutter tool (no arguments needed).

@crelier

This comment has been minimized.

Copy link
Member

commented Dec 12, 2016

Apparently, the snapshot reader/writer does not like kIllegalCid. I replaced it with kFunctionCid. There is a good chance that this landed CL fixes this issue:
https://codereview.chromium.org/2567163002/
Please, let me know.

@crelier crelier self-assigned this Dec 13, 2016

@vsmenon vsmenon added the area-vm label Dec 14, 2016

@eseidelGoogle

This comment has been minimized.

Copy link

commented Jan 7, 2017

This was hit internally as 34087655 (standalone vm) and 34131149 (flutter) if anyone is following along at home.

@eseidelGoogle

This comment has been minimized.

Copy link

commented Jan 7, 2017

Attempting to verify, I did pull'd hixie's PR:

git remote add hixie https://github.com/Hixie/flutter.git 
git fetch hixie
git checkout -b hixie_methods hixie/methods

Ran flutter and verified that it crashed.

Then moved to 1.22.0.-dev.4.0:

diff --git a/bin/internal/dart-sdk.version b/bin/internal/dart-sdk.version
index 3500250..bdf20f6 100644
--- a/bin/internal/dart-sdk.version
+++ b/bin/internal/dart-sdk.version
@@ -1 +1 @@
-1.21.0
+1.22.0-dev.4.0

But now failed differently (likely due to this being based on a 20+ day old copy of flutter):

/src/flutter %./bin/internal/update_dart_sdk.sh
Downloading Dart SDK 1.22.0-dev.4.0...
######################################################################## 100.0%
/src/flutter %flutter doctor
Wrong script snapshot version, expected 'f232e903ba1a12e5502847d136c98505' found '2a315fe0946b69aeb0f3255b2ab2828e'
'package:linter/src/config.dart': malformed type: line 35 pos 40: cannot resolve class 'OptionsProcessor' from 'AnalysisOptionsProcessor'
class AnalysisOptionsProcessor extends OptionsProcessor {
                                       ^
@eseidelGoogle

This comment has been minimized.

Copy link

commented Jan 7, 2017

Wrong script snapshot version, expected 'f232e903ba1a12e5502847d136c98505' found '2a315fe0946b69aeb0f3255b2ab2828e' above is a red herring. It's because I hadn't changed the git hash (by committing locally) yet, to cause the flutter snapshot to rebuild. Once I did, same error.

@Hixie

This comment has been minimized.

Copy link
Contributor Author

commented Jan 7, 2017

I think the AnalysisOptionsProcess thing is a question for @pq .

@Hixie

This comment has been minimized.

Copy link
Contributor Author

commented Jan 7, 2017

Are you changing to a new version of the engine? Or of the local dart SDK?

@eseidelGoogle

This comment has been minimized.

Copy link

commented Jan 7, 2017

@Hixie I've only changed the local flutter/flutter dart_sdk. Here is my repo:
https://github.com/eseidelGoogle/flutter/tree/hixie_methods

@pq

This comment has been minimized.

Copy link
Member

commented Jan 7, 2017

That error looks like a mismatch between the version of analyzer API used in the flutter source and what's in the summary/SDK. IRC OptionsProcessor was removed by @bwilkerson. This PR brings flutter to 1.22.0-dev.5.0 and is updated to the new analyzer API: flutter/flutter#7382.

@crelier

This comment has been minimized.

Copy link
Member

commented Jan 9, 2017

Since the new failure is not related to the subject of this issue, and since this issue has now been verified, I am closing it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
7 participants
You can’t perform that action at this time.