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

segfault on ruby 2.5.1 (on travis-ci) #849

Closed
DavidS opened this issue Feb 12, 2020 · 9 comments · Fixed by #856
Closed

segfault on ruby 2.5.1 (on travis-ci) #849

DavidS opened this issue Feb 12, 2020 · 9 comments · Fixed by #856
Labels
bug A bug in the library or documentation. high-priority Should be done ASAP. looking-for-contributor We are looking for a contributor to help with this issue.

Comments

@DavidS
Copy link

DavidS commented Feb 12, 2020

* Operating system:                linux
* Ruby implementation:             Ruby 2.5.1
* `concurrent-ruby` version:       1.1.6
* `concurrent-ruby-ext` installed: no
* `concurrent-ruby-edge` used:   no

Running puppetlabs/puppet_litmus@1fd29fe on travis consistently gives the attached ruby segfault: log.txt

Running against 1 targets.
..../home/travis/build/puppetlabs/puppet_litmus/puppetlabs-motd/vendor/bundle/ruby/2.5.0/gems/concurrent-ruby-1.1.6/lib/concurrent-ruby/concurrent/atomic/ruby_thread_local_var.rb:113: [BUG] Segmentation fault at 0x00000000371bb696
ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-linux]
[...]

The same code works fine on ruby 2.5.7.

@pitr-ch pitr-ch added bug A bug in the library or documentation. high-priority Should be done ASAP. labels Feb 16, 2020
@pitr-ch
Copy link
Member

pitr-ch commented Feb 16, 2020

Thanks for the report. Few notes:

Further investigation is needed.

@pitr-ch pitr-ch added the looking-for-contributor We are looking for a contributor to help with this issue. label Feb 16, 2020
@pitr-ch
Copy link
Member

pitr-ch commented Feb 17, 2020

@fzakaria would you be interested to take a look at this?
So far I know that Thread creation, Mutex, Queue cause problems and at the moment I do not have more ideas how to get around this.

@fzakaria
Copy link
Contributor

Sure thing.
I'll build 2.51 from source & run the tests and see what I can uncover.

@fzakaria
Copy link
Contributor

fzakaria commented Feb 17, 2020

Few notes from looking into it:

  1. @pitr-ch added some changes to address https://bugs.ruby-lang.org/issues/16288 as part of Safer finalizers #821

The change basically removed creating new threads in the finalizers since the finalizers may be called during shutdown & threads cannot be started.

  1. This bug involves changes post the submission of the PR above; where the segfault is occurring within Queue#push
    To me that means either the Queue or the @index have been garbage collected already.

@pitr-ch
Copy link
Member

pitr-ch commented Mar 1, 2020

Thanks for looking into this. I got an idea how to deal with it, please have a look #856

@pitr-ch
Copy link
Member

pitr-ch commented Mar 1, 2020

@DavidS could you try the PR if it works for you?

@DavidS
Copy link
Author

DavidS commented Mar 9, 2020

Apologies for the delay - I've been on vacation the last week. I'll see if I can run that PR through our CI systems, we've had quite a high hit-rate on the segfault.

@pitr-ch
Copy link
Member

pitr-ch commented Mar 9, 2020

@DavidS No problem, thank you for giving it a try.

logicminds pushed a commit to voxpupuli/pdk-templates that referenced this issue Apr 14, 2020
Amongst other things, this avoids a ruby segfault with concurrent-ruby-1.1.6 (see ruby-concurrency/concurrent-ruby#849)
@schuylr
Copy link

schuylr commented May 11, 2020

Just want to confirm I'm also seeing this on Ruby 2.5.3 with Version 1.1.6 of the gem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A bug in the library or documentation. high-priority Should be done ASAP. looking-for-contributor We are looking for a contributor to help with this issue.
Projects
None yet
4 participants