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
FFI::MemoryPointer autorelease issue #6284
Milestone
Comments
Aha, well this certainly could be a cause of #6310 and sass/sassc-ruby#208. |
headius
added a commit
to headius/jruby
that referenced
this issue
Jul 16, 2020
This appears to be long-broken logic for setting autorelease to false, since the only value that will change the unmanaged bit is passing autorelease = true. The change here allows toggling both ways. This may not have been seen before because this version of MemoryIO is only used when the requested size is greater than 256 bytes, and typically structs are smaller than that. In jruby#6284, as well as jruby#6310 and sass/sassc-ruby#208, we have reports of a double free, and sassc itself uses autorelease on a potentially large value here: https://github.com/sass/sassc-ruby/blob/4bd764f568ad312a78181d7a3187f3715388e33e/lib/sassc/native.rb#L54-L58
patch #6331 confirmed. thank you! |
@ahorek Hot diggity! We'll roll it into 9.2.13. |
enebo
pushed a commit
that referenced
this issue
Aug 31, 2020
This appears to be long-broken logic for setting autorelease to false, since the only value that will change the unmanaged bit is passing autorelease = true. The change here allows toggling both ways. This may not have been seen before because this version of MemoryIO is only used when the requested size is greater than 256 bytes, and typically structs are smaller than that. In #6284, as well as #6310 and sass/sassc-ruby#208, we have reports of a double free, and sassc itself uses autorelease on a potentially large value here: https://github.com/sass/sassc-ruby/blob/4bd764f568ad312a78181d7a3187f3715388e33e/lib/sassc/native.rb#L54-L58
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Environment Information
jruby 9.3.0.0-SNAPSHOT (2.6.5) 2020-06-15 ccecbe8 Java HotSpot(TM) 64-Bit Server VM 11.0.2+9-LTS on 11.0.2+9-LTS +jit [linux-x86_64]
(and jruby 9.2.11.1)
sassc 2.4.0
recently, I've noticed segfaults on https://travis-ci.org/github/rails/sprockets/jobs/696412377
Expected Behavior
it looks like FFI::MemoryPointer is being GCed, even if autorelease is explicitly disabled
Actual Behavior
see sass/sassc-ruby#205
The text was updated successfully, but these errors were encountered: