now | writings | rss | github | twitter | contact

ruby, snow leopard, and dl

posted to writings on sep 3rd, 2009 with tags mac, nerd, and ruby

more snow leopard breakage: ruby compiled for a 64-bit processor crashes when doing certain calls through the dl module.

the gd2 ruby module (which just dlopen's the gd2 c library) calls gd2's gdImageStringFTEx function which crashes the ruby interpreter. apparently this is an old issue that is still unfixed in the ruby shipping with snow leopard (1.8.7p72; why so old apple?) or any 1.8.7 for that matter. even after ripping out the old ruby and installing the latest patchlevel (174), it still crashes:

/usr/lib/ruby/gems/1.8/gems/gd2-1.1.1/lib/gd2/font.rb:234: [BUG] Segmentation fault
ruby 1.8.7 (2009-06-12 patchlevel 174) [i686-darwin10.0.0]

Abort
Exit 134

since this is such an old issue, there's an old patch to fix it. i have no idea why this isn't fixed in the 1.8.7 branch by now, but the 3 year old patch in that mailing list message applies cleanly to a 1.8.7p174 tree, and after recompiling and reinstalling, ruby no longer crashes with the gd2 module.

Comments? Contact me via Twitter or e-mail.