在Ruby解释器出现段错误之后,是否有可能从corefile获取Ruby回溯? [英] After the Ruby interpreter segfaults, is it possible to get the Ruby backtrace from the corefile?

查看:220
本文介绍了在Ruby解释器出现段错误之后,是否有可能从corefile获取Ruby回溯?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

注意:我使用的是段错误,在使用libxml-ruby gem来解释问题时遇到了问题,但我已经用上述gem修复了我的问题。这个问题的真正目的是从gdb和解释器本身遇到分段错误的核心文件查看Ruby backtrace(即解释器打印的内容与Ruby代码无法处理异常时打印的内容相同)。



在生成一个XML文档时,我得到了一个奇怪的segfault:
$ b $ $ p $ / railsroot / vendor / isolated / ruby​​-1.8 / gems / libxml-ruby-1.1.2 / lib / libxml / node.rb:123:[BUG]分割错误
ruby​​ 1.8.7(2011-02-18 patchlevel 334) [x86_64-linux],MBARI 0x6770,Ruby Enterprise Edition 2011.03

中止

更新1:这段segfaults也在rubilla(MRI)下面。



我打开了corefiles并查看了backtrace在gdb中(请参阅问题的结尾)。我可以看到解释器崩溃的位置,Google搜索会导致很多有希望的结果。除了解释器回溯之外,我想看到的是Ruby代码本身的回溯(即从解释器的角度来看回溯)。



我希望在gdb中加载内核将允许我调用一些解释器函数来打印解释代码的堆栈。



任何想法?



这是核心和回溯,好奇:

 :foo @ bar; ulimit -c unlimited 
:foo @ bar; RAILS_ENV = production ./script/runner script / feeds / batchfeed.rb --config config / feeds / $ feed.yml --timer /tmp/$feed.timer --gzip --output /tmp/$feed.xml。 gz
/railsroot/vendor/isolated/ruby-1.8/gems/libxml-ruby-1.1.2/lib/libxml/node.rb:123:[BUG]分段错误
ruby​​ 1.8.7( 2011-02-18 patchlevel 334)[x86_64-linux],MBARI 0x6770,Ruby Enterprise Edition 2011.03

中止
:foo @ bar; ls -l core
-rw ------- 1 rails rails 145301504 2011-03-04 08:34 core
:foo @ bar; gdb`哪个ruby核心
GNU gdb(GDB)7.1-ubuntu
版权所有(C)2010自由软件基金会,
许可证GPLv3 +:GNU GPL版本3或更新版本< http: //gnu.org/licenses/gpl.html>
这是免费软件:您可以自由更改和重新分配它。
在法律允许的范围内,不存在任何担保。有关详细信息,请键入显示复制
和显示保修。
这个GDB被配置为x86_64-linux-gnu。
有关错误报告的说明,请参阅:
< http://www.gnu.org/software/gdb/bugs/> ;.
(gdb)bt
#0 0x00007f041c095a75 in /lib/libc.so.6中的raise()
#1 0x00007f041c0995c0从/lib/libc.so.6 $ b中的abort $ b#2 0x000000004a3d59在rb_bug(fmt = 0x4bfc60Segmentation fault)中error.c:213
#3 0x0000000000477e75 sigsegv(sig =)at signal.c:633
#4 $ b $在eval处,在st.c:250
#6处的st_lookup(table = 0x7f041867eda0,key = 3031,value = 0x7fff813ee288)中的b#5 0x000000000047ae79 0x14000000413ddf(search_method(klass = 132608000,id = 3031,origin = 0x7fff813ee2c8) c:510
#7 0x0000000000413e67 rb_get_method_body(klassp = 0x7fff813ee318,idp = 0x7fff813ee320,noexp = 0x7fff813ee32c)在eval.c:531
#8 0x000000000041c66b在rb_call(klass = 132608000,recv = 132608200,mid eval.c:6282
#9 0x0000000000427a38在eval_call(self = 132610480,node = 0x1df0308)处的eval.c:3381 $ = 3031,argc = 0,argv = 0x0,scope = 0,self = 132610480) b $ b#10 0x0000000041964c在rb_eval(self = 132610480,node = 0x1df02e0)at eval.c:4015
#11 0x000000000041c42b in rb_call0( klass = 37665480,recv = 132610480,id = 104367,oid =,argc = 0,argv = 0x0,body = 0x1d42f28,flags = 0)
at eval.c:6211
#12 0x000000000041c733 in rb_call (自我= 74960600,节点eval.c:6308
#13 0x0000000000427a38(klass = 37665480,recv = 132610480,mid = 104367,argc = 0,argv = 0x0,scope = 0,self = 74960600)在eval.c:3910
#15中rb_eval(self = 74960600,node = 0x488efd8)处的eval.c:3381 $ b $#14 0x0000000000419bc4 rb_call0(klass = 75623080,recv = 74960600 ,id = 75649,oid =,argc = 0,argv = 0x7fff813eead0,body = 0x481e5d0,
flags = -2126583088)at eval.c:6211
#16 0x000000000041c733 in rb_call(klass = 75623080,recv eval.c:6308
#17 0x0000000000427ccf在eval_fcall(self = 74960600,node = 0x48915d0)处于eval时,在= eval.c中:= 74960600,mid = 75649,argc = 2,argv = 0x7fff813eeac0,scope = 1,self = 74960600)。 c:3396
#18 eval_iter(self = 74960600,node = 0x4890fb8)中的0x0000000000426cdb在eval.c:3200
#19 0x00000000004279ef在eval_call(self = 74960600,node = 0x4 eval.c:5239
#21 0x000000000048fd01 in eval.c:3376
#20 0x000000000041aacb in rb_yield_0(val = 132724680,self = 74960600,klass =,flags =,avalue = 0) rb_call0(klass = 21994320,recv = 132624640,id = 4001,oid =,argc =,
argv =,body = 0x14f9308)array.c中的rb_ary_each(ary = 132624640):1261
#22 0x000000000041c555 (klass = 21994320,recv = 132624640,mid = 4001,argc = 0,argv = 0x0,scope = 0,self = 74960600)在eval.c:6058
#23 0x000000000041c733 eval.c:6308
#24 0x0000000000427a38在eval.call(self = 74960600,node = 0x48921b0)eval.c:3381
#25 0x00000000426cdb在eval_iter(self = 74960600,node = 0x4890ef0) c:3200
#26 0x000000000041aacb in rb_yield_0(val = 132612040,self = 74960600,klass =,flags =,avalue = 0)at eval.c:5239
#27 0x000000000041958c in rb_eval(self = 74960600 (klass = 75623080,recv = 74960600,id = 75649,oid =,argc = 0,argv = 0x7fff813efb48,body)中的eval.c:3858
#28 0x000000000041c42b(节点= 0x488f0f0)在eval.c中:6211
#29 0x0000000041c733在rb_call(klass = 75623080,recv = 74960600,mid = 75649,argc = 1,argv = 0x7fff813efb40,scope = 0x481e5d0,
flags = -2126578872) eval.c:3396 $ b $##31 0x0000000000426cdb eval_iter(self = 74960600,self = 74960600)at eval.c:6308
#30 0x0000000000427ccf in eval_fcall(self = 74960600,node = 0x4893830) node = 0x4890e78)at eval.c:3200
#32 0x0000000041c42b in rb_call0(klass = 75623080,recv = 74960600,id = 149753,oid =,argc = 0,argv = 0x7fff813f0138,body = 0x481e710,$ b $在rb_call(klass = 75623080,recv = 74960600,mid = 149753,argc = 3,argv = 0x7fff813f0120,scope = 1,self = 74960600)中,eval.c:6211
#33 0x000000000041c733处的b标志= -2126577352) eval.c:6308
#34 0x00000000427ccf eval_fcall(self = 74960600,node = 0x4893cb8)at eval.c:3396
#35 0x000000004279ef在eval_call(self = 74960600,node = 0x4893c68)at eval .c:3376
#36 0x000000000041aacb在rb_yield_0(val = 132614040,self = 74960600,klass =,flags =,avalue = 0)at eval.c:52在eval.c:3858
#38中,rb_call0(klass = 75623080,recv = 74960600,id = 75649,oid =,)中rb_eval(self = 74960600,node = 0x488f0f0)中的39
#37 0x000000000041958c argc = 0,argv = 0x7fff813f07e0,body = 0x481e5d0,
flags = -2126575648)at eval.c:6211
#39 0x000000000041c733 in rb_call(klass = 75623080,recv = 74960600,mid = 75649,argc eval.c:6308
#40 0x00000000427ccf eval_fcall(self = 74960600,node = 0x488e7b8)at eval.c:3396
#= 0x000000427ccf = 2,argv = 0x7fff813f07d0,scope = 1,self = 74960600) 41 0x0000000042687c in block_pass(s​​elf =,node =)at eval.c:9336
#42 0x000000000041c42b in rb_call0(klass = 75623080,recv = 74960600,id = 95641,oid =,argc = 0,argv = 0x7fff813f0dc8, body = 0x481e580,
flags = -2126574136)at eval.c:6211
#43 0x000000000041c733 in rb_call(klass = 75623080,recv = 74960600,mid = 95641,argc = 1,argv = 0x7fff813f0dc0,scope eval.c:6308
#44 0x0000000000427ccf在eval.cfall(self = 74960600,node = 0x4895360)eval.c:3396
#4 eval.c中的eval_call(self = 74960600,node = 0x4893b78)处的eval.c:3200
#46 0x000000004279ef处的eval_iter(self = 74960600,node = eval.c:5239
#48 rb_yield_0(val = 70241560,self = 74960600,klass =,flags = 0)中的rb_yield_0(val = 132618280,self = 74960600,klass =,flags =,avalue = 2) ,avalue = 0)at eval.c:5239
#49 0x000000000048fd01 in rb_ary_each(ary = 132621000)at array.c:1261
#50 0x000000000041c555 in rb_call0(klass = 21994320,recv = 132621000,id eval.c:6058
#51 0x000000000041c733 rb_call(klass = 21994320,recv = 132621000,mid = 4001,oid =,argc =,
argv =,body = 0x14f9308,flags = 0) eval.c:6308
#52 0x0000000000427a38在eval.call(self = 74960600,node = 0x48906d0)处eval.c:3381 $ b处为4001,argc = 0,argv = 0x0,scope = 0,self = 74960600)在eval.c:3200
#54中的eval_iter(self = 74960600,node = 0x488ffc8)中的$ b#53 0x0000000000426cdb rb_call0(klass = 75623080,recv = 74960600,id = 149745,oid =,argc = 0,argv = 0x7fff813f1e18,body = 0x481e6c0,
flags = -2126569960)at eval.c:6211
---类型继续,或者q到在eval.c:6308 $ b退出---
#55 0x000000000041c733在rb_call(klass = 75623080,recv = 74960600,mid = 149745,argc = 1,argv = 0x7fff813f1e10,scope = 1,self = 74960600)在eval.c中的$ b#56 0x0000000000427ccf eval.cf(self = 74960600,node = 0x4898470)eval.c:3396
#57 eval_iter(self = 74960600,node = 0x4893ad8)中的0x0000000000426cdb eval.c:3200
在eval.c:6211 $ b处的rb_call0(klass = 75623080,recv = 74960600,id = 149737,oid =,argc = 0,argv = 0x7fff813f2400,body = 0x481e760,
标志= -2126568448)#58 0x000000000041c42b在eval.c中:$ b#59 0x000000000041c733(klass = 75623080,recv = 74960600,mid = 149737,argc = 2,argv = 0x7fff813f23f0,scope = 1,self = 74960600)在$ eval.c:6308
#60 0x0000000000427ccf eval.c:3396
#61中的eval_fcall(self = 74960600,node = 0x48988a8)在eval.c:3858
#62中的rb_eval(self = 74960600,node = 0x4898858)中的0x000000000041958c eval.c:6211
中的rb_call0(klass = 75623080,recv = 74960600,id = 149633,oid =,argc = 0,argv = 0x7fff813f27f8,body = 0x481e7b0,
标志= -2126567432)中的0x000000000041c42b在rb_call(klass = 75623080,recv = 74960600,mid = 149633,argc = 1,argv = 0x7fff813f27f0,scope = 3,self = 6)中的#63 0x000000000041c733位于eval.c:6308
#64 0x000000004191ec in rb_call_super argc =,argv =)at eval.c:6476
#65 0x000000004193b5 in eval_super(self = 0,node = 0x483ac08)at eval.c:3441
#66 0x00000000004267cc in block_pass(s​​elf =,node =)在eval.c:9316
#67 0x00000000004272f3 eval.c中的eval_ensure(self = 74960600,node = 0x483aa28):3291
#68 rb_yield_0中的0x000000000041aacb(val = 132629640,self = 74960600,在eval.c:9038
#中的proc_invoke(proc =,args =,self =,klass = 74960440)中的eval.c:5239
#69 0x000000000041b416中的klass =,flags =,avalue = 2) eval.c:6092
中的rb_call0(klass = 74960440,recv = 74960600,id = 149633,oid =,argc =,
argv =,body = 0x477cd70,flags = 0)中的0x000000000041bf12 eval.c中的#71 0x000000000041c733(klass = 74960440,recv = 74960600,mid = 149633,argc = 1,argv = 0x7fff813f3340,scope = 0,self = 74975160)eval.c:6308
#72 0x0000000000427a38 in eval_call在eval.c:5239 $ b处的eval.c:3381
#73 0x000000000041aacb在rb_yield_0(val = 135232920,self = 74975160,klass =,flags =,avalue = 0)处的自我= 74975160,节点= 0x48b6b50)在eval.c:5239
#75 0x000000000041aacb中的rb_yield_0(val = 138467880,self = 74975160,klass =,flags =,avalue = 0)中的$ b#74 0x000000000041aacb (klass = 21994320,klass = klass =,flags =,avalue = 0)在eval.c:5239
#76 0x000000000048fd01 rb_ary_each(ary = 138491800)at array.c:1261
#77 0x000000000041c555 in rb_call0 recv = 138491800,id = 4001,oid =,argc =,
argv =,body = 0x14f9308,flags = 0)在eval.c:6058
#78 0x000000000041c733在rb_call(klass = 21994320,recv在eval_call(self = 74975160,在eval.c中:6308
#79 0x0000000000427a38)= 138491800,mid = 4001,argc = 0,argv = 0x0,scope = 0,self = 74975160) eval.c:3200
#81中的eval_iter(self = 74975160,node = 0x48bb0b0)处的eval.c:3381
#80 0x0000000000426cdb(self = 74975160,node = 0x48bb808) eval.c:3118
#83在eval_while(self = 74975160,node = 0x48bab88)处的eval.c:3858
#82 0x0000004261b7 rb_call0(klass = 75513520,recv = 74975160,在eval.c:6211
#84 0x0000000041c733在rb_call(klass = 75513520,recv = 1)中的id = 149601,oid =,argc = 0,argv = 0x7fff813f4438,body = 0x47fd038,
flags = -2126560200) eval.c:6308
#85 0x0000000000427ccf eval_fcall(self = 74975160,node = 0x48b9788)at eval.c 74975160,mid = 149601,argc = 1,argv = 0x7fff813f4430,scope = 1,self = 74975160) :3396 $ b $##86 eval_iter(self = 74975160,node = 0x48b7578)处的eval.c:3200
#87 0x0000000000426cdb在rb_call0(klass = 75513520,recv = 74975160,id = 149617,oid = ,argc = 0,argv = 0x7fff813f4a20,body = 0x47fcf98,
flags = -2126558688)at eval.c:6211
#88 0x00000000004在eval.c:6308
#89 rb_call(klass = 75513520,recv = 74975160,mid = 149617,argc = 0,argv = 0x7fff813f4a20,scope = 3,self = 6)中的1c733 rb_call_super(argc = (self =,node =)中的eval.c:3441
#91处的eval_super(self = 0,node = 0x483ac08)处的argv =)at eval.c:6476
#90 0x00000000004193b5在eval.c:3291
#93中的eval_ensure(self = 74975160,node = 0x483aa28)处的eval.c:9363
#92 0x00000000004272f3 rb_yield_0(val = 74960080,self = 74975160,klass =在eval.c:9038
#95 0x000000000041bf12处的proc_invoke(proc =,args =,self =,klass = 74972880)中的eval.c:5239
#94 0x000000000041b416处,flags =,avalue = 2)在eval.c:6092
#96 0x000000000041c733 in rb_call0(klass = 74972880,recv = 74975160,id = 149617,oid =,argc =,
argv =,body = 0x477fe08,flags = 0) eval.c:6308
#97 0x0000000000427ccf中的rb_call(klass = 74972880,recv = 74975160,mid = 149617,argc = 0,argv = 0x0,scope = 1,self = 74975160) eval.c:3200
#99中的eval_iter(self = 74975160,node = 0x48b6ad8)处的eval.c:3396
#98 0x0000000000426cdb(val = 74960600,self = eval.c:5239
#100 0x000000000041958c在eval.c:3858
#101中的rb_eval(self = 75623080,node = 0x48a6c50)中的klass =,flags =,avalue = 0)0x0000000000141c42b eval.c:6211
#102处的rb_call0(klass = 75623960,recv = 75623080,id = 149625,oid =,argc = 0,argv = 0x7fff813f5d70,body = 0x481ed00,
flags = -2126553744)在eval.call(self = 1)中的eval.c:6308
#103处使用rb_call(klass = 75623960,recv = 75623080,mid = 149625,argc = 2,argv = 0x7fff813f5d60,scope = 0,self = 74975160)中的0x000000000041c733。 eval.c:3200
#105中的eval_iter(self = 74975160,node = 0x48b6a38)处的eval.c:3381 $ b $##104 0x000000426cdb(klass = 75513520, recv = 74975160,id = 148761,oid =,argc = 0,argv = 0x7fff813f6338,body = 0x47fcf48,
flags = -2126552264)at eval在eval.c:6308 $ b处使用rb_call(klass = 75513520,recv = 74975160,mid = 148761,argc = 1,argv = 0x7fff813f6330,scope = 0,self = 22049440)中的.c:6211
#106 0x000000000041c733在eval.c:3291
处的eval.c:(self = 22049440,node = 0x492cbc0)中,eval.c:3381
#108 0x00000000004272f3中的eval_call(self = 22049440,node = 0x492d138)中的$ b#107 0x0000000000427a38 #109 0x0000000041958c在eval.c中:rb_eval(self = 22049440,node = 0x492cb48):3858
---键入继续,或q退出---
#110 0x000000000042b27c in eval(self = ,rb_f_eval(argc =,argv =,self = 22049440)中的src =,scope = 4,file = 0x4a4426(eval),line =)
在eval.c:6711
#111 0x000000000042b69c at eval.c:6832
#112 0x000000000041c555 in rb_call0(klass = 22059320,recv = 22049440,id = 4097,oid =,argc =,
argv =,body = 0x1505e00,flags = 0)at eval.c:6308
#113 0x000000000041c733在rb_call(klass = 22059320,recv = 22049440,mid = 4097,argc = 1,argv = 0x7fff813f6b00,scope = 1,self = 22049440) b $ b#114 0x0000000000427 eval.c:3396
#115 0x000000000042a2f6在eval.cfall(self = 22049440,node = 0x1b17be0)中的rf_load(fname = 28463080,wrap =)时eval.c:7199 $ b $ (fname = 21909440,safe =)at eval.c:7573
#117 0x000000000041c555 in rb_call0(klass = 22059360,recv = 22049440,id = 13521,oid =,argc =,
argv =,body rb_call(klass = 22059360,recv = 22049440,mid = 13521,argc = 1,argv = 0x7fff813f7200,scope = 1,self = 22049440)中eval.c:6058
#118 0x000000000041c733处的eval.c:6058 = 0x14e92f0,flags = 0) )在eval.c:6308
#119 0x00000000427ccf eval_fcall(self = 22049440,node = 0x18c1918)at eval.c:3396
#120 0x0000000042710c在eval_rescue(self = 22049440,node = 0x18c1300)at eval.c:3991
#122中的rb_call0(klass = 22059320,recv = 22049440,id = 10105)中的rb_eval(self = 22049440,node = 0x18c1300)中的eval.c:3237
#121 0x0000000000419c43 ,oid =,argc = 0,argv = 0x7fff813f7728,body = 0x18c0e28,
flags = -2126547160)at eval.c:6211
#123 0x0000000 eval.cf中的eval.c:6308
#124 0x00000000427ccf中的00041c733(klass = 22059320,recv = 22049440,mid = 10105,argc = 1,argv = 0x7fff813f7720,scope = 1,self = 22049440) eval.c:3396
#125 0x00000000429c69在eval.c中的ruby_exec_internal():1685
#126 0x00000000429cb5在eval.c中的ruby_exec()中:1705
在main.c中为main(argc = 10,argv = 0x7fff813f7a28,envp =)的eval.c:1715
#128 0x00000000004106c1的ruby_run()中的#127 0x0000000000429ce5:48


解决方案

当您看到如下所示的内容:
rb_call(klass = 37665480,recv = 132610480, mid = 104367,...



你可以弄清楚Ruby代码在做什么。我有一篇关于这方面的博客文章:

http://seclib.blogspot.com/2011/08/inspect-ruby-process-from-gdb.html


Note: I'm using a segfault that I encountered whilst using the libxml-ruby gem to illustrate the question, but I've since fixed my problem with said gem. What this question is really about is viewing the Ruby backtrace (i.e. the same thing the interpreter prints when Ruby code fails to handle an exception) from gdb with a corefile the interpreter itself encounters a segmentation fault.

I'm getting an odd segfault while generating an XML document, of all things:

/railsroot/vendor/isolated/ruby-1.8/gems/libxml-ruby-1.1.2/lib/libxml/node.rb:123: [BUG] Segmentation fault
ruby 1.8.7 (2011-02-18 patchlevel 334) [x86_64-linux], MBARI 0x6770, Ruby Enterprise Edition 2011.03

Aborted

Update 1: This segfaults under vanilla Ruby (MRI) as well.

I've turned on corefiles and taken a look at the backtrace in gdb (see the end of the question). I can see where the interpreter crashing, and Googling for this leads to lots of promising results. What I'd like to see, in addition to the interpreter backtrace, is the backtrace in the Ruby code itself (i.e. the backtrace from the interpreter's point of view).

I'm hoping that loading the core in gdb will allow me to call some interpreter function that prints out the stack of the interpreted code.

Any ideas?

Here's the core and backtrace, for the curious:

: foo@bar; ulimit -c unlimited
: foo@bar; RAILS_ENV=production ./script/runner script/feeds/batchfeed.rb --config config/feeds/$feed.yml --timer /tmp/$feed.timer --gzip --output /tmp/$feed.xml.gz
/railsroot/vendor/isolated/ruby-1.8/gems/libxml-ruby-1.1.2/lib/libxml/node.rb:123: [BUG] Segmentation fault
ruby 1.8.7 (2011-02-18 patchlevel 334) [x86_64-linux], MBARI 0x6770, Ruby Enterprise Edition 2011.03

Aborted
: foo@bar; ls -l core
-rw------- 1 rails rails 145301504 2011-03-04 08:34 core
: foo@bar; gdb `which ruby` core
GNU gdb (GDB) 7.1-ubuntu
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
(gdb) bt
#0  0x00007f041c095a75 in raise () from /lib/libc.so.6
#1  0x00007f041c0995c0 in abort () from /lib/libc.so.6
#2  0x00000000004a3d59 in rb_bug (fmt=0x4bfc60 "Segmentation fault") at error.c:213
#3  0x0000000000477e75 in sigsegv (sig=) at signal.c:633
#4  
#5  0x000000000047ae79 in st_lookup (table=0x7f041867eda0, key=3031, value=0x7fff813ee288) at st.c:250
#6  0x0000000000413ddf in search_method (klass=132608000, id=3031, origin=0x7fff813ee2c8) at eval.c:510
#7  0x0000000000413e67 in rb_get_method_body (klassp=0x7fff813ee318, idp=0x7fff813ee320, noexp=0x7fff813ee32c) at eval.c:531
#8  0x000000000041c66b in rb_call (klass=132608000, recv=132608200, mid=3031, argc=0, argv=0x0, scope=0, self=132610480) at eval.c:6282
#9  0x0000000000427a38 in eval_call (self=132610480, node=0x1df0308) at eval.c:3381
#10 0x000000000041964c in rb_eval (self=132610480, node=0x1df02e0) at eval.c:4015
#11 0x000000000041c42b in rb_call0 (klass=37665480, recv=132610480, id=104367, oid=, argc=0, argv=0x0, body=0x1d42f28, flags=0)
    at eval.c:6211
#12 0x000000000041c733 in rb_call (klass=37665480, recv=132610480, mid=104367, argc=0, argv=0x0, scope=0, self=74960600) at eval.c:6308
#13 0x0000000000427a38 in eval_call (self=74960600, node=0x488f000) at eval.c:3381
#14 0x0000000000419bc4 in rb_eval (self=74960600, node=0x488efd8) at eval.c:3910
#15 0x000000000041c42b in rb_call0 (klass=75623080, recv=74960600, id=75649, oid=, argc=0, argv=0x7fff813eead0, body=0x481e5d0, 
    flags=-2126583088) at eval.c:6211
#16 0x000000000041c733 in rb_call (klass=75623080, recv=74960600, mid=75649, argc=2, argv=0x7fff813eeac0, scope=1, self=74960600) at eval.c:6308
#17 0x0000000000427ccf in eval_fcall (self=74960600, node=0x48915d0) at eval.c:3396
#18 0x0000000000426cdb in eval_iter (self=74960600, node=0x4890fb8) at eval.c:3200
#19 0x00000000004279ef in eval_call (self=74960600, node=0x4890f68) at eval.c:3376
#20 0x000000000041aacb in rb_yield_0 (val=132724680, self=74960600, klass=, flags=, avalue=0) at eval.c:5239
#21 0x000000000048fd01 in rb_ary_each (ary=132624640) at array.c:1261
#22 0x000000000041c555 in rb_call0 (klass=21994320, recv=132624640, id=4001, oid=, argc=, 
    argv=, body=0x14f9308, flags=0) at eval.c:6058
#23 0x000000000041c733 in rb_call (klass=21994320, recv=132624640, mid=4001, argc=0, argv=0x0, scope=0, self=74960600) at eval.c:6308
#24 0x0000000000427a38 in eval_call (self=74960600, node=0x48921b0) at eval.c:3381
#25 0x0000000000426cdb in eval_iter (self=74960600, node=0x4890ef0) at eval.c:3200
#26 0x000000000041aacb in rb_yield_0 (val=132612040, self=74960600, klass=, flags=, avalue=0) at eval.c:5239
#27 0x000000000041958c in rb_eval (self=74960600, node=0x488f0f0) at eval.c:3858
#28 0x000000000041c42b in rb_call0 (klass=75623080, recv=74960600, id=75649, oid=, argc=0, argv=0x7fff813efb48, body=0x481e5d0, 
    flags=-2126578872) at eval.c:6211
#29 0x000000000041c733 in rb_call (klass=75623080, recv=74960600, mid=75649, argc=1, argv=0x7fff813efb40, scope=1, self=74960600) at eval.c:6308
#30 0x0000000000427ccf in eval_fcall (self=74960600, node=0x4893830) at eval.c:3396
#31 0x0000000000426cdb in eval_iter (self=74960600, node=0x4890e78) at eval.c:3200
#32 0x000000000041c42b in rb_call0 (klass=75623080, recv=74960600, id=149753, oid=, argc=0, argv=0x7fff813f0138, body=0x481e710, 
    flags=-2126577352) at eval.c:6211
#33 0x000000000041c733 in rb_call (klass=75623080, recv=74960600, mid=149753, argc=3, argv=0x7fff813f0120, scope=1, self=74960600) at eval.c:6308
#34 0x0000000000427ccf in eval_fcall (self=74960600, node=0x4893cb8) at eval.c:3396
#35 0x00000000004279ef in eval_call (self=74960600, node=0x4893c68) at eval.c:3376
#36 0x000000000041aacb in rb_yield_0 (val=132614040, self=74960600, klass=, flags=, avalue=0) at eval.c:5239
#37 0x000000000041958c in rb_eval (self=74960600, node=0x488f0f0) at eval.c:3858
#38 0x000000000041c42b in rb_call0 (klass=75623080, recv=74960600, id=75649, oid=, argc=0, argv=0x7fff813f07e0, body=0x481e5d0, 
    flags=-2126575648) at eval.c:6211
#39 0x000000000041c733 in rb_call (klass=75623080, recv=74960600, mid=75649, argc=2, argv=0x7fff813f07d0, scope=1, self=74960600) at eval.c:6308
#40 0x0000000000427ccf in eval_fcall (self=74960600, node=0x488e7b8) at eval.c:3396
#41 0x000000000042687c in block_pass (self=, node=) at eval.c:9336
#42 0x000000000041c42b in rb_call0 (klass=75623080, recv=74960600, id=95641, oid=, argc=0, argv=0x7fff813f0dc8, body=0x481e580, 
    flags=-2126574136) at eval.c:6211
#43 0x000000000041c733 in rb_call (klass=75623080, recv=74960600, mid=95641, argc=1, argv=0x7fff813f0dc0, scope=1, self=74960600) at eval.c:6308
#44 0x0000000000427ccf in eval_fcall (self=74960600, node=0x4895360) at eval.c:3396
#45 0x0000000000426cdb in eval_iter (self=74960600, node=0x4893bc8) at eval.c:3200
#46 0x00000000004279ef in eval_call (self=74960600, node=0x4893b78) at eval.c:3376
#47 0x000000000041aacb in rb_yield_0 (val=132618280, self=74960600, klass=, flags=, avalue=2) at eval.c:5239
#48 0x000000000041aacb in rb_yield_0 (val=70241560, self=74960600, klass=, flags=, avalue=0) at eval.c:5239
#49 0x000000000048fd01 in rb_ary_each (ary=132621000) at array.c:1261
#50 0x000000000041c555 in rb_call0 (klass=21994320, recv=132621000, id=4001, oid=, argc=, 
    argv=, body=0x14f9308, flags=0) at eval.c:6058
#51 0x000000000041c733 in rb_call (klass=21994320, recv=132621000, mid=4001, argc=0, argv=0x0, scope=0, self=74960600) at eval.c:6308
#52 0x0000000000427a38 in eval_call (self=74960600, node=0x48906d0) at eval.c:3381
#53 0x0000000000426cdb in eval_iter (self=74960600, node=0x488ffc8) at eval.c:3200
#54 0x000000000041c42b in rb_call0 (klass=75623080, recv=74960600, id=149745, oid=, argc=0, argv=0x7fff813f1e18, body=0x481e6c0, 
    flags=-2126569960) at eval.c:6211
---Type  to continue, or q  to quit---
#55 0x000000000041c733 in rb_call (klass=75623080, recv=74960600, mid=149745, argc=1, argv=0x7fff813f1e10, scope=1, self=74960600) at eval.c:6308
#56 0x0000000000427ccf in eval_fcall (self=74960600, node=0x4898470) at eval.c:3396
#57 0x0000000000426cdb in eval_iter (self=74960600, node=0x4893ad8) at eval.c:3200
#58 0x000000000041c42b in rb_call0 (klass=75623080, recv=74960600, id=149737, oid=, argc=0, argv=0x7fff813f2400, body=0x481e760, 
    flags=-2126568448) at eval.c:6211
#59 0x000000000041c733 in rb_call (klass=75623080, recv=74960600, mid=149737, argc=2, argv=0x7fff813f23f0, scope=1, self=74960600) at eval.c:6308
#60 0x0000000000427ccf in eval_fcall (self=74960600, node=0x48988a8) at eval.c:3396
#61 0x000000000041958c in rb_eval (self=74960600, node=0x4898858) at eval.c:3858
#62 0x000000000041c42b in rb_call0 (klass=75623080, recv=74960600, id=149633, oid=, argc=0, argv=0x7fff813f27f8, body=0x481e7b0, 
    flags=-2126567432) at eval.c:6211
#63 0x000000000041c733 in rb_call (klass=75623080, recv=74960600, mid=149633, argc=1, argv=0x7fff813f27f0, scope=3, self=6) at eval.c:6308
#64 0x00000000004191ec in rb_call_super (argc=, argv=) at eval.c:6476
#65 0x00000000004193b5 in eval_super (self=0, node=0x483ac08) at eval.c:3441
#66 0x00000000004267cc in block_pass (self=, node=) at eval.c:9316
#67 0x00000000004272f3 in eval_ensure (self=74960600, node=0x483aa28) at eval.c:3291
#68 0x000000000041aacb in rb_yield_0 (val=132629640, self=74960600, klass=, flags=, avalue=2) at eval.c:5239
#69 0x000000000041b416 in proc_invoke (proc=, args=, self=, klass=74960440) at eval.c:9038
#70 0x000000000041bf12 in rb_call0 (klass=74960440, recv=74960600, id=149633, oid=, argc=, 
    argv=, body=0x477cd70, flags=0) at eval.c:6092
#71 0x000000000041c733 in rb_call (klass=74960440, recv=74960600, mid=149633, argc=1, argv=0x7fff813f3340, scope=0, self=74975160) at eval.c:6308
#72 0x0000000000427a38 in eval_call (self=74975160, node=0x48b6b50) at eval.c:3381
#73 0x000000000041aacb in rb_yield_0 (val=135232920, self=74975160, klass=, flags=, avalue=0) at eval.c:5239
#74 0x000000000041aacb in rb_yield_0 (val=138467880, self=74975160, klass=, flags=, avalue=0) at eval.c:5239
#75 0x000000000041aacb in rb_yield_0 (val=138467880, self=74975160, klass=, flags=, avalue=0) at eval.c:5239
#76 0x000000000048fd01 in rb_ary_each (ary=138491800) at array.c:1261
#77 0x000000000041c555 in rb_call0 (klass=21994320, recv=138491800, id=4001, oid=, argc=, 
    argv=, body=0x14f9308, flags=0) at eval.c:6058
#78 0x000000000041c733 in rb_call (klass=21994320, recv=138491800, mid=4001, argc=0, argv=0x0, scope=0, self=74975160) at eval.c:6308
#79 0x0000000000427a38 in eval_call (self=74975160, node=0x48bb808) at eval.c:3381
#80 0x0000000000426cdb in eval_iter (self=74975160, node=0x48bb0b0) at eval.c:3200
#81 0x000000000041958c in rb_eval (self=74975160, node=0x48bb038) at eval.c:3858
#82 0x00000000004261b7 in eval_while (self=74975160, node=0x48bab88) at eval.c:3118
#83 0x000000000041c42b in rb_call0 (klass=75513520, recv=74975160, id=149601, oid=, argc=0, argv=0x7fff813f4438, body=0x47fd038, 
    flags=-2126560200) at eval.c:6211
#84 0x000000000041c733 in rb_call (klass=75513520, recv=74975160, mid=149601, argc=1, argv=0x7fff813f4430, scope=1, self=74975160) at eval.c:6308
#85 0x0000000000427ccf in eval_fcall (self=74975160, node=0x48b9788) at eval.c:3396
#86 0x0000000000426cdb in eval_iter (self=74975160, node=0x48b7578) at eval.c:3200
#87 0x000000000041c42b in rb_call0 (klass=75513520, recv=74975160, id=149617, oid=, argc=0, argv=0x7fff813f4a20, body=0x47fcf98, 
    flags=-2126558688) at eval.c:6211
#88 0x000000000041c733 in rb_call (klass=75513520, recv=74975160, mid=149617, argc=0, argv=0x7fff813f4a20, scope=3, self=6) at eval.c:6308
#89 0x00000000004191ec in rb_call_super (argc=, argv=) at eval.c:6476
#90 0x00000000004193b5 in eval_super (self=0, node=0x483ac08) at eval.c:3441
#91 0x00000000004266c1 in block_pass (self=, node=) at eval.c:9363
#92 0x00000000004272f3 in eval_ensure (self=74975160, node=0x483aa28) at eval.c:3291
#93 0x000000000041aacb in rb_yield_0 (val=74960080, self=74975160, klass=, flags=, avalue=2) at eval.c:5239
#94 0x000000000041b416 in proc_invoke (proc=, args=, self=, klass=74972880) at eval.c:9038
#95 0x000000000041bf12 in rb_call0 (klass=74972880, recv=74975160, id=149617, oid=, argc=, 
    argv=, body=0x477fe08, flags=0) at eval.c:6092
#96 0x000000000041c733 in rb_call (klass=74972880, recv=74975160, mid=149617, argc=0, argv=0x0, scope=1, self=74975160) at eval.c:6308
#97 0x0000000000427ccf in eval_fcall (self=74975160, node=0x48b6ab0) at eval.c:3396
#98 0x0000000000426cdb in eval_iter (self=74975160, node=0x48b6ad8) at eval.c:3200
#99 0x000000000041aacb in rb_yield_0 (val=74960600, self=74975160, klass=, flags=, avalue=0) at eval.c:5239
#100 0x000000000041958c in rb_eval (self=75623080, node=0x48a6c50) at eval.c:3858
#101 0x000000000041c42b in rb_call0 (klass=75623960, recv=75623080, id=149625, oid=, argc=0, argv=0x7fff813f5d70, body=0x481ed00, 
    flags=-2126553744) at eval.c:6211
#102 0x000000000041c733 in rb_call (klass=75623960, recv=75623080, mid=149625, argc=2, argv=0x7fff813f5d60, scope=0, self=74975160) at eval.c:6308
#103 0x0000000000427a38 in eval_call (self=74975160, node=0x48b6d80) at eval.c:3381
#104 0x0000000000426cdb in eval_iter (self=74975160, node=0x48b6a38) at eval.c:3200
#105 0x000000000041c42b in rb_call0 (klass=75513520, recv=74975160, id=148761, oid=, argc=0, argv=0x7fff813f6338, body=0x47fcf48, 
    flags=-2126552264) at eval.c:6211
#106 0x000000000041c733 in rb_call (klass=75513520, recv=74975160, mid=148761, argc=1, argv=0x7fff813f6330, scope=0, self=22049440) at eval.c:6308
#107 0x0000000000427a38 in eval_call (self=22049440, node=0x492d138) at eval.c:3381
#108 0x00000000004272f3 in eval_ensure (self=22049440, node=0x492cbc0) at eval.c:3291
#109 0x000000000041958c in rb_eval (self=22049440, node=0x492cb48) at eval.c:3858
---Type  to continue, or q  to quit---
#110 0x000000000042b27c in eval (self=, src=, scope=4, file=0x4a4426 "(eval)", line=)
    at eval.c:6711
#111 0x000000000042b69c in rb_f_eval (argc=, argv=, self=22049440) at eval.c:6832
#112 0x000000000041c555 in rb_call0 (klass=22059320, recv=22049440, id=4097, oid=, argc=, 
    argv=, body=0x1505e00, flags=0) at eval.c:6058
#113 0x000000000041c733 in rb_call (klass=22059320, recv=22049440, mid=4097, argc=1, argv=0x7fff813f6b00, scope=1, self=22049440) at eval.c:6308
#114 0x0000000000427ccf in eval_fcall (self=22049440, node=0x1b17be0) at eval.c:3396
#115 0x000000000042a2f6 in rb_load (fname=28463080, wrap=) at eval.c:7199
#116 0x000000000042aa9a in rb_require_safe (fname=21909440, safe=) at eval.c:7573
#117 0x000000000041c555 in rb_call0 (klass=22059360, recv=22049440, id=13521, oid=, argc=, 
    argv=, body=0x14e92f0, flags=0) at eval.c:6058
#118 0x000000000041c733 in rb_call (klass=22059360, recv=22049440, mid=13521, argc=1, argv=0x7fff813f7200, scope=1, self=22049440) at eval.c:6308
#119 0x0000000000427ccf in eval_fcall (self=22049440, node=0x18c1918) at eval.c:3396
#120 0x000000000042710c in eval_rescue (self=22049440, node=0x18c1300) at eval.c:3237
#121 0x0000000000419c43 in rb_eval (self=22049440, node=0x18c1300) at eval.c:3991
#122 0x000000000041c42b in rb_call0 (klass=22059320, recv=22049440, id=10105, oid=, argc=0, argv=0x7fff813f7728, body=0x18c0e28, 
    flags=-2126547160) at eval.c:6211
#123 0x000000000041c733 in rb_call (klass=22059320, recv=22049440, mid=10105, argc=1, argv=0x7fff813f7720, scope=1, self=22049440) at eval.c:6308
#124 0x0000000000427ccf in eval_fcall (self=22049440, node=0x14e4f70) at eval.c:3396
#125 0x0000000000429c69 in ruby_exec_internal () at eval.c:1685
#126 0x0000000000429cb5 in ruby_exec () at eval.c:1705
#127 0x0000000000429ce5 in ruby_run () at eval.c:1715
#128 0x00000000004106c1 in main (argc=10, argv=0x7fff813f7a28, envp=) at main.c:48

解决方案

When you see something like this: rb_call (klass=37665480, recv=132610480, mid=104367, ...

You can figure out what the ruby code is doing. I have a blog article on that:

http://seclib.blogspot.com/2011/08/inspect-ruby-process-from-gdb.html

这篇关于在Ruby解释器出现段错误之后,是否有可能从corefile获取Ruby回溯?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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