rsim / ruby-plsql

ruby-plsql gem provides simple Ruby API for calling Oracle PL/SQL procedures. It could be used both for accessing Oracle PL/SQL API procedures in legacy applications as well as it could be used to create PL/SQL unit tests using Ruby testing libraries.
MIT License
136 stars 58 forks source link

Segmentation fault when "should execute function with cursor parameter and return record" #21

Closed yahonda closed 12 years ago

yahonda commented 12 years ago

Always got a segmentation fault when "should execute function with cursor parameter and return record" executed.

$ ruby -I"lib:lib:spec"  "/home/yahonda/Dropbox/git/ruby-plsql/ruby-oci8/ruby/1.8/gems/rspec-1.3.2/bin/spec" "spec/plsql/procedure_spec.rb:1546"
Segmentation fault

$ bundle update
Fetching source index for http://rubygems.org/
Using rake (0.9.2.2) 
Using activesupport (2.3.8) 
Using activerecord (2.3.8) 
Using activerecord-oracle_enhanced-adapter (1.3.1) 
Using bundler (1.0.21) 
Using git (1.2.5) 
Using jeweler (1.5.2) 
Using rspec (1.3.2) 
Using ruby-oci8 (2.0.4) 
Your bundle is updated! Use `bundle show [gemname]` to see where a bundled gem is installed.
[1.8.7@rubyplsql238] yahonda@myoel5 ~/Dropbox/git/ruby-plsql (address_rake_aborted) 

1546     it "should execute function with cursor parameter and return record" do
1547       pending "not possible from JDBC" if defined?(JRUBY_VERSION)
1548       plsql.test_cursor do |cursor|
1549         plsql.test_cursor_fetch(cursor).should == @employees[0]
1550       end
1551     end

Actually, I'm not sure how to find the cause of this segmentation fault yet.

rsim commented 12 years ago

It seems to be issue with ruby-oci8 version 2.1.0, I reported the issue there https://github.com/kubo/ruby-oci8/issues/11

In the meantime changed this test to pending status if ruby-oci8 2.1.0 is used.

yahonda commented 12 years ago

Thanks for the info and actions. I'll see the issue#11 at ruby-oci8.

yahonda commented 12 years ago

Since ruby-oci8 2.1.1 has been released this error should have fixed however, got an following internal heap errors every time (3 of 3) I tested.

[1.9.3@rubyplsql] yahonda@myoel5 ~/work/ruby-plsql (function_with_cursor_parameter_with_ruby-oci8_211) 
$ /home/yahonda/.rvm/rubies/ruby-1.9.3-p194/bin/ruby -S rspec ./spec/plsql/procedure_spec.rb
........................................................................................................................link mismatch chunk 0x9466520 nchk 0x9466544 size 36
***** Internal heap ERROR kghfrmrg:nxt addr=0x9466544 ds=0x9466a14 *****

***** Dump of memory around addr 0x9466544: 

Here is my environment.

Ruby 1.9.3-p194 Oracle 10.2.0.5(x86 32-bit) Oracle Linux 5.8

yahonda commented 12 years ago

Here is the full output.

https://gist.github.com/2467230

yahonda commented 12 years ago

ruby-oci 2.1.2 resolves this issue.


$ /home/yahonda/.rvm/rubies/ruby-1.9.3-p194/bin/ruby -S rspec ./spec/plsql/procedure_spec.rb
......................................................................................................................................

Finished in 15.45 seconds
134 examples, 0 failures