Skip to content
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

TestPKeyDH#test_DEFAULT_parameters dumps core under GC stress #87

Closed
k-tsj opened this issue Dec 3, 2016 · 1 comment
Closed

TestPKeyDH#test_DEFAULT_parameters dumps core under GC stress #87

k-tsj opened this issue Dec 3, 2016 · 1 comment

Comments

@k-tsj
Copy link
Member

k-tsj commented Dec 3, 2016

Steps to reproduce:

$ cd PATH_TO_RUBY_REPOS
$ make TESTS='--gc-stress -n /test_DEFAULT_parameters/ openssl/test_pkey_dh.rb' test-all
(snip)
gcc (Ubuntu 5.4.0-6ubuntu1~16.04.2) 5.4.0 20160609
(snip)
[1/1] OpenSSL::TestPKeyDH#test_DEFAULT_parameters/home/ktsj/work/ruby/test/openssl/test_pkey_dh.rb:20: [BUG] Segmentation fault at 0x00000000000000
ruby 2.4.0dev (2016-12-03 master 56964) [x86_64-linux]

I have attached backtrace log.

rhenium added a commit to rhenium/ruby-openssl that referenced this issue Dec 4, 2016
GetBNPtr() accepts both OpenSSL::BN and Ruby integers. In the latter
case, it creates a temporary OpenSSL::BN internally. The OpenSSL::BN
object immediately disappears from the stack and is not protected from
GC.

Fixes: ruby#87
rhenium added a commit to rhenium/ruby-openssl that referenced this issue Dec 4, 2016
This would have caught some of GC issues like one reported at
[ruby#87].
rhenium added a commit to rhenium/ruby-openssl that referenced this issue Dec 4, 2016
This would have caught some of GC issues like one reported at
[ruby#87].
rhenium added a commit to rhenium/ruby-openssl that referenced this issue Dec 5, 2016
This would have caught some of GC issues like one reported at
[ruby#87].
@rhenium
Copy link
Member

rhenium commented Dec 5, 2016

Thanks for reporting. 182604c (merged into 'maint') should fix the bug.

@rhenium rhenium closed this as completed Dec 5, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants