退出时红宝石1.9分段故障

时间:2011-11-01 15:40:48

标签: ruby-on-rails ruby segmentation-fault debian

我在这里变得疯狂,只是试图在我的服务器上部署一个小测试应用程序,并且每当ruby退出时(即在运行rake资产:预编译或退出控制台等之后)我都会遇到seg故障。刚刚跑步

script/rails r -e production "puts 1"

将导致

1
[BUG] Segmentation fault
ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-linux]

-- C level backtrace information -------------------------------------------
/usr/local/rvm/rubies/ruby-1.9.3-p0/lib/libruby.so.1.9 [0x7f92fd681f25]
/usr/local/rvm/rubies/ruby-1.9.3-p0/lib/libruby.so.1.9 [0x7f92fd55608c]
/usr/local/rvm/rubies/ruby-1.9.3-p0/lib/libruby.so.1.9(rb_bug+0xb8) [0x7f92fd556208] error.c:277
/usr/local/rvm/rubies/ruby-1.9.3-p0/lib/libruby.so.1.9 [0x7f92fd60db77]
/lib/libpthread.so.0 [0x7f92fd2e5a80]
/lib/libselinux.so.1 [0x7f92f0db831d]
/lib/libselinux.so.1 [0x7f92f0dab57f]

-- Other runtime information -----------------------------------------------

Segmentation fault

请注意脚本/ rake任务,无论运行什么,但在退出时 - > seg fault

奇怪的是,这只发生在我的服务器上(debian lenny,rvm,ruby 1.9.2或1.9.3)并且仅在生产模式下发生。 所以我自然而然地认为,一些生产组宝石正在造成这种情况,我尝试关闭我的Gemfile中的生产组, 以及转换生产< - >发展宝石,没有变化,每次红宝石退出 - > seg fault

我该怎么办?有人可以给我一些调试技巧,以找到这个回溯的根源 因为这个段错误让我完全没有提示

(我尝试删除ruby,然后重新编译,我尝试了1.9.2-p290和1.9.3,结果相同)

好的,回溯时间:

#0  rb_string_value (ptr=0x5a8) at string.c:1406
1406        VALUE s = *ptr;
(gdb) where
#0  rb_string_value (ptr=0x5a8) at string.c:1406
#1  0x00007f3c5b619428 in rb_string_value_cstr (ptr=0x5a8) at string.c:1424
#2  0x00007f3c5b6708cc in rb_vm_bugreport () at vm_dump.c:826
#3  0x00007f3c5b549f1c in report_bug (file=<value optimized out>, line=<value optimized out>, fmt=0x7f3c5b69e88b "Segmentation fault", args=0x66cd40) at error.c:258
#4  0x00007f3c5b54a098 in rb_bug (fmt=0x7f3c5b69e88b "Segmentation fault") at error.c:277
#5  0x00007f3c5b5fe037 in sigsegv (sig=<value optimized out>, info=<value optimized out>, ctx=<value optimized out>) at signal.c:609
#6  <signal handler called>
#7  0x00007f3c4e6fa18d in fini_context_translations () at setrans_client.c:211
#8  0x00007f3c4e6ed5df in __do_global_dtors_aux () from /lib/libselinux.so.1
#9  0x0000000000400850 in setlocale@plt ()
#10 0x00007fffffffdec0 in ?? ()
#11 0x00007f3c4e6fb991 in _fini () from /lib/libselinux.so.1
#12 0x000000000000005f in ?? ()
#13 0x00007f3c5b933d94 in ?? () from /lib64/ld-linux-x86-64.so.2
Backtrace stopped: previous frame inner to this frame (corrupt stack?)

1 个答案:

答案 0 :(得分:2)

好吧,我明白了!它实际上是libselinux中的这个bug http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=505920,它已经修复了一段时间,但更新没有进入lenny?我冒昧地从挤压中安装了libselinux1 deb,我不确定这实际上是不是一个好主意,但至少问题已经消失了。