Skip to content

Posible compilation issue #2954

@pitr-ch

Description

@pitr-ch

I've recently hit very strange JRuby behavior when developing new synchronization layer in concurrent-ruby in PR ruby-concurrency/concurrent-ruby#273 (comment).

The code seems to be working fine until it's compiled then it breaks. When while true is replaced with loop do it starts to work.

Following change is enough to break it, see pitr-ch/concurrent-ruby@c306a67 It fails on JRuby 1.7.19,20

Steps to reproduce:

  • pull pitr-ch/concurrent-ruby@c306a67
  • bundle update
  • bundle exec rspec spec/concurrent/atomic/cyclic_barrier_spec.rb
  • JRUBY_OPTS="-J-Djruby.jit.threshold=1 -J-Djruby.compile.mode=JIT" bundle exec rspec spec/concurrent/atomic/cyclic_barrier_spec.rb fails
  • JRUBY_OPTS="-J-Djruby.compile.mode=OFF" bundle exec rspec spec/concurrent/atomic/cyclic_barrier_spec.rb works

It looks like the body of the CyclicBarrier#wait method is skipped breaking the internal state of CyclicBarrier.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions