-
-
Notifications
You must be signed in to change notification settings - Fork 419
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
Prevent non-opaque structs from being used as behaviour parameters #3781
Conversation
Hi @ergl, The changelog - fixed label was added to this pull request; all PRs with a changelog label need to have release notes included as part of the PR. If you haven't added release notes already, please do. Release notes are added by creating a uniquely named file in the The basic format of the release notes (using markdown) should be:
Thanks. |
Labeled as do not merge until CodegenTraceTest.TraceStructField is fixed. |
Looks like the windows failure was unrelated to this change |
When an immutable object is sent across actors, the garbage collector traces its associated object graph, using the type descriptor of the root object. Structs don't have a type descriptor, so the GC can't trace them. An option is to track additional information for objects without type descriptors, but this incurs in severe overhead for the normal case. Another option, what this commit does, is to disallow non-opaque objects without type descriptors to be the root of an object graph when used as parameters to behaviours. Essentially, this means that one has to wrap non-tag structs inside another object with a type descriptor. This also applies to structs inside tuples, since the GC will try to trace each element in the tuple.
Verified that the modified test fails if we revert d8dfe3a
When an immutable object is sent across actors, the garbage collector
traces its associated object graph, using the type descriptor of the
root object. Structs don't have a type descriptor, so the GC can't trace
them.
An option is to track additional information for objects without type
descriptors, but this incurs in severe overhead for the normal case.
Another option, what this commit does, is to disallow non-opaque objects
without type descriptors to be the root of an object graph when used as
parameters to behaviours. Essentially, this means that one has to wrap
non-tag structs inside another object with a type descriptor. This also
applies to structs inside tuples, since the GC will try to trace each
element in the tuple.
Fixes #3765