EXC_BAD_ADDRESS running 'irb -r RMagick 'on Tiger

T

Timothy Hunter

I've built RMagick on OSX Tiger using my own copy of Ruby 1.8.2 built
from the tarball. I installed the fixrbconfig gem.

RMagick runs fine except when I use the command 'irb -r RMagick'. In
this case I get a EXC_BAD_ACCESS signal. When I require RMagick in irb
by entering "require 'RMagick'" as a separate statement everything runs
fine. All my tests run successfully. It's just this one command that
fails. Anybody have any suggestions?

(P.S. My access to my computer will be sporadic for the next few days so
if I don't respond immediately I will do so as soon as possible.)

The crash log has this info:

Command: ruby
Path: /usr/local/bin/ruby
Version: ??? (???)
PID: 4885
Thread: 0

Exception: EXC_BAD_ACCESS (0x0001)
Codes: KERN_INVALID_ADDRESS (0x0001) at 0x72687c60

Thread 0 Crashed:
0 RMagick.bundle 0x005249e4 Init_RMagick + 0x3f48 (rmmain.c:1010)


The code around rmmain.c:1010 may or may not be the problem. My usual
debugging tricks haven't turned up anything. I've tried gdb but when I
enter the command 'run /opt/local/bin/irb -r RMagick' the Init_RMagick
routine is never entered and gdb reports:

(gdb) run /opt/local/bin/irb -r RMagick
Starting program: /opt/local/bin/ruby /opt/local/bin/irb -r RMagick
Reading symbols for shared libraries .. done
Reading symbols for shared libraries ... done
Reading symbols for shared libraries
.......................................................... done

Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_PROTECTION_FAILURE at address: 0x00000000
0x90124940 in memcmp ()
(gdb) run /opt/local/bin/irb -r RMagick
Starting program: /opt/local/bin/ruby /opt/local/bin/irb -r RMagick
Reading symbols for shared libraries .. done
Reading symbols for shared libraries ... done
Reading symbols for shared libraries
.......................................................... done

Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_PROTECTION_FAILURE at address: 0x00000000
0x90124940 in memcmp ()
(gdb) whe
#0 0x90124940 in memcmp ()
#1 0x9076024c in __CFInitialize ()
#2 0x8fe15afc in
__dyld__ZN16ImageLoaderMachO16doInitializationERKN11ImageLoader11LinkContextE
()
#3 0x8fe0b5b0 in
__dyld__ZN11ImageLoader23recursiveInitializationERKNS_11LinkContextE ()
#4 0x8fe0b538 in
__dyld__ZN11ImageLoader23recursiveInitializationERKNS_11LinkContextE ()
#5 0x8fe0b538 in
__dyld__ZN11ImageLoader23recursiveInitializationERKNS_11LinkContextE ()
#6 0x8fe0b538 in
__dyld__ZN11ImageLoader23recursiveInitializationERKNS_11LinkContextE ()
#7 0x8fe0b538 in
__dyld__ZN11ImageLoader23recursiveInitializationERKNS_11LinkContextE ()
#8 0x8fe0b538 in
__dyld__ZN11ImageLoader23recursiveInitializationERKNS_11LinkContextE ()
#9 0x8fe0b538 in
__dyld__ZN11ImageLoader23recursiveInitializationERKNS_11LinkContextE ()
#10 0x8fe0ed38 in
__dyld__ZN11ImageLoader4linkERKNS_11LinkContextENS_15BindingLazinessENS_18InitializerRunningEj
()
#11 0x8fe0443c in
__dyld__ZN4dyld4linkEP11ImageLoaderNS0_15BindingLazinessENS0_18InitializerRunningE
()
#12 0x8fe08ba8 in __dyld_NSLinkModule ()
#13 0x9002db98 in NSLinkModule ()
#14 0x0001ddcc in dln_load (file=0x477710
"/Users/xxxxxxxx/RMagick/ext/RMagick/RMagick.bundle") at dln.c:1466
#15 0x0001a810 in rb_require_safe (fname=3417968, safe=0) at eval.c:6858
#16 0x0000e368 in rb_call0 (klass=1944716, recv=1939896, id=9225,
oid=9225, argc=1, argv=0xbfff9d60, body=0x1cc088, nosuper=0) at eval.c:5522
#17 0x0000ecac in rb_call (klass=1944716, recv=1939896, mid=9225,
argc=1, argv=0xbfff9d60, scope=1) at eval.c:5743
#18 0x0000c208 in rb_eval (self=1939896, n=0x907dc69c) at eval.c:3244
#19 0x0001a104 in rb_load (fname=3418708, wrap=0) at eval.c:6528
#20 0x0001a7c8 in rb_require_safe (fname=1878736, safe=0) at eval.c:6849
#21 0x0000e368 in rb_call0 (klass=1944716, recv=1801296, id=9225,
oid=9225, argc=1, argv=0xbfffb070, body=0x1cc088, nosuper=0) at eval.c:5522
#22 0x0000ecac in rb_call (klass=1944716, recv=1801296, mid=9225,
argc=1, argv=0xbfffb070, scope=1) at eval.c:5743
#23 0x0000c208 in rb_eval (self=1801296, n=0x907dc69c) at eval.c:3244
#24 0x0000b684 in rb_eval (self=1801296, n=0x907dc69c) at eval.c:3036
#25 0x000120b0 in rb_yield_0 (val=1878736, self=1801296, klass=0,
flags=0, avalue=0) at eval.c:4726
#26 0x000222e4 in rb_ary_each (ary=3232788) at array.c:1131
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top