You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We need a reliable mechanism of preventing objects that wrap OS resources from being serialized to the initial runtime heap. These are represent latent bugs, as it is not possible for us to serialize the OS resource from build time to runtime. Examples include Threads, pthread_mutexes, file descriptors, etc.
We catch some of these now (like Thread) because we raise an error when there is an attempt to serialize compound native types (eg the phread_mutex field of Thread).
The SerializeAs annotations will handle some of these cases by allowing us to indicate that the serialized native resource is invalid. This can handle at least some of the scenarios with FileDescriptor, as the higher-level I/O classes will raise an error if an operation is performed on a closed FileDescriptor.
We probably also need a "NonSerializable" annotation that could be applied to a type to raise an error if an instance of that type tries to sneak into the serialized heap. One use case for this would be Thread.
The text was updated successfully, but these errors were encountered:
We need a reliable mechanism of preventing objects that wrap OS resources from being serialized to the initial runtime heap. These are represent latent bugs, as it is not possible for us to serialize the OS resource from build time to runtime. Examples include Threads, pthread_mutexes, file descriptors, etc.
We catch some of these now (like Thread) because we raise an error when there is an attempt to serialize compound native types (eg the phread_mutex field of Thread).
The
SerializeAs
annotations will handle some of these cases by allowing us to indicate that the serialized native resource is invalid. This can handle at least some of the scenarios with FileDescriptor, as the higher-level I/O classes will raise an error if an operation is performed on a closed FileDescriptor.We probably also need a "NonSerializable" annotation that could be applied to a type to raise an error if an instance of that type tries to sneak into the serialized heap. One use case for this would be Thread.
The text was updated successfully, but these errors were encountered: