红宝石1.9分段出现故障 [英] ruby 1.9 segmentation fault on exit

查看:156
本文介绍了红宝石1.9分段出现故障的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在这里变得很疯狂,只是试图在我的服务器上部署一个测试应用程序,并且随着ruby退出(即运行rake资源:预编译或退出控制台等)后,我会继续遇到一个seg错误。刚刚运行

  script / rails r -e productionputs 1
pre>

将导致

  1 
[BUG ]分段错误
ruby​​ 1.9.3p0(2011-10-30修订版33570)[x86_64-linux]

- C级回溯信息----------- --------------------------------
/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]

- 其他运行时信息-------------------------- ---------------------

分段错误

请注意,脚本/耙子任务,无论运行,bu t出口 - > seg故障



奇怪的是,这只发生在我的服务器上(debian lenny,rvm,ruby 1.9.2或1.9.3)只有在生产模式。
自然我以为,一些生产组宝石是造成这个,我试图关闭我的Gemfile,
的生产组以及切换生产< - >开发宝石,没有改变,每次红宝石退出 - > seg fault



我该怎么办?有人可以给我一些调试提示,以获得这个的根源,这个seg错误的回溯
让我绝对没有提示



(我试过删除红宝石和重新编译,我试过1.9.2-p290和1.9.3,相同的结果)



好的,回溯时间:

 #0 rb_string_value(ptr = 0x5a8)at string.c:1406 
1406 VALUE s = * ptr;
(gdb)其中
#0 rb_string_value(ptr = 0x5a8)at string.c:1406
#1 0xb7f3c5b619428 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 = 0x7f3c5b69e88bSegmentation fault,args = 0x66cd40)at error.c:258
#4 0xb7f3c5b54a098 in rb_bug(fmt = 0x7f3c5b69e88bSegmentation fault)at error.c:277
#5 0x00007f3c5b5fe037 in sigsegv(sig =< value optimized out> ;信号=<价值优化>,ctx =< value optimized out>)在signal.c:609
#6<信号处理程序称为>
#7 0x00007f3c4e6fa18d在setrans_client.c中的fini_context_translations()中:211
#8 0x00007f3c4e6ed5df in_l_global_dtors_aux()from /lib/libselinux.so.1
#9 0x800000000400850 in setlocale @ plt()
#10 0x00007fffffffdec0在?? ()
#11 0x00007f3c4e6fb991在_fini()从/lib/libselinux.so.1
#12 0x000000000000005f在?? ()
#13 0x00007f3c5b933d94在?? ()从/lib64/ld-linux-x86-64.so.2
回溯停止:此帧内部的前一帧(损坏的堆栈?)


解决方案

好吧,我知道了!它实际上是这个错误 http://bugs.debian.org/cgi-bin /bugreport.cgi?bug=505920 在libselinux,它已经修复了一段时间,但更新没有使它成为lenny?我自由地安装了libselinux1 deb,我不知道这是否真的是一个好主意,但至少问题已经消失了。


i'm getting crazy here, just trying to deploy a little test app on my server, and i keep getting a seg fault whenever ruby quits (i.e. after running rake assets:precompile, or quitting console etc). just running

script/rails r -e production "puts 1"

will lead to

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

note that the scripts/rake tasks, whatever do run, but on exit -> seg fault

the weird thing is, this 1. happens only on my server (debian lenny, rvm, ruby 1.9.2 or 1.9.3 ) and only in production mode. so naturally i thought, some production group gem is causing this, and i tried switching off the production group in my Gemfile, as well as switching production <-> development gems, no change, everytime ruby quits -> seg fault

what the hell can i do? can somebody give me please some debugging tips to get to the root of this, the backtrace for this seg fault leaves me with absolutely no hint

(i tried removing ruby, and recompiling, and i tried 1.9.2-p290 AND 1.9.3, same result)

okay, backtrace time:

#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?)

解决方案

okay, i got it! it's actually this bug http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=505920 in libselinux, which has been fixed a while ago, but the updates didn't make it into lenny? i took the liberty and installed the libselinux1 deb from squeeze, i'm not sure if this is actually a good idea, but at least the problem is gone.

这篇关于红宝石1.9分段出现故障的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆