-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Failed to deserialize the passed arguments to the new isolate. #50082
Comments
/cc @aam @mkustermann |
When starting isolates with The assertion that is hit assert(_hashMask == _HashBase._UNINITIALIZED_HASH_MASK); is a red flag. The transitive copy code is setting this to @Cat-sushi Is there any way you could provide us with more context of how the |
Edited: add implementation of
Yes.
I haven't try yet. spawning code snippet is, await Isolate.spawn<List<dynamic>>(
serverMain, <dynamic>[crp.sendPort, matcher, cacheServer]); // cacheServer is SendPort as well
class Db {
final Map<Entry, Preprocessed> _map = {};
...
}
class Entry implements Comparable<Entry> {
static final _canonicalized = <String, Entry>{};
final String string;
@override
int compareTo(dynamic other) => string.compareTo((other as Entry).string);
@override
int get hashCode => string.hashCode;
@override
operator ==(Object other) => string == (other as Entry).string;
...
}
class Preprocessed {
final LetType letType; // enum
final List<Term> terms;
...
}
class Term implements Comparable<Term> {
static final _canonicalized = <String, Term>{};
final String string; // redundant for performance optimization
final Int32List runes;
@override
int compareTo(dynamic other) => string.compareTo((other as Term).string);
@override
int get hashCode => string.hashCode;
@override
operator ==(Object other) => string == (other as Term).string;
...
}
class IDb {
final _map = <IDbEntryKey, IDbEntryValue>{};
late final int maxTermLength;
late final List<List<MapEntry<IDbEntryKey, IDbEntryValue>>?>
listsByTermLength;
...
}
class IDbEntryKey implements Comparable<IDbEntryKey> {
final Term term;
final bool isLet;
@override
final int hashCode;
@override
int compareTo(IDbEntryKey other) {
var tc = term.compareTo(other.term);
if (tc != 0) {
return tc;
}
if (isLet == other.isLet) {
return 0;
}
if (isLet == false) {
return -1;
}
return 1;
}
@override
bool operator ==(Object other) =>
identical(this, other) ||
other is IDbEntryKey && term == other.term && isLet == other.isLet;
IDbEntryKey(this.term, this.isLet) : hashCode = Object.hash(term, isLet);
...
}
class IDbEntryValue {
final int df;
final List<IDbTermOccurrence> occurrences;
...
}
class IDbTermOccurrence {
final Entry entry;
final int position;
...
} |
//cc @aam |
I think this is not necessarily related to version=2.18.4 (stable) (Unknown timestamp) on "linux_x64"
|
I publish my repository for reproduction. Run the sample stand alone batch with input database/list.csv instead of batch/queries.csv
|
@Cat-sushi could you change the license from AGPL to something else (e.g. GPL, MIT, BSD are all fine)? There are under some restrictions around AGPL which means we can't run your code. Thanks. |
You can use https://github.com/Cat-sushi/fmatch freely for reproduce this issue. |
By the way, AGPL is not restrictive unless you want to redistribute or serve it. |
This might be true. The only thing I am saying is that we have internal rules which limit what kind of code we can look at. I did not invent these rules, but we just have to follow them. tldr version of these rules is: if somebody shares with us the reproduction it needs to be licensed under one of the allowed open-source licenses, if that's the case we can just go ahead and look at the code. Everything else is more complicated, and requires us to mail somebody and ask if its okay or not. |
I think the rule doesn't mention internal use at Google. |
Anyway, #50082 (comment) is the second license. |
Do I have something to do? |
We seem to be confused with large regexs that are used by the app, so that (for example) code_reg register(r12 on x64) is being end up used for generated irregexp internal use, causes crashes when it is attempted to use as code_reg on function entry(for invocation count check) after being jumped there via indirect goto from inside of that function. Potentially this points to broken indirect goto target calculation as we seem to be jumping to zero offset. Running repro with |
With
|
_AssertionError._doThrowNew (dart:core-patch/errors_patch.dart:51) |
Are you still using
Can you get on latest dev build of dart sdk https://dart.dev/get-dart/archive to simplify troubleshooting?
Also experiments with |
smaller repro for "the RegExp used by many isolates" dart vm crash
|
yes
I'm not sure, but I use VSCode.
I already use newest version.
|
https://dart-review.googlesource.com/c/sdk/+/273480 solves the crash by copying rather than sharing RegExp between isolates, forcing new irregexp code generated for every isolate. There seem to be different approach possible where backtracking stack and register stack would be static fields on the RegExp class, rather that entries in generated code object pool. |
RegExp code objects keep backtracking and registers stacks in object pools, can't be shared between isolates. BUG=#50082 TEST=one_regexp_many_workers Change-Id: Ic7db8d7a75a0951178b2f4800f96224d52506545 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/273480 Reviewed-by: Ryan Macnak <rmacnak@google.com> Commit-Queue: Alexander Aprelev <aam@google.com>
@aam Thanks for the fix!
I think that would be highly preferred. It is strongly desirable to share all JITed code, since this can make newly spawned isolates slow to start (if they have to re-compile same RegExp over and over again). @aam Would this something you want to tackle? |
I prefere 2 steps modification. |
I created follow-up issue to improve performance of RegExp passing. Closing this one as commit 4275d59 should fix the crash. |
Thank you very much. By the way, when can I have the fixed SDK? |
With 2.19.0 an unhandled exception is thrown. Dart SDK version: 2.19.0 (stable) (Unknown timestamp) on "linux_x64"
|
Given when it landed, the fix is only available on the |
I reported this issue for 2.18.2 (stable), and now I use 2.19.0 (stable). |
The fix landed into the |
This bug is 1+ year old, and this reported issue is almost 4 month old. |
I'm sorry it took that long to get to the bottom of the issue, I will see what options there might be regarding cherry-picking this as a hotfix for released versions. |
…isolates. There are two commits being picked up as one cherry-pick: - first one disables sharing to fix a crash dartbug.com/50082, regressing performance of sending regexs between isolates. - second one reenables sharing, restores performance of sending regexs, fixes dartbug.com/50639. Bug: #50082 Bug: #50639 Change-Id: I8aacebef5da66957c85c57748b7dcbd4e6f0f750 TEST=ci Cherry-pick: https://dart-review.googlesource.com/c/sdk/+/276240 Cherry-pick: https://dart-review.googlesource.com/c/sdk/+/273480 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279747 Reviewed-by: Alexander Markov <alexmarkov@google.com> Reviewed-by: Siva Annamalai <asiva@google.com> Commit-Queue: Alexander Aprelev <aam@google.com>
Is this another issue to be posted? Dart SDK version: 3.0.0-179.0.dev (dev) (Unknown timestamp) on "linux_x64"
|
@Cat-sushi This is a different issue. When sending maps/sets across isolates, they get copied and may require re-hashing. This is assertion assumes that the copied maps have't been already re-hashed (which they shouldn't, since they are new copies). Thanks for filing #51226 |
I confirmed the RegExp issue fixed at 2.19.1. |
This tracker is for issues related to:
Dart SDK version: 2.18.2 (stable) (Unknown timestamp) on "linux_x64"
My application spawning isolates fails.
In debug mode without breakpoint of uncaught exceptions, it shows:
In debug mode with breakpoint of uncaught exceptions, it breaks at line 51 of errors_patch.dart with exeption:
with call stack
In non-debug mode the app crashes with some different messages such as,
or
In AOT compiled mode, it is stable.
The text was updated successfully, but these errors were encountered: