Ruby 1.8.7p352 + Ruby on Rails 3.1.1 + WebRickでセグメンテーションフォルトでまくり

メモとして。Ruby 1.8.7p352 + Ruby on Rails 3.1.1 + WebRickでセグメンテーションフォルトがでてよく落ちる。たとえば、以下のとおり。

Started GET "/assets/application.css?body=1" for 127.0.0.1 at Fri Nov 11 21:14:03 +0900 2011
Served asset /application.css - 304 Not Modified (19ms)
/usr/lib/ruby/1.8/timeout.rb:58: [BUG] Segmentation fault
ruby 1.8.7 (2011-06-30 patchlevel 352) [i486-linux]
Started GET "/assets/application.js?body=1" for 127.0.0.1 at Fri Nov 11 21:27:27 +0900 2011
Served asset /application.js - 304 Not Modified (1ms)
/usr/lib/ruby/gems/1.8/gems/activesupport-3.1.1/lib/active_support/core_ext/class/attribute.rb:81: [BUG] Segmentation fault
ruby 1.8.7 (2011-06-30 patchlevel 352) [i486-linux]
Started GET "/assets/application.css?body=1" for 127.0.0.1 at Sun Nov 13 17:30:33 +0900 2011
Served asset /application.css - 304 Not Modified (3ms)
/usr/lib/ruby/gems/1.8/gems/activerecord-3.1.1/lib/active_record/connection_adapters/sqlite_adapter.rb:56: [BUG] Segmentation fault
ruby 1.8.7 (2011-06-30 patchlevel 352) [i486-linux]
Started GET "/assets/application.js?body=1" for 127.0.0.1 at Sun Nov 13 18:58:47 +0900 2011
Served asset /application.js - 304 Not Modified (0ms)
cache: [GET /assets/application.js?body=1] stale, valid, store
/usr/lib/ruby/1.8/pathname.rb:287: [BUG] Segmentation fault
ruby 1.8.7 (2011-06-30 patchlevel 352) [i486-linux]
Started GET "/assets/main.css?body=1" for 127.0.0.1 at Sun Nov 13 19:08:54 +0900 2011
cache: [GET /assets/main.css?body=1] stale, valid, store
/usr/lib/ruby/gems/1.8/gems/sprockets-2.0.3/lib/sprockets/asset.rb:179: [BUG] Segmentation fault
ruby 1.8.7 (2011-06-30 patchlevel 352) [i486-linux]
Started GET "/assets/application.css?body=1" for 127.0.0.1 at Mon Nov 21 21:58:02 +0900 2011
Served asset /application.css - 304 Not Modified (12ms)
*** glibc detected *** /usr/bin/ruby1.8: free(): invalid size: 0x0a7e9e28 ***
======= Backtrace: =========
/lib/i386-linux-gnu/i686/cmov/libc.so.6(+0x6aac1)[0xb763dac1]
/lib/i386-linux-gnu/i686/cmov/libc.so.6(+0x6c328)[0xb763f328]
/lib/i386-linux-gnu/i686/cmov/libc.so.6(cfree+0x6d)[0xb76423dd]
/usr/lib/libruby1.8.so.1.8(+0x4e560)[0xb77fa560]
======= Memory map: ========
08048000-08049000 r-xp 00000000 08:05 456616     /usr/bin/ruby1.8
08049000-0804a000 rw-p 00000000 08:05 456616     /usr/bin/ruby1.8
08c2a000-0aa44000 rw-p 00000000 00:00 0          [heap]
b1700000-b1721000 rw-p 00000000 00:00 0 
b1721000-b1800000 ---p 00000000 00:00 0 
b18e9000-b2497000 rw-p 00000000 00:00 0 
b24fa000-b2535000 rw-p 00000000 00:00 0 
b2597000-b264b000 rw-p 00000000 00:00 0 
b264b000-b264c000 ---p 00000000 00:00 0 
b264c000-b2e4c000 rw-p 00000000 00:00 0 
b2e4c000-b2e4e000 r-xp 00000000 08:01 66622      /lib/libnss_mdns4.so.2
b2e4e000-b2e4f000 rw-p 00001000 08:01 66622      /lib/libnss_mdns4.so.2
b2e4f000-b2e5f000 r-xp 00000000 08:01 64658      /lib/i386-linux-gnu/i686/cmov/libresolv-2.13.so
b2e5f000-b2e60000 r--p 00010000 08:01 64658      /lib/i386-linux-gnu/i686/cmov/libresolv-2.13.so
b2e60000-b2e61000 rw-p 00011000 08:01 64658      /lib/i386-linux-gnu/i686/cmov/libresolv-2.13.so
b2e61000-b2e63000 rw-p 00000000 00:00 0 
b2e63000-b2e67000 r-xp 00000000 08:01 66962      /lib/i386-linux-gnu/i686/cmov/libnss_dns-2.13.so
b2e67000-b2e68000 r--p 00004000 08:01 66962      /lib/i386-linux-gnu/i686/cmov/libnss_dns-2.13.so
b2e68000-b2e69000 rw-p 00005000 08:01 66962      /lib/i386-linux-gnu/i686/cmov/libnss_dns-2.13.so
b2e69000-b2e73000 r-xp 00000000 08:01 66909      /lib/i386-linux-gnu/i686/cmov/libnss_files-2.13.so
b2e73000-b2e74000 r--p 00009000 08:01 66909      /lib/i386-linux-gnu/i686/cmov/libnss_files-2.13.so
b2e74000-b2e75000 rw-p 0000a000 08:01 66909      /lib/i386-linux-gnu/i686/cmov/libnss_files-2.13.so
b2e82000-b2e8b000 rw-p 00000000 00:00 0 
b2e8b000-b2f2a000 r-xp 00000000 08:05 545987     /usr/lib/libsqlite3.so.0.8.6
b2f2a000-b2f2d000 rw-p 0009e000 08:05 545987     /usr/lib/libsqlite3.so.0.8.6
b2f2d000-b2f2f000 rw-p 00000000 00:00 0 
b2f2f000-b2f36000 r-xp 00000000 08:05 768676     /usr/lib/ruby/gems/1.8/gems/bcrypt-ruby-3.0.1/lib/bcrypt_ext.so
b2f36000-b2f37000 rw-p 00006000 08:05 768676     /usr/lib/ruby/gems/1.8/gems/bcrypt-ruby-3.0.1/lib/bcrypt_ext.so
b2f37000-b2f42000 r-xp 00000000 08:05 712996     /usr/lib/ruby/1.8/i486-linux/socket.so
b2f42000-b2f43000 rw-p 0000a000 08:05 712996     /usr/lib/ruby/1.8/i486-linux/socket.so
b2f43000-b2f56000 r-xp 00000000 08:05 801246     /usr/lib/ruby/gems/1.8/gems/zipruby-0.3.6/lib/zipruby.so
b2f56000-b2f57000 rw-p 00013000 08:05 801246     /usr/lib/ruby/gems/1.8/gems/zipruby-0.3.6/lib/zipruby.so
b2f57000-b2f90000 r-xp 00000000 08:05 713011     /usr/lib/ruby/1.8/i486-linux/nkf.so
b2f90000-b2f93000 rw-p 00038000 08:05 713011     /usr/lib/ruby/1.8/i486-linux/nkf.so
b2f93000-b2f94000 rw-p 00000000 00:00 0 
b2f94000-b2f99000 r-xp 00000000 08:05 607279     /usr/lib/i386-linux-gnu/libXdmcp.so.6.0.0
b2f99000-b2f9a000 rw-p 00004000 08:05 607279     /usr/lib/i386-linux-gnu/libXdmcp.so.6.0.0
b2f9a000-b2f9c000 r-xp 00000000 08:05 607275     /usr/lib/i386-linux-gnu/libXau.so.6.0.0
b2f9c000-b2f9d000 rw-p 00001000 08:05 607275     /usr/lib/i386-linux-gnu/libXau.so.6.0.0
b2f9d000-b2fbb000 r-xp 00000000 08:05 607283     /usr/lib/i386-linux-gnu/libxcb.so.1.1.0
b2fbb000-b2fbc000 rw-p 0001e000 08:05 607283     /usr/lib/i386-linux-gnu/libxcb.so.1.1.0
b2fbc000-b2fc0000 r-xp 00000000 08:01 64595      /lib/libuuid.so.1.3.0
b2fc0000-b2fc1000 rw-p 00003000 08:01 64595      /lib/libuuid.so.1.3.0
b2fc1000-b2fe7000 r-xp 00000000 08:01 64587      /lib/i386-linux-gnu/libexpat.so.1.5.2
b2fe7000-b2fe9000 rw-p 00026000 08:01 64587      /lib/i386-linux-gnu/libexpat.so.1.5.2
b2fe9000-b3025000 r-xp 00000000 08:01 64592      /lib/i386-linux-gnu/libpcre.so.3.12.1
b3025000-b3026000 rw-p 0003b000 08:01 64592      /lib/i386-linux-gnu/libpcre.so.3.12.1
b3026000-b305e000 r-xp 00000000 08:05 545795     /usr/lib/libjpeg.so.8.3.0
b305e000-b305f000 rw-p 00037000 08:05 545795     /usr/lib/libjpeg.so.8.3.0
b305f000-b3068000 r-xp 00000000 08:05 603105     /usr/lib/i386-linux-gnu/libltdl.so.7.3.0
b3068000-b3069000 rw-p 00008000 08:05 603105     /usr/lib/i386-linux-gnu/libltdl.so.7.3.0
b3069000-b3078000 r-xp 00000000 08:05 602943     /usr/lib/i386-linux-gnu/libgomp.so.1.0.0
b3078000-b3079000 rw-p 0000e000 08:05 602943     /usr/lib/i386-linux-gnu/libgomp.so.1.0.0
b3079000-b3088000 r-xp 00000000 08:01 64605      /lib/i386-linux-gnu/libbz2.so.1.0.4
b3088000-b3089000 rw-p 0000f000 08:01 64605      /lib/i386-linux-gnu/libbz2.so.1.0.4
b3089000-b30e2000 r-xp 00000000 08:05 603356     /usr/lib/i386-linux-gnu/libXt.so.6.0.0
b30e2000-b30e6000 rw-p 00058000 08:05 603356     /usr/lib/i386-linux-gnu/libXt.so.6.0.0
b30e6000-b321c000 r-xp 00000000 08:05 602673     /usr/lib/i386-linux-gnu/libX11.so.6.3.0
b321c000-b3220000 rw-p 00135000 08:05 602673     /usr/lib/i386-linux-gnu/libX11.so.6.3.0
b3220000-b3236000 r-xp 00000000 08:05 602987     /usr/lib/i386-linux-gnu/libICE.so.6.3.0
b3236000-b3238000 rw-p 00015000 08:05 602987     /usr/lib/i386-linux-gnu/libICE.so.6.3.0
b3238000-b3239000 rw-p 00000000 00:00 0 
b3239000-b3240000 r-xp 00000000 08:05 603281     /usr/lib/i386-linux-gnu/libSM.so.6.0.1
b3240000-b3241000 rw-p 00006000 08:05 603281     /usr/lib/i386-linux-gnu/libSM.so.6.0.1
b3241000-b3252000 r-xp 00000000 08:05 603402     /usr/lib/i386-linux-gnu/libXext.so.6.4.0
b3252000-b3253000 rw-p 00010000 08:05 603402     /usr/lib/i386-linux-gnu/libXext.so.6.4.0
b3253000-b3285000 r-xp 00000000 08:05 602856     /usr/lib/i386-linux-gnu/libfontconfig.so.1.4.4
b3285000-b3286000 rw-p 00032000 08:05 602856     /usr/lib/i386-linux-gnu/libfontconfig.so.1.4.4
b3286000-b335e000 r-xp 00000000 08:01 64654      /lib/libglib-2.0.so.0.2800.6
b335e000-b335f000 rw-p 000d8000 08:01 64654      /lib/libglib-2.0.so.0.2800.6
b335f000-b3372000 r-xp 00000000 08:05 546412     /usr/lib/liblqr-1.so.0.3.1
b3372000-b3373000 rw-p 00012000 08:05 546412     /usr/lib/liblqr-1.so.0.3.1
b3373000-b3392000 r-xp 00000000 08:05 546580     /usr/lib/libjpeg.so.62.0.0
b3392000-b3393000 rw-p 0001e000 08:05 546580     /usr/lib/libjpeg.so.62.0.0
b3393000-b3429000 r-xp 00000000 08:05 603069     /usr/lib/i386-linux-gnu/libfreetype.so.6.7.2
b3429000-b342d000 r--p 00095000 08:05 603069     /usr/lib/i386-linux-gnu/libfreetype.so.6.7.2
b342d000-b342e000 rw-p 00099000 08:05 603069     /usr/lib/i386-linux-gnu/libfreetype.so.6.7.2
b342e000-b348f000 r-xp 00000000 08:05 602672     /usr/lib/i386-linux-gnu/libtiff.so.4.3.4Abort

セグメンテーションフォルトがでるライブラリーも一定ではない。処理自体もどの処理でおちるというわけでもない。なんだろう?そろそろ、1.9系に移行するかな。自分のプログラムのどこが1.8.7依存なのかがわからないのがちょっと不安。Ruby on Rails 3.1.1への移行が完全に終わったら、1.9.3に移行しよう。

追記(2011年11月13日)

どうも、Asset Pipelineまわりがおかしいみたい。