Homebrew / brew

🍺 The missing package manager for macOS (or Linux)
https://brew.sh
BSD 2-Clause "Simplified" License
41.32k stars 9.72k forks source link

Segmentation fault #1626

Closed ghost closed 7 years ago

ghost commented 7 years ago

First of all, thank you for that great tool. It is one of the few things which made my experience with OSX very pleasurable.

Recently I stumbled upon some nusty bug (segmentation fault), which prevents me to use your awesome package manager further. I already tried doctor and update commands, as well as reinstalling. Also tried different Ruby versions, but to no avail. Below I pasted what terminal returned (unfortunately no logs had been produced). Version of OSX: 10.12.1 (Sierra) Ruby: 2.3.1 (but tried also with 2.2.x, and 2.0.0).

/Users/pszek/.gem/ruby/2.0.0/gems/json-1.8.3/lib/json/ext/parser.bundle: [BUG] Segmentation fault
ruby 2.0.0p648 (2015-12-16 revision 53162) [universal.x86_64-darwin16]

-- Crash Report log information --------------------------------------------
   See Crash Report log file under the one of following:
     * ~/Library/Logs/CrashReporter
     * /Library/Logs/CrashReporter
     * ~/Library/Logs/DiagnosticReports
     * /Library/Logs/DiagnosticReports
   the more detail of.

-- Control frame information -----------------------------------------------
c:0026 p:-17523898686544 s:0133 e:000132 TOP    [FINISH]
c:0025 p:---- s:0131 e:000130 CFUNC  :require
c:0024 p:0115 s:0127 e:000126 METHOD /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55
c:0023 p:0009 s:0117 e:000116 CLASS  /Users/pszek/.gem/ruby/2.0.0/gems/json-1.8.3/lib/json/ext.rb:13
c:0022 p:0011 s:0115 e:000114 CLASS  /Users/pszek/.gem/ruby/2.0.0/gems/json-1.8.3/lib/json/ext.rb:12
c:0021 p:0057 s:0113 e:000112 TOP    /Users/pszek/.gem/ruby/2.0.0/gems/json-1.8.3/lib/json/ext.rb:9 [FINISH]
c:0020 p:---- s:0111 e:000110 CFUNC  :require
c:0019 p:0115 s:0107 e:000106 METHOD /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55
c:0018 p:0019 s:0097 e:000096 CLASS  /Users/pszek/.gem/ruby/2.0.0/gems/json-1.8.3/lib/json.rb:58
c:0017 p:0017 s:0095 e:000094 TOP    /Users/pszek/.gem/ruby/2.0.0/gems/json-1.8.3/lib/json.rb:54 [FINISH]
c:0016 p:---- s:0093 e:000092 CFUNC  :require
c:0015 p:0115 s:0089 e:000088 METHOD /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55
c:0014 p:0007 s:0079 e:000078 TOP    /usr/local/Homebrew/Library/Homebrew/download_strategy.rb:1 [FINISH]
c:0013 p:---- s:0077 e:000076 CFUNC  :require
c:0012 p:0115 s:0073 e:000072 METHOD /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55
c:0011 p:0007 s:0063 e:000062 TOP    /usr/local/Homebrew/Library/Homebrew/resource.rb:1 [FINISH]
c:0010 p:---- s:0061 e:000060 CFUNC  :require
c:0009 p:0115 s:0057 e:000056 METHOD /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55
c:0008 p:0015 s:0047 e:000046 TOP    /usr/local/Homebrew/Library/Homebrew/extend/pathname.rb:2 [FINISH]
c:0007 p:---- s:0045 e:000044 CFUNC  :require
c:0006 p:0115 s:0041 e:000040 METHOD /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55
c:0005 p:0023 s:0031 e:000030 TOP    /usr/local/Homebrew/Library/Homebrew/global.rb:3 [FINISH]
c:0004 p:---- s:0029 e:000028 CFUNC  :require
c:0003 p:0115 s:0025 e:000024 METHOD /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55
c:0002 p:0126 s:0015 E:001ad0 EVAL   /usr/local/Homebrew/Library/Homebrew/brew.rb:14 [FINISH]
c:0001 p:0000 s:0002 E:000c38 TOP    [FINISH]

/usr/local/Homebrew/Library/Homebrew/brew.rb:14:in `<main>'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
/usr/local/Homebrew/Library/Homebrew/global.rb:3:in `<top (required)>'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
/usr/local/Homebrew/Library/Homebrew/extend/pathname.rb:2:in `<top (required)>'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
/usr/local/Homebrew/Library/Homebrew/resource.rb:1:in `<top (required)>'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
/usr/local/Homebrew/Library/Homebrew/download_strategy.rb:1:in `<top (required)>'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
/Users/pszek/.gem/ruby/2.0.0/gems/json-1.8.3/lib/json.rb:54:in `<top (required)>'
/Users/pszek/.gem/ruby/2.0.0/gems/json-1.8.3/lib/json.rb:58:in `<module:JSON>'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
/Users/pszek/.gem/ruby/2.0.0/gems/json-1.8.3/lib/json/ext.rb:9:in `<top (required)>'
/Users/pszek/.gem/ruby/2.0.0/gems/json-1.8.3/lib/json/ext.rb:12:in `<module:JSON>'
/Users/pszek/.gem/ruby/2.0.0/gems/json-1.8.3/lib/json/ext.rb:13:in `<module:Ext>'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'

-- C level backtrace information -------------------------------------------

-- Other runtime information -----------------------------------------------

* Loaded script: /usr/local/Homebrew/Library/Homebrew/brew.rb

* Loaded features:

    0 enumerator.so
    1 /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/universal-darwin16/enc/encdb.bundle
    2 /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/universal-darwin16/enc/trans/transdb.bundle
    3 /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/universal-darwin16/rbconfig.rb
    4 /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/compatibility.rb
    5 /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/defaults.rb
    6 /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/deprecate.rb
    7 /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/errors.rb
    8 /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/version.rb
    9 /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/requirement.rb
   10 /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/platform.rb
   11 /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/specification.rb
   12 /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/exceptions.rb
   13 /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_gem.rb
   14 /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/thread.rb
   15 /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/monitor.rb
   16 /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb
   17 /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems.rb
   18 /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/universal-darwin16/pathname.bundle
   19 /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/pathname.rb
   20 /usr/local/Homebrew/Library/Homebrew/extend/module.rb
   21 /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/universal-darwin16/etc.bundle
   22 /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb
   23 /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/tmpdir.rb
   24 /usr/local/Homebrew/Library/Homebrew/extend/fileutils.rb
   25 /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/dependency.rb
   26 /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/path_support.rb
   27 /Users/pszek/.gem/ruby/2.0.0/gems/json-1.8.3/lib/json/version.rb
   28 /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/ostruct.rb
   29 /Users/pszek/.gem/ruby/2.0.0/gems/json-1.8.3/lib/json/generic_object.rb
   30 /Users/pszek/.gem/ruby/2.0.0/gems/json-1.8.3/lib/json/common.rb

[NOTE]
You may have encountered a bug in the Ruby interpreter or extension libraries.
Bug reports are welcome.
Don't forget to include the above Crash Report log file.
For details: http://www.ruby-lang.org/bugreport.html

Abort trap: 6
MikeMcQuaid commented 7 years ago

Sorry but you have not followed the requested steps on the Troubleshooting page

Please follow (all of) these steps and post the information here so we can help you with your problem.

Thanks!

ghost commented 7 years ago

OK, switching to NIX

MikeMcQuaid commented 7 years ago

Because you won't provide us with the information we need to fix your issue? Wow.

MikeMcQuaid commented 7 years ago

No, because I wanted to help (I don't care about bleeding edge packages, I have already everything what I need - just interface not working properly). Maybe someone else would have the same problem and this would be useful.

It's not useful if no-one provides us the information we need.

But you rejected it with cold blooded bureaucracy manner.

I didn't reject anything. I asked you to follow that because I need information provided from that (specifically brew config output) to help debug and triage this issue.

You asked us for our help and then insult us. That's not an appropriate way to behave towards people who supply you with a free tool.

MikeMcQuaid commented 7 years ago

@Pszek humbly apologised in #1627 so going to continue helping here.

From #1627 it seems you're saying brew config also causes a segfault. Running gem uninstall json should fix this for you; you don't need it as a separate gem as it's included into Ruby 2 and the extension seems to be broken. If that fails, try gem uninstall --user json. If that still fails: post the failing gem messages in here and we'll try another approach.

ghost commented 7 years ago

@Thank you!

Both commands give me:

ERROR:  While executing gem ... (Gem::InstallError)
    gem "json" cannot be uninstalled because it is a default gem

If I understood correctly, I should removed these gems globally?

MikeMcQuaid commented 7 years ago

Try /usr/bin/gem uninstall --user json. If that still fails then try to manually rm -rf /Users/pszek/.gem/ruby/2.0.0/gems/json-1.8.3/.

ghost commented 7 years ago

Thank You! That nailed it:

/usr/bin/gem uninstall --user json

Remember, the beer offer is still valid. I can send you some craft if you like.

MikeMcQuaid commented 7 years ago

I appreciate the offer. We'd love any donations you or anyone you know can give: https://github.com/Homebrew/brew#donations

Glad it got fixed.