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

Upgrade to Rails 6.0.0 #429

Merged
merged 4 commits into from Sep 12, 2019
Merged

Upgrade to Rails 6.0.0 #429

merged 4 commits into from Sep 12, 2019

Conversation

xlgmokha
Copy link
Contributor

It is possible to release a new version of flipper-active_record with the loosened version constraint that will allow it to work in rails 6.0 applications?

This option is inconsistent between versions.
In newer rubies this has been changed to `--no-document`.
@airhorns
Copy link

@mokhan looks like no-ri needs to go too. It would also be wise to update the README here https://github.com/jnunemaker/flipper/tree/master/docs/active_record

@xlgmokha
Copy link
Contributor Author

xlgmokha commented Aug 20, 2019

There appears to be a segfault occuring after the tests have passed in the ruby 2.5/rails 6.0 job.

Ruby: 2.5
RAILS_VERSION=6.0.0 SQLITE3_VERSION=1.4.1

[BUG] Segmentation fault at 0x0000000000000050
ruby 2.5.5p157 (2019-03-15 revision 67260) [x86_64-linux]

https://travis-ci.org/jnunemaker/flipper/jobs/573843381

@kwent
Copy link

kwent commented Aug 22, 2019

Looking forward for this :)

@jnunemaker
Copy link
Collaborator

I’ll look into it tomorrow morning!

@jnunemaker
Copy link
Collaborator

I'm trying to reproduce this locally. I tried ruby 2.5 and 2.5.1 and I'm definitely getting a weird error, but not the same.

[BUG] pthread_mutex_unlock: Invalid argument (EINVAL)
ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-darwin17]

-- Crash Report log information --------------------------------------------
   See Crash Report log file under the one of following:                    
     * ~/Library/Logs/DiagnosticReports                                     
     * /Library/Logs/DiagnosticReports                                      
   for more details.                                                        
Don't forget to include the above Crash Report log file in bug reports.     

Not finding anything obvious in the logs. Feels like some dependency issue as I know there isn't anything in flipper that should cause this.

Gotta run, but I'll keep poking at this over the weekend and on Monday. I have a build going with 2.6 added to the mix to see if this is 2.5 specific or not. Next step is probably google the error and then slowly start upgrading dependencies to see if that helps.

@xlgmokha
Copy link
Contributor Author

I tried to repro locally as well yesterday but wasn't able to repro the error produced on Travis. I will try to continue to repro today with the samy ruby, rails and sqlite3 versions (2.5, 6.0, 1.4.1)

A segfault from ruby's linked list is an interesting find and doesn't look directly related to flipper.

@xlgmokha
Copy link
Contributor Author

😕

[15:22:07][~/development/flipper] [rails-6]
モ script/test
/home/mokha/.rbenv/versions/2.5.5/bin/ruby -I/home/mokha/.rbenv/versions/2.5.5/lib/ruby/gems/2.5.0/gems/rspec-core-3.8.2/lib:/home/mokha/.rbenv/versions/2.5.5/lib/ruby/gems/2.5.0/gems/rspec-support-3.8.2/lib /home/mokha/.rbenv/versions/2.5.5/lib/ruby/gems/2.5.0/gems/rspec-core-3.8.2/exe/rspec --pattern spec/\*\*\{,/\*/\*\*\}/\*_spec.rb --color
Run options: include {:focus=>true}

All examples were filtered out; ignoring {:focus=>true}
.......................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................

Finished in 1 minute 22.35 seconds (files took 17.25 seconds to load)
1367 examples, 0 failures

/home/mokha/.rbenv/versions/2.5.5/lib/ruby/gems/2.5.0/gems/concurrent-ruby-1.1.5/lib/concurrent/atomic/ruby_thread_local_var.rb:87: [BUG] Segmentation fault at 0x0000000000000000
ruby 2.5.5p157 (2019-03-15 revision 67260) [x86_64-linux]

-- Control frame information -----------------------------------------------
c:0002 p:0006 s:0006 e:000005 BLOCK  /home/mokha/.rbenv/versions/2.5.5/lib/ruby/gems/2.5.0/gems/concurrent-ruby-1.1.5/lib/concurrent/atomic/ruby_thread_local_var.rb [FINISH]
c:0001 p:---- s:0003 e:000002 (none) [FINISH]

-- Ruby level backtrace information ----------------------------------------
/home/mokha/.rbenv/versions/2.5.5/lib/ruby/gems/2.5.0/gems/concurrent-ruby-1.1.5/lib/concurrent/atomic/ruby_thread_local_var.rb:87:in `block (2 levels) in threadlocal_finalizer'

-- Machine register context ------------------------------------------------
 RIP: 0x000055b567e807c9 RBP: 0x00007fe5e02c1b80 RSP: 0x00007fe5e02c13e8
 RAX: 0x000055b56b80a4d0 RBX: 0x000055b567e92a53 RCX: 0x00007fe5e01c0fb0
 RDX: 0x0000000000000000 RDI: 0x000055b56b80a4d0 RSI: 0x00007fe5e01c0fb0
  R8: 0x635f6c6f6f702f72  R9: 0x00007fe5e01c0fb0 R10: 0x000055b56a248930
 R11: 0x0000000000000004 R12: 0x00000000000404bb R13: 0x000055b56b7f0670
 R14: 0x000055b56a119bf0 R15: 0x00007fe5e01c0fb0 EFL: 0x0000000000010206

-- C level backtrace information -------------------------------------------
Run options: --seed 45036

# Running:

..............................................................................................................................................................................................................

Finished in 7.272625s, 28.3254 runs/s, 868.0497 assertions/s.

206 runs, 6313 assertions, 0 failures, 0 errors, 0 skips
[15:28:43][~/development/flipper] [rails-6]
モ echo $?
0

@kwent
Copy link

kwent commented Aug 29, 2019

Soooo are we good ?

@jnunemaker
Copy link
Collaborator

I have confirmation people are using rails 6 by bundling against git, but travis ci and locally are failing with weird failures. I'm not really sure what is going on or how to fix them currently. I will continue to poke at it as I have time. I could do a release, but if something was wrong, I'd feel bad. The specs/tests seem to pass, but then some weird segfault happens. Feels like a ruby thing.

@xlgmokha
Copy link
Contributor Author

xlgmokha commented Sep 3, 2019

Sorry @kwent, I haven't had much time to work on this. As a temporary workaround you can use:

gem 'flipper-active_record', '~> 0.16', github: 'mokhan/flipper', branch: 'rails-6'

I agree with @jnunemaker, it's better to delay and get to the root cause of the segfaults. Until then, I hope this workaround is good enough for now.

@kwent
Copy link

kwent commented Sep 3, 2019

Thank you. I thing that's a reasonable workaround

@devinmcgloin
Copy link

Based on #429 (comment) I think this is a case of ruby-concurrency/concurrent-ruby#808

I haven't confirmed that reverting ruby-concurrency/concurrent-ruby@eb81fff fixes the issue.

@jnunemaker
Copy link
Collaborator

I've narrowed this down a bit maybe. When I downgrade sqlite ruby to 1.3.x/rails 6, I get failures (needing higher than 1.3.x) but no segfault. When I switch back to 1.4.x/rails 6, I get a segfault. Makes it feel like this is related to sqlite3 or the dependency failure shortcuts code loading which loads concurrent ruby and thus causes failure instead of segfault.

@jnunemaker
Copy link
Collaborator

I'm certain this isn't flipper so I'm going to move forward on this PR. Hope that is ok with everyone.

@jnunemaker jnunemaker marked this pull request as ready for review September 12, 2019 15:38
@jnunemaker jnunemaker merged commit 334055f into flippercloud:master Sep 12, 2019
@jnunemaker
Copy link
Collaborator

FWIW, I completely removed sqlite and the segfault remained so definitely something that rails is using like concurrent ruby.

@xlgmokha
Copy link
Contributor Author

Thank you, @jnunemaker.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants