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
SIGABRT on OSX 10.12 (Sierra) after fork() #195
Comments
I'm facing the same issue. |
Same here causing seg faults. |
+1 |
same issue |
Was able to workaround it by installing the sqlite3 gem and forcing it to use the newer version of sqlite from my homebrew installation: gem uninstall sqlite3 |
Also experiencing this issue on macOS Sierra, specifically with v1.3.11. Seems to occur when running a Rails console under spring or using rake to start Resque workers. In some cases, I can avoid the segfault by setting the environment variable |
Also having this issue. |
Thanks to markwpiper for a working fix! |
Thanks for reporting this. Seems like we're in the same boat as the Python folks. I'd prefer not to embed SQLite3 but maybe we can ship a version that looks for SQLite3 in homebrew before trying to use the system library. Does this seem reasonable to everyone? In the mean time, you can shorten @markwpiper's workaround to:
|
Seems like a reasonable solution to me. |
I just pushed
The important line is where it says I close this if someone can verify the new version fixes the issue. Thank you! |
@tenderlove Just tested it, can confirm 1.3.12 works great! 🤘
|
@excid3 great! Thank you for testing. I'll close this ticket now. 😄 |
I upgraded the version and the fix is working perfectly. Thank you. Charlie
|
Worked for me as well. Thanks! |
The `libsqlite3.dylib` is apparently not safe for use in forked processes. The updated gem now prefers the homebrew sqlite3. For further details, see sparklemotion/sqlite3-ruby#195
This did not work for me running spork with ruby v1.9.3-p547. I uninstalled the gem, uninstalled the brew, and reinstalled both following the above directions. UPDATE: I've upgraded app to use spring and still same issue. The otool command returns the proper sqlite dylib path. I've tried fixing this six ways to Sunday, so any help in figuring this out would be most appreciated! |
Previous version crashing when spring was used. sparklemotion/sqlite3-ruby#195
Previous version was crashing ruby on macOS Sierra when spring was used. sparklemotion/sqlite3-ruby#195
I'm still having this issue. I've tried:
I've reinstalled Ruby 2.2.5 via I've manually uninstalled sqlite3 and reinstalled I've uninstalled sqlite from brew and reinstalled I've tried I'm running sqlite3 1.3.12. My otool output:
Is the problem that the My specific error message, migrating a brand new Rails 5 app:
|
I think I'm hitting it as well even using Homebrew sqlite3:
Running tests suites on the depot iteration b1 (pragprog Agile Web Development with Rails 5):
Installed sqlite3 from homebrew:
Tried:
|
Some food for thought for this problem:
The problem started after upgrading to OS Sierra. Changes to the source code in development caused a segmentation fault error. Restarting the development server (puma) fixed this. At the time, I was using Rails 5.0.0 and ruby 2.3.1 (or maybe 2.3.0). An issue was put on github rails. The rails team determined that this was not a rails issue, but that it was likely a problem with the sqite gem.
My understanding of the problem was that the sqlite gem not using the brew installed sqlite even when brew reported it as linked properly. At the time, a fix was suggested (I think by the gem author) for these steps:
gem uninstall sqlite3
match the version number installed by brew install sqlite3
gem install sqlite3 -- --with-sqlite3-include=/usr/local/Cellar/sqlite/3.14.2_1/include --with-sqlite3-lib=/usr/local/Cellar/sqlite/3.14.2_1/lib
This was under version 1.3.11 of the sqlite gem.
A fix for this was incorporated into a new version of the gem and bumped the version from 1.3.11 to 1.3.12. You could just use the gem without the complicated install command.
After installing ruby 2.3.2, the problem came back but only in the test environment when entering or removing a byebug command. I went back to ruby 2.3.1 and the problem went away. When ruby 2.3.3 was installed, the problem did not recur.
Currently, I am using:
OS Sierra 10.12.1
Ruby 2.3.3
Rails 5.0.0.1
running these commands
~/ brew link sqlite --dry-run
Warning: Already linked: /usr/local/Cellar/sqlite/3.15.1
~/ which sqlite3
/usr/local/bin/sqlite3
I hope this helps someone.
… On Dec 6, 2016, at 5:32 AM, PineWong ***@***.***> wrote:
Me too.
macOS 10.12.1
Rails 5.0.0.1
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub <#195 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AGE6IoQdZLK0gQHD31PZ4sUJP3beFFt-ks5rFTnXgaJpZM4KGtDL>.
|
I think
For now, I am using this as a solution:
|
@arthurnn 1.3.13 should be shipped now! |
Version 1.3.13 includes the proper fix for the segfaults reported in sparklemotion/sqlite3-ruby#195.
Crash Log and DiagnosticReport: https://gist.github.com/onyxraven/ce190bc4c9f31db07ec3c27578d33641
When running rspec via spring, ruby almost immediately crashes with the attached crash info. This is within my rails app, but I can try to get a simpler example put together later today.
What it looks like is the libsqlite3.dylib bundled with Sierra may not be safe for use across a fork.
There is a similar report on the python list https://bugs.python.org/issue27126, and someone else added a bug to the ruby bug list https://bugs.ruby-lang.org/issues/12781.
I've attempted to get the gem to use a different version (eg, the one in Homebrew), but so far I've failed to get it to load anything but the version out of /usr/lib/ - If I can get that workaround figured out, it would get me past this issue for the short term.
If ruby is not forking (eg, via SPRING_DISABLE, or other non-forking code), the sqlite3 code still works fine.
The text was updated successfully, but these errors were encountered: