Evan Martin (evan) wrote in evan_tech,
Evan Martin

ruby sqlite3 = :(

To better support this offline project, I rewrote LogJam's journal export in Ruby. (It's gotta be like 10% of the length of the original code, mostly due to blocks and the GC.)

Unfortunately, libsqlite3-ruby 1.1.0, the latest available, is buggy. A deterministic program dies with a variety of errors when ran multiple times in a row:
/usr/lib/ruby/1.8/sqlite3/driver/native/driver.rb:169:in `sqlite3_step': undefined method `call' for 21:Fixnum (NoMethodError)

/usr/lib/ruby/1.8/sqlite3/driver/native/driver.rb:169:in `sqlite3_step': undefined method `call' for true:TrueClass (NoMethodError)

/usr/lib/ruby/1.8/sqlite3/driver/native/driver.rb:169: [BUG] Segmentation fault
ruby 1.8.4 (2005-12-16) [i486-linux]

Looks like a memory bug. The probably either forgot to register something with the GC or just used something uninitialized. In any case, I need to figure out what approach will be the least painful.

(Update: using DBI's sqlite3 wrapper fixed it, for some reason or another...)
Tags: livejournal, project, ruby

  • blog moved

    As described elsewhere, I've quit LiveJournal. If you're interested in my continuing posts, you should look at one of these (each contains feed…

  • dremel

    They published a paper on Dremel, my favorite previously-unpublished tool from the Google toolchest. Greg Linden discusses it: "[...] it is capable…

  • treemaps

    I finally wrote up my recent adventures in treemapping, complete with nifty clickable visualizations.

  • Post a new comment


    default userpic
    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.