Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
"Encountered context mismatch" trying to debug RegExp-using application #26941
I don't have a minimised test case for this but I can reproduce it reliably:
Run through these steps to get yourself a Flutter engine repo:
You shouldn't need to actually build an engine but you may need to at least get the dependencies.
Fetch this branch: https://github.com/Hixie/sky_engine/tree/debugger-crash
Open a terminal in the
It will say "Preparing data structures..." for a while, then "Collecting licenses...", then it will show a progress count. As soon as it shows a progress count (no need to rush, that count will take hours to complete), load up http://localhost:8181/ and click "debug".
The VM crashes with:
I can provide a full crash log on request.
Not knowing the proper git incantation to fetch your branch, I just downloaded the zip file and expanded it on top of my flutter engine.
When running the command dart --checked --observe lib/main.dart ../..
The dart executable comes from here:
Am I supposed to point the packages root to somewhere?
Thanks! Indeed, it could be related.
I am adding the full stack trace which may be helpful in debugging:
Debugger stack trace...
#0000 [ Frame pc(0x7fb15374d203) fp(0x7fb153ffd920) sp(0x7fb153ffd900)
context level = 0 ]
Unfortunately, the fix for #26948 does not fix this issue.
In debug mode, the debugger crashes with an assert fault before reporting the context mismatch:
runtime/vm/object.cc: 237: error: expected: strlen(cname) == static_cast<size_t>(name.Length())
It looks like the debugger is having trouble scrubbing a name containing a regexp. At least, the length is not consistent (e.g. 6478 vs 6482). The same inconsistency exists in release mode, before the context mismatch is reported. But I verified that the mismatch is not a consequence of scrubbing the name.
Let me dig deeper...