Ticket #558 (closed defect: fixed)

Opened 8 months ago

Last modified 7 months ago

find_unused_distfiles SEGF on line 140

Reported by: creidiki Owned by: rbrown
Priority: Sometime Milestone:
Component: bindings/ruby Version: 0.26.0_pre1
Keywords: Cc:
Blocked By: Blocking:
Distribution:

Description

find_unused_distfiles.rb segfaults on line 140 on some machines:

/usr/share/paludis/ruby/demos/find_unused_distfiles.rb:140: [BUG] Segmentation fault

Backtrace:

Program received signal SIGSEGV, Segmentation fault.
0x00007fcef03637f9 in rb_obj_is_kind_of (obj=140526774450240, c=140526773770440) at object.c:489
489	object.c: No such file or directory.
	in object.c
(gdb) bt
#0  0x00007fcef03637f9 in rb_obj_is_kind_of (obj=140526774450240, c=140526773770440) at object.c:489
#1  0x00007fcef0338dbd in rb_call0 (klass=140526774839840, recv=140526773770440, id=322, oid=322, argc=1, argv=0x7ffff8808978, body=0x7fcef07ed080, 
    flags=<value optimized out>) at eval.c:5847
#2  0x00007fcef03390d8 in rb_call (klass=140526774839840, recv=140526773770440, mid=322, argc=1, argv=0x7ffff8808978, scope=1, self=6) at eval.c:6094
#3  0x00007fcef0339315 in rb_funcall2 (recv=140526773770440, mid=7571824, argc=1, argv=0x7ffff8808978) at eval.c:6230
#4  0x00007fcef0334485 in rb_eval (self=140526774829880, n=<value optimized out>) at eval.c:3107
#5  0x00007fcef0338cf5 in rb_call0 (klass=140526774839880, recv=140526774829880, id=15105, oid=15105, argc=0, argv=0x7ffff8808ce0, body=0x7fcef0701ba8, 
    flags=<value optimized out>) at eval.c:5998
#6  0x00007fcef03390d8 in rb_call (klass=140526774839880, recv=140526774829880, mid=15105, argc=4, argv=0x7ffff8808ce0, scope=1, self=140526774829880)
    at eval.c:6094
#7  0x00007fcef0334753 in rb_eval (self=140526774829880, n=<value optimized out>) at eval.c:3488
#8  0x00007fcef0333757 in rb_yield_0 (val=140526774450240, self=140526774829880, klass=0, flags=0, avalue=0) at eval.c:5021
#9  0x00007fceef2535db in each (self=140526774438680) at dep_spec.cc:803
#10 0x00007fcef0338dbd in rb_call0 (klass=140526773770440, recv=140526774438680, id=3841, oid=3841, argc=0, argv=0x0, body=0x7fcef06e9800, 
    flags=<value optimized out>) at eval.c:5847
#11 0x00007fcef03390d8 in rb_call (klass=140526773770440, recv=140526774438680, mid=3841, argc=0, argv=0x0, scope=0, self=140526774829880) at eval.c:6094
#12 0x00007fcef03345fd in rb_eval (self=140526774829880, n=<value optimized out>) at eval.c:3473
#13 0x00007fcef0337c51 in rb_eval (self=140526774829880, n=<value optimized out>) at eval.c:3203
#14 0x00007fcef0338cf5 in rb_call0 (klass=140526774839880, recv=140526774829880, id=15105, oid=15105, argc=0, argv=0x7ffff880a170, body=0x7fcef0701ba8, 
    flags=<value optimized out>) at eval.c:5998
#15 0x00007fcef03390d8 in rb_call (klass=140526774839880, recv=140526774829880, mid=15105, argc=4, argv=0x7ffff880a170, scope=1, self=140526774829880)
    at eval.c:6094
#16 0x00007fcef0334753 in rb_eval (self=140526774829880, n=<value optimized out>) at eval.c:3488
#17 0x00007fcef0333757 in rb_yield_0 (val=140526774531960, self=140526774829880, klass=0, flags=0, avalue=0) at eval.c:5021
#18 0x00007fcef031cb13 in rb_ary_each (ary=140526774555720) at array.c:1138
#19 0x00007fcef0338dbd in rb_call0 (klass=140526774778280, recv=140526774555720, id=3841, oid=3841, argc=0, argv=0x0, body=0x7fcef07df160, 
    flags=<value optimized out>) at eval.c:5847
#20 0x00007fcef03390d8 in rb_call (klass=140526774778280, recv=140526774555720, mid=3841, argc=0, argv=0x0, scope=0, self=140526774829880) at eval.c:6094
#21 0x00007fcef03345fd in rb_eval (self=140526774829880, n=<value optimized out>) at eval.c:3473
#22 0x00007fcef0337c51 in rb_eval (self=140526774829880, n=<value optimized out>) at eval.c:3203
#23 0x00007fcef0345b75 in ruby_exec_internal () at eval.c:1634
#24 0x00007fcef0345bb5 in ruby_exec () at eval.c:1654
#25 0x00007fcef0345be0 in ruby_run () at eval.c:1664
#26 0x00000000004008c3 in main (argc=2, argv=0x7ffff880b5a8, envp=<value optimized out>) at main.c:48

Attachments

p3 (0.6 kB) - added by bobob0 7 months ago.
sample code producing the segfault
backtrace (1.3 kB) - added by bobob0 7 months ago.
backtrace of a typical run of the file "p3"

Change History

  Changed 8 months ago by ciaranm

My guess for this one was that the VALUE we're storing is getting GCed. But that's just a guess.

  Changed 7 months ago by creidiki

Works with GC off, so long as the stat calls to check file size and date are commented out.

Changed 7 months ago by bobob0

  • attachment p3 added

sample code producing the segfault

Changed 7 months ago by bobob0

backtrace of a typical run of the file "p3"

follow-up: ↓ 5   Changed 7 months ago by bobob0

On my machine/ruby/paludis, running p3 always crashes on $n == 2, and varying values for $i i hardcoded "x11-apps/xeyes" but any package having an AllDepSpec? as run depencies should do. Also, adding a GC.start somewhere in the loops removes the segfault. Maybe it happens when the GC trigger at a bad time, i don't know.

  Changed 7 months ago by bobob0

I forgot to add : iterating on all dependencies with value.each seems necessary, i couldn't get it to crash while iterating only on one dependency. It's all too sensitive to seemingly unrelated code :/ It might not segfault on someone else's machine

in reply to: ↑ 3   Changed 7 months ago by dleverton

  • status changed from new to closed
  • resolution set to fixed

Replying to bobob0:

On my machine/ruby/paludis, running p3 ...

Thanks, that helped. r4647

Note: See TracTickets for help on using tickets.