Conversation
The `Symbol` constructor in boot.jl was not using the unsafe_convert mechanism, becuase it is unavailable at this point in bootstrap. However, it was also not GC-rooting the string some other way, resulting in potential memory corruption. Fix that by manually inlining the :foreigncall and setting up the root appropriately.
|
SGTM. Though I wonder if we shouldn't just duplicate the code, since the random |
I did it that way at first, but then I wanted to minimize the number of manually written |
|
That is also true. I guess I also like to minimize the number of APIs that take naked Ptr to ccall something from them, but this PR is fine |
|
This segfaults when backporting to 1.8 when making |
The `Symbol` constructor in boot.jl was not using the unsafe_convert mechanism, becuase it is unavailable at this point in bootstrap. However, it was also not GC-rooting the string some other way, resulting in potential memory corruption. Fix that by manually inlining the :foreigncall and setting up the root appropriately. (cherry picked from commit b5a6b0f)
The
Symbolconstructor in boot.jl was not using the unsafe_convert mechanism, becuase it is unavailable at this point in bootstrap. However, it was also not GC-rooting the string some other way, resulting in potential memory corruption. Fix that by manually inlining the :foreigncall and setting up the root appropriately.