 |
Forums |
Admin Discussion Forums: help Start New Thread
By: Randy Parker
RE: Segfault in OS X 10.7 [ reply ] 2011-07-29 15:29
|
The advice to simply "use the 32-bit lib" won't work because of a bug in the 32-bit Ruby build process: ruby-core bug #3353, http://redmine.ruby-lang.org/issues/show/3353
Passing the rvm instruction: rvm_archflags="-arch i386" in the ".rvmrc" configuration file succeeds in getting the ".o" files compiled as 32-bit objects, but the actual compilation of rubylib.dylib itself is attempted as x86_64. Naturally, that attempt fails.
You can compile rubylib.dylib by hand using the -arch i386 flag, but since the rvm script does not complete, the 32-bit ruby never gets properly installed. See:
https://gist.github.com/1112425
|
By: Julian Francis-Lawton
RE: Segfault in OS X 10.7 [ reply ] 2011-07-21 23:07
|
Rutger - there's an update on the Oracle forum today - it appears that it is only the 64-bit client that is crashing - the 32-bit client works.
Unfortunately that probably means compiling and running the rest of your process as 32-bit to use the library.
Hopefully some Oracle staff are experiencing same issues!
|
By: Rick Ashton
RE: Segfault in OS X 10.7 [ reply ] 2011-03-08 12:15
|
Hi Kubo
You are quite right. I downloaded sqlplus and tried to run that, also to end up with a segfault. I will try Oracle forums and also file a bug with Apple.
Thanks :)
|
By: Kubo Takehiro
RE: Segfault in OS X 10.7 [ reply ] 2011-03-08 11:47
|
I have just now known that Mac OS X 10.7 Lion is in a developer preview.
It may be a bug in Lion. Could you file it to Apple?
I hope that it is fixed before the release or Oracle releases a new instant client compatible with Lion.
|
By: Rick Ashton
RE: Segfault in OS X 10.7 [ reply ] 2011-03-08 11:04
|
Okay, ran it :) But it seems to just segfault in every test :( Here is the output:
checking for load library path...
DYLD_LIBRARY_PATH...
checking /usr/local/oracle/instantclient_10_2... yes
/usr/local/oracle/instantclient_10_2/libclntsh.dylib.10.1 looks like an instant client.
checking for cc... ok
checking for gcc... yes
checking for LP64... yes
checking for ruby header... ok
checking for OCIInitialize() in oci.h... yes
creating Makefile
gcc -I. -I. -I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin11.0 -I. -DHAVE_OCIINITIALIZE -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -fno-common -arch x86_64 -g -Os -pipe -fno-common -DENABLE_DTRACE -fno-common -pipe -fno-common -I/usr/local/oracle/instantclient_10_2/sdk/include -c oratest.c
cc -arch x86_64 -pipe -bundle -undefined dynamic_lookup -o oratest.bundle oratest.o -L. -L/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib -L. -arch x86_64 -lruby -L/usr/local/oracle/instantclient_10_2 -lclntsh -lpthread -ldl
============================================================
Testing oratest1...
./oratest1.bundle: [BUG] Segmentation fault
ruby 1.8.7 (2010-01-10 patchlevel 249) [universal-darwin11.0]
Testing oratest2...
./oratest2.bundle: [BUG] Segmentation fault
ruby 1.8.7 (2010-01-10 patchlevel 249) [universal-darwin11.0]
Testing oratest3...
./oratest3.bundle: [BUG] Segmentation fault
ruby 1.8.7 (2010-01-10 patchlevel 249) [universal-darwin11.0]
Testing oratest4...
./oratest4.bundle: [BUG] Segmentation fault
ruby 1.8.7 (2010-01-10 patchlevel 249) [universal-darwin11.0]
Testing oratest5...
./oratest5.bundle: [BUG] Segmentation fault
ruby 1.8.7 (2010-01-10 patchlevel 249) [universal-darwin11.0]
Testing oratest6...
./oratest6.bundle: [BUG] Segmentation fault
ruby 1.8.7 (2010-01-10 patchlevel 249) [universal-darwin11.0]
|
By: Kubo Takehiro
RE: Segfault in OS X 10.7 [ reply ] 2011-03-08 10:47
|
Thank you.
I suspect it may be a bug in libclntsh.so.
I made test code to confirm that just calling OCIEnvCreate() causes SEGV and find workaround in several patterns.
Could you try the code and post messages outputted to the console?
Click [Download] button in <URL:https://gist.github.com/860128>
The test code is downloaded as gist860128-32f2c850a6e1c0a67140d0d1babe788f89106701.tar.gz.
tar xvfz gist860128-32f2c850a6e1c0a67140d0d1babe788f89106701.tar.gz
cd gist860128-32f2c850a6e1c0a67140d0d1babe788f89106701
ruby oratest.rb
|
By: Rick Ashton
RE: Segfault in OS X 10.7 [ reply ] 2011-03-07 14:08
|
Okay :)
It didn't seem to be able to pick up where oci8 was running through gdb like this so I had to use:
run -rubygems -e 'require "oci8"'
So:
(gdb) run -rubygems -e 'require "oci8"'
Starting program: /usr/bin/ruby -rubygems -e 'require "oci8"'
Reading symbols for shared libraries .. done
Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_INVALID_ADDRESS at address: 0x0000000000000000
0x00000001023a149e in lpmapd ()
(gdb) backtrace
#0 0x00000001023a149e in lpmapd ()
#1 0x000000010236bf6c in lfvLoadPkg ()
#2 0x000000010236bba5 in lfvSetShlMode ()
#3 0x000000010236b1a3 in lfvini1 ()
#4 0x000000010236ae72 in lfvinit ()
#5 0x0000000101dc8491 in kpummpin ()
#6 0x00000001010ad1b3 in kpuenvcr ()
#7 0x00000001011a9116 in OCIEnvCreate ()
#8 0x000000010019f281 in Init_oci8lib_18 () at oci8lib.c:96
#9 0x00000001000126ae in dln_load ()
#10 0x000000010002f7cd in rb_require_safe ()
#11 0x000000010001ab58 in rb_rescue ()
#12 0x00000001000277d5 in rb_alias ()
#13 0x0000000100025040 in rb_funcall2 ()
#14 0x0000000100021933 in rb_thread_schedule ()
#15 0x0000000100020c82 in rb_thread_schedule ()
#16 0x0000000100027dc6 in rb_alias ()
#17 0x0000000100025040 in rb_funcall2 ()
#18 0x0000000100021933 in rb_thread_schedule ()
#19 0x000000010002f1aa in rb_load ()
#20 0x000000010002f77c in rb_require_safe ()
#21 0x000000010001ab58 in rb_rescue ()
#22 0x00000001000277d5 in rb_alias ()
#23 0x0000000100025040 in rb_funcall2 ()
#24 0x0000000100021933 in rb_thread_schedule ()
#25 0x0000000100020f73 in rb_thread_schedule ()
#26 0x0000000100027dc6 in rb_alias ()
#27 0x0000000100025040 in rb_funcall2 ()
#28 0x0000000100021933 in rb_thread_schedule ()
#29 0x000000010002e17c in rb_eval_cmd ()
#30 0x0000000100030125 in ruby_run ()
#31 0x0000000100000efb in main ()
Thanks! :)
|
By: Kubo Takehiro
RE: Segfault in OS X 10.7 [ reply ] 2011-03-04 11:41
|
Could you run the code on gdb debugger and post its backtrace?
$ gdb `which ruby`
...
startup messages
...
(gdb) run -r oci8 -e ''
...
Program received signal SIGSEGV, Segmentation fault.
...
(gdb) backtrace
|
|
 |