-
Bug
-
Resolution: Fixed
-
P3
-
repo-panama
-
b20
-
Verified
We have a circular dependency between the intialization of MemorySegment and NativeMemorySegmentImpl.
MS has a NULL field, whose initializer directly calls one of the NMSI constructors. NMSI depends on the initialization of MS because it is a super type.
If user code tries to initialize both classes at the same time, then deadlock can occur.
We can avoid this issue by ensuring MS is initialized before trying to use NMSI directly in our implementation. The following API points might touch NMSI directly without going through MS first:
- FileChannel
- Linker
- ArenaImpl
- SymbolLookup
MS has a NULL field, whose initializer directly calls one of the NMSI constructors. NMSI depends on the initialization of MS because it is a super type.
If user code tries to initialize both classes at the same time, then deadlock can occur.
We can avoid this issue by ensuring MS is initialized before trying to use NMSI directly in our implementation. The following API points might touch NMSI directly without going through MS first:
- FileChannel
- Linker
- ArenaImpl
- SymbolLookup