From: Tyler Morgan Date: 2014-05-19T10:14:22-07:00 Subject: [ruby-core:62680] Re: [ruby-trunk - Bug #9854] [Open] Segmentation fault when I required json and httparty If you look at the httparty readme https://github.com/jnunemaker/httparty/blob/master/README.md they require ruby 1.9.3 or greater. On Mon, May 19, 2014 at 10:08 AM, wrote: > Issue #9854 has been reported by hassan ali. > > ---------------------------------------- > Bug #9854: Segmentation fault when I required json and httparty > https://bugs.ruby-lang.org/issues/9854 > > * Author: hassan ali > * Status: Open > * Priority: Normal > * Assignee: > * Category: > * Target version: > * ruby -v: ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-linux] > * Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN > ---------------------------------------- > Hello, > > I'm using ruby 1.9.2p290 and working with a gem called httparty. I wrote a simple script to perform a "get" operation. The script called for a require 'httparty'. Any help on this matter would greatly be appreciated. > > ==== Thsi is what was in the script==== > > #!/usr/bin/env ruby > # > require 'httparty' > > response = > HTTParty.get("http://rubygems.org/api/v1/versions/httparty.json") > > ========================= END OF SCRIPT================== > > This is the output I received: > > -bash-4.1$ ruby test.rb > > /usr/local/rvm/gems/ruby-2.1.0/gems/json-1.8.1/lib/json/common.rb:67: [BUG] Segmentation fault > ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-linux] > > -- control frame ---------- > c:0022 p:---- s:0072 b:0072 l:000071 d:000071 CFUNC :initialize > c:0021 p:---- s:0070 b:0070 l:000069 d:000069 CFUNC :new > c:0020 p:0099 s:0067 b:0065 l:000064 d:000064 METHOD /usr/local/rvm/gems/ruby-2.1.0/gems/json-1.8.1/lib/json/common.rb:67 > c:0019 p:0090 s:0056 b:0055 l:000054 d:000054 CLASS /usr/local/rvm/gems/ruby-2.1.0/gems/json-1.8.1/lib/json/ext.rb:17 > c:0018 p:0011 s:0053 b:0053 l:000052 d:000052 CLASS /usr/local/rvm/gems/ruby-2.1.0/gems/json-1.8.1/lib/json/ext.rb:12 > c:0017 p:0074 s:0051 b:0051 l:000050 d:000050 TOP /usr/local/rvm/gems/ruby-2.1.0/gems/json-1.8.1/lib/json/ext.rb:9 > c:0016 p:---- s:0049 b:0049 l:000048 d:000048 FINISH > c:0015 p:---- s:0047 b:0047 l:000046 d:000046 CFUNC :require > c:0014 p:0013 s:0043 b:0043 l:000042 d:000042 METHOD :29 > c:0013 p:0027 s:0038 b:0038 l:000037 d:000037 CLASS /usr/local/rvm/gems/ruby-2.1.0/gems/json-1.8.1/lib/json.rb:58 > c:0012 p:0021 s:0036 b:0036 l:000035 d:000035 TOP /usr/local/rvm/gems/ruby-2.1.0/gems/json-1.8.1/lib/json.rb:54 > c:0011 p:---- s:0034 b:0034 l:000033 d:000033 FINISH > c:0010 p:---- s:0032 b:0032 l:000031 d:000031 CFUNC :require > c:0009 p:0013 s:0028 b:0028 l:000027 d:000027 METHOD :29 > c:0008 p:0083 s:0023 b:0023 l:000022 d:000022 TOP /usr/local/rvm/gems/ruby-2.1.0/gems/httparty-0.13.1/lib/httparty.rb:7 > c:0007 p:---- s:0021 b:0021 l:000020 d:000020 FINISH > c:0006 p:---- s:0019 b:0019 l:000018 d:000018 CFUNC :require > c:0005 p:0073 s:0015 b:0015 l:000011 d:000014 BLOCK :33 > c:0004 p:0014 s:0012 b:0012 l:000011 d:000011 METHOD :29 > c:0003 p:0011 s:0007 b:0007 l:001f38 d:001670 EVAL test.rb:3 > c:0002 p:---- s:0004 b:0004 l:000003 d:000003 FINISH > c:0001 p:0000 s:0002 b:0002 l:001f38 d:001f38 TOP > --------------------------- > -- Ruby level backtrace information ---------------------------------------- > test.rb:3:in `
' > :29:in `require' > :33:in `rescue in require' > :33:in `require' > /usr/local/rvm/gems/ruby-2.1.0/gems/httparty-0.13.1/lib/httparty.rb:7:in `' > :29:in `require' > :29:in `require' > /usr/local/rvm/gems/ruby-2.1.0/gems/json-1.8.1/lib/json.rb:54:in `' > /usr/local/rvm/gems/ruby-2.1.0/gems/json-1.8.1/lib/json.rb:58:in `' > :29:in `require' > :29:in `require' > /usr/local/rvm/gems/ruby-2.1.0/gems/json-1.8.1/lib/json/ext.rb:9:in `' > /usr/local/rvm/gems/ruby-2.1.0/gems/json-1.8.1/lib/json/ext.rb:12:in `' > /usr/local/rvm/gems/ruby-2.1.0/gems/json-1.8.1/lib/json/ext.rb:17:in `' > /usr/local/rvm/gems/ruby-2.1.0/gems/json-1.8.1/lib/json/common.rb:67:in `generator=' > /usr/local/rvm/gems/ruby-2.1.0/gems/json-1.8.1/lib/json/common.rb:67:in `new' > /usr/local/rvm/gems/ruby-2.1.0/gems/json-1.8.1/lib/json/common.rb:67:in `initialize' > > -- C level backtrace information ------------------------------------------- > ruby(rb_vm_bugreport+0x68) [0x52d37c] > ruby() [0x5685c9] > ruby(rb_bug+0xee) [0x5686d1] > ruby() [0x4b4728] > /lib64/libpthread.so.0() [0x3e9120f500] > ruby(rb_hash_aref+0x14) [0x4250a4] > /usr/local/rvm/gems/ruby-2.1.0/gems/json-1.8.1/lib/json/ext/generator.so(+0x32bd) [0x7fbfa630e2bd] > /usr/local/rvm/gems/ruby-2.1.0/gems/json-1.8.1/lib/json/ext/generator.so(+0x4e86) [0x7fbfa630fe86] > ruby() [0x520fc6] > ruby() [0x5241d5] > ruby() [0x525409] > ruby() [0x52535f] > ruby(rb_funcall2+0x31) [0x525647] > ruby(rb_obj_call_init+0x6c) [0x41a169] > ruby(rb_class_new_instance+0x30) [0x44d178] > ruby() [0x520fc6] > ruby() [0x520e99] > ruby() [0x520260] > ruby() [0x51b10f] > ruby() [0x52a0fa] > ruby(rb_iseq_eval+0x2d) [0x52aae6] > ruby() [0x56c7e6] > ruby(rb_require_safe+0x18d) [0x56d587] > ruby(rb_f_require+0x20) [0x56cbae] > ruby() [0x520ffd] > ruby() [0x520e99] > ruby() [0x520260] > ruby() [0x51b10f] > ruby() [0x52a0fa] > ruby(rb_iseq_eval+0x2d) [0x52aae6] > ruby() [0x56c7e6] > ruby(rb_require_safe+0x18d) [0x56d587] > ruby(rb_f_require+0x20) [0x56cbae] > ruby() [0x520ffd] > ruby() [0x520e99] > ruby() [0x520260] > ruby() [0x51b10f] > ruby() [0x52a0fa] > ruby(rb_iseq_eval+0x2d) [0x52aae6] > ruby() [0x56c7e6] > ruby(rb_require_safe+0x18d) [0x56d587] > ruby(rb_f_require+0x20) [0x56cbae] > ruby() [0x520ffd] > ruby() [0x520e99] > ruby() [0x520260] > ruby() [0x51b10f] > ruby() [0x52a0fa] > ruby(rb_iseq_eval_main+0x2d) [0x52ab25] > ruby() [0x418a9d] > ruby(ruby_exec_node+0x1e) [0x418bc2] > ruby(ruby_run_node+0x38) [0x418b95] > ruby(main+0x4d) [0x4172c5] > /lib64/libc.so.6(__libc_start_main+0xfd) [0x3e90e1ecdd] > ruby() [0x4171c9] > > [NOTE] > You may have encountered a bug in the Ruby interpreter or extension libraries. > Bug reports are welcome. > For details: http://www.ruby-lang.org/bugreport.html > > Aborted (core dumped) > > > > > -- > https://bugs.ruby-lang.org/