kubo / ruby-oci8

Ruby-oci8 - Oracle interface for ruby
Other
169 stars 75 forks source link

Seg Fault in ruby-oci8 2.2.0.2 using Rails 4.2.4 with Oracle iClient 12.1 #101

Closed jadon1979 closed 9 years ago

jadon1979 commented 9 years ago

Side Note: We are using a ldap.ora file in our instant client.

db = OCI8.new(user, password, db)

[BUG] Segmentation fault at 0x00000000000009
ruby 2.2.1p85 (2015-02-26 revision 49769) [x86_64-linux]

-- Control frame information -----------------------------------------------
c:0033 p:---- s:0158 e:000157 CFUNC  :server_attach
c:0032 p:0408 s:0153 e:000152 METHOD /var/www/csirt_svf/shared/bundle/ruby/2.2.0/gems/ruby-oci8-2.2.0.2/lib/oci8/oci8.rb:150 [FINISH]
c:0031 p:---- s:0142 e:000141 CFUNC  :new
c:0030 p:0320 s:0136 e:000135 METHOD /var/www/csirt_svf/releases/20151014005016/lib/sdt/db.rb:24
c:0029 p:0404 s:0124 e:000123 TOP    /var/www/csirt_svf/releases/20151014005016/lib/t.rb:32 [FINISH]
c:0028 p:---- s:0113 e:000112 CFUNC  :load
c:0027 p:0012 s:0108 e:000107 BLOCK  /var/www/csirt_svf/shared/bundle/ruby/2.2.0/gems/activesupport-4.2.4/lib/active_support/dependencies.rb:268
c:0026 p:0054 s:0106 e:000105 METHOD /var/www/csirt_svf/shared/bundle/ruby/2.2.0/gems/activesupport-4.2.4/lib/active_support/dependencies.rb:240
c:0025 p:0019 s:0101 e:000100 METHOD /var/www/csirt_svf/shared/bundle/ruby/2.2.0/gems/activesupport-4.2.4/lib/active_support/dependencies.rb:268
c:0024 p:0007 s:0095 e:000094 EVAL   (irb):1 [FINISH]
c:0023 p:---- s:0093 e:000092 CFUNC  :eval
c:0022 p:0024 s:0086 e:000085 METHOD /home/deploy/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/irb/workspace.rb:86
c:0021 p:0025 s:0079 e:000077 METHOD /home/deploy/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/irb/context.rb:379
c:0020 p:0022 s:0073 e:000072 BLOCK  /home/deploy/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/irb.rb:489
c:0019 p:0040 s:0065 e:000064 METHOD /home/deploy/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/irb.rb:623
c:0018 p:0009 s:0060 e:000059 BLOCK  /home/deploy/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/irb.rb:486
c:0017 p:0118 s:0056 e:000055 BLOCK  /home/deploy/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/irb/ruby-lex.rb:245 [FINISH]
c:0016 p:---- s:0053 e:000052 CFUNC  :loop
c:0015 p:0007 s:0050 e:000049 BLOCK  /home/deploy/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/irb/ruby-lex.rb:231 [FINISH]
c:0014 p:---- s:0048 e:000047 CFUNC  :catch
c:0013 p:0015 s:0044 e:000043 METHOD /home/deploy/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/irb/ruby-lex.rb:230
c:0012 p:0030 s:0041 E:002660 METHOD /home/deploy/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/irb.rb:485
c:0011 p:0008 s:0038 e:000037 BLOCK  /home/deploy/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/irb.rb:395 [FINISH]
c:0010 p:---- s:0036 e:000035 CFUNC  :catch
c:0009 p:0143 s:0032 E:001040 METHOD /home/deploy/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/irb.rb:394
c:0008 p:0173 s:0027 e:000026 METHOD /var/www/csirt_svf/shared/bundle/ruby/2.2.0/gems/railties-4.2.4/lib/rails/commands/console.rb:110
c:0007 p:0013 s:0024 e:000023 METHOD /var/www/csirt_svf/shared/bundle/ruby/2.2.0/gems/railties-4.2.4/lib/rails/commands/console.rb:9
c:0006 p:0091 s:0020 e:000019 METHOD /var/www/csirt_svf/shared/bundle/ruby/2.2.0/gems/railties-4.2.4/lib/rails/commands/commands_tasks.rb:68
c:0005 p:0033 s:0016 e:000015 METHOD /var/www/csirt_svf/shared/bundle/ruby/2.2.0/gems/railties-4.2.4/lib/rails/commands/commands_tasks.rb:39
c:0004 p:0116 s:0012 e:000011 TOP    /var/www/csirt_svf/shared/bundle/ruby/2.2.0/gems/railties-4.2.4/lib/rails/commands.rb:17 [FINISH]
c:0003 p:---- s:0008 e:000007 CFUNC  :require
c:0002 p:0056 s:0004 E:002420 EVAL   bin/rails:8 [FINISH]
c:0001 p:0000 s:0002 E:0022d0 TOP    [FINISH]
kubo commented 9 years ago

Does your script require 'pg' before 'oci8'? If so, it is same issue with https://github.com/kubo/ruby-oci8/issues/71. Could you change the script to require 'oci8' before 'pg'?

Otherwise, could you run your script which clashes ruby with the following environment variables and send the output files /tmp/bindings.log.* to kubo@jiubao.org?

jadon1979 commented 9 years ago

Adding "require 'oci8'" to application.rb fixed the issue globally. Thanks.

if you get "TNS:could not resolve the connect identifier specified" then make sure to check ENV['TNS_ADMIN'] right before your call to OCI8. It may not have passed correctly.