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

Segmentation fault on any error while using pry-rescue #23

Open
Ferdy89 opened this issue Dec 6, 2017 · 4 comments
Open

Segmentation fault on any error while using pry-rescue #23

Ferdy89 opened this issue Dec 6, 2017 · 4 comments

Comments

@Ferdy89
Copy link

Ferdy89 commented Dec 6, 2017

Hi! We just hit this segmentation fault in our Rails app (a pretty large one BTW) and I wanted to let you know. Running any code that generates an exception on a Rails console triggers the segfault. Doing so on a normal irb session after loading pry-rescue does not.

While I do understand there might be a million of causes for this issues and I'm not providing enough context, I wanted to report this regardless. Please let me know what other information I can provide to help with the debugging.

The Ruby version is 2.3.4, the Rails version is 4.2.8 and it's confirmed to happen with pry-rescue 1.4.2 through 1.4.5. I'm running a MacBook Pro with Sierra 10.12.5. Removing pry-rescue eliminates the issue.

[1] pry(main)> [:a].map(&:name)
/Users/user/Code/codebase/vendor/bundle/ruby/2.3.0/gems/interception-0.5/lib/cross_platform.rb:68: [BUG] Segmentation fault at 0x00000108cbd028
ruby 2.3.4p301 (2017-03-30 revision 58214) [x86_64-darwin14]

-- 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
   for more details.
Don't forget to include the above Crash Report log file in bug reports.

-- Control frame information -----------------------------------------------
c:0030 p:---- s:0115 e:000114 CFUNC  :binding
c:0029 p:0015 s:0112 e:000109 BLOCK  /Users/user/Code/codebase/vendor/bundle/ruby/2.3.0/gems/interception-0.5/lib/cross_platform.rb:68 [FINISH]
c:0028 p:---- s:0107 e:000106 IFUNC  :name
c:0027 p:---- s:0105 e:000104 CFUNC  :map
c:0026 p:0010 s:0102 E:001270 EVAL   (pry):1 [FINISH]
c:0025 p:---- s:0100 e:000099 CFUNC  :eval
c:0024 p:0052 s:0094 E:0012e0 METHOD /Users/user/Code/codebase/vendor/bundle/ruby/2.3.0/gems/pry-0.11.3/lib/pry/pry_instance.rb:355
c:0023 p:0296 s:0089 E:001378 METHOD /Users/user/Code/codebase/vendor/bundle/ruby/2.3.0/gems/pry-0.11.3/lib/pry/pry_instance.rb:323
c:0022 p:0014 s:0079 E:001480 BLOCK  /Users/user/Code/codebase/vendor/bundle/ruby/2.3.0/gems/pry-0.11.3/lib/pry/pry_instance.rb:243 [FINISH]
c:0021 p:---- s:0077 e:000076 CFUNC  :catch
c:0020 p:0011 s:0073 E:001440 BLOCK  /Users/user/Code/codebase/vendor/bundle/ruby/2.3.0/gems/pry-0.11.3/lib/pry/pry_instance.rb:242 [FINISH]
c:0019 p:---- s:0071 e:000070 CFUNC  :catch
c:0018 p:0034 s:0067 E:001400 METHOD /Users/user/Code/codebase/vendor/bundle/ruby/2.3.0/gems/pry-0.11.3/lib/pry/pry_instance.rb:241
c:0017 p:0069 s:0060 E:000fc8 BLOCK  /Users/user/Code/codebase/vendor/bundle/ruby/2.3.0/gems/pry-0.11.3/lib/pry/repl.rb:77 [FINISH]
c:0016 p:---- s:0057 e:000056 CFUNC  :loop
c:0015 p:0009 s:0054 E:001070 METHOD /Users/user/Code/codebase/vendor/bundle/ruby/2.3.0/gems/pry-0.11.3/lib/pry/repl.rb:67
c:0014 p:0008 s:0051 E:001010 BLOCK  /Users/user/Code/codebase/vendor/bundle/ruby/2.3.0/gems/pry-0.11.3/lib/pry/repl.rb:38 [FINISH]
c:0013 p:0019 s:0049 E:001058 METHOD /Users/user/Code/codebase/vendor/bundle/ruby/2.3.0/gems/pry-0.11.3/lib/pry/input_lock.rb:61
c:0012 p:0033 s:0045 E:002090 METHOD /Users/user/Code/codebase/vendor/bundle/ruby/2.3.0/gems/pry-0.11.3/lib/pry/input_lock.rb:79
c:0011 p:0029 s:0040 E:002340 METHOD /Users/user/Code/codebase/vendor/bundle/ruby/2.3.0/gems/pry-0.11.3/lib/pry/repl.rb:38
c:0010 p:0023 s:0037 E:001a58 METHOD /Users/user/Code/codebase/vendor/bundle/ruby/2.3.0/gems/pry-0.11.3/lib/pry/repl.rb:13
c:0009 p:0240 s:0033 E:000058 METHOD /Users/user/Code/codebase/vendor/bundle/ruby/2.3.0/gems/pry-0.11.3/lib/pry/pry_class.rb:192
c:0008 p:0191 s:0027 E:001310 METHOD /Users/user/Code/codebase/vendor/bundle/ruby/2.3.0/gems/railties-4.2.8/lib/rails/commands/console.rb:110
c:0007 p:0015 s:0024 E:001598 METHOD /Users/user/Code/codebase/vendor/bundle/ruby/2.3.0/gems/railties-4.2.8/lib/rails/commands/console.rb:9
c:0006 p:0101 s:0020 E:000c48 METHOD /Users/user/Code/codebase/vendor/bundle/ruby/2.3.0/gems/railties-4.2.8/lib/rails/commands/commands_tasks.rb:68
c:0005 p:0036 s:0016 E:000c98 METHOD /Users/user/Code/codebase/vendor/bundle/ruby/2.3.0/gems/railties-4.2.8/lib/rails/commands/commands_tasks.rb:39
c:0004 p:0123 s:0012 E:000cf0 TOP    /Users/user/Code/codebase/vendor/bundle/ruby/2.3.0/gems/railties-4.2.8/lib/rails/commands.rb:17 [FINISH]
c:0003 p:---- s:0008 e:000007 CFUNC  :require
c:0002 p:0049 s:0004 E:000b30 EVAL   bin/rails:6 [FINISH]
@ConradIrwin
Copy link
Owner

ConradIrwin commented Dec 6, 2017 via email

@banister
Copy link
Collaborator

banister commented Dec 7, 2017

Looks like a bug in Ruby itself, since the code is actually relying on Ruby's TracePoint API (for Ruby 2+) and not the C ext: https://github.com/ConradIrwin/interception/blob/master/lib/cross_platform.rb#L68

If possible, see if you can reproduce it on a later Ruby version, perhaps it's already been fixed.

@Ferdy89
Copy link
Author

Ferdy89 commented Dec 7, 2017 via email

@prikha
Copy link

prikha commented Oct 18, 2018

The bug is still present on 2.5.1 + Rails 5 + OS X
Crushes ruby in the development the environment:

I use this snippet to reproduce the issue:

Model._save_callbacks.map(&:key)

The key is an instance variable which is not exposed, so it should throw NoMethodError but it just crashes.

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

No branches or pull requests

4 participants