Bug 872908

Summary: yast yast: line 429: 2060 Illegal instruction
Product: [openSUSE] openSUSE Tumbleweed Reporter: Martin Pluskal <mpluskal>
Component: RubyAssignee: Ruby Devel <ruby-devel>
Status: RESOLVED FIXED QA Contact: E-mail List <qa-bugs>
Severity: Normal    
Priority: P5 - None CC: bjoernv, jengelh, lee_matheson, matz, mrueckert
Version: 13.2 Milestone 0   
Target Milestone: ---   
Hardware: i386   
OS: openSUSE 13.2   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Attachments: yast logs

Description Martin Pluskal 2014-04-10 08:02:41 UTC
On current factory (i386), executing yast fails:
# yast
/sbin/yast: line 429:  2060 Illegal instruction     $ybindir/y2base $module "$@" "$SELECTED_GUI" $Y2_GEOMETRY $Y2UI_ARGS

# /usr/lib/YaST2/bin/y2base
Illegal instruction

# gdb /usr/lib/YaST2/bin/y2base
# run 
run
Starting program: /usr/lib/YaST2/bin/y2base
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/libthread_db.so.1".

Program received signal SIGILL, Illegal instruction.
gc_before_sweep (objspace=objspace@entry=0x805c860) at gc.c:2862
2862    gc.c: No such file or directory.

# lscpu
lscpu
Architecture:          i686
CPU op-mode(s):        32-bit
Byte Order:            Little Endian
CPU(s):                1
On-line CPU(s) list:   0
Thread(s) per core:    1
Core(s) per socket:    1
Socket(s):             1
Vendor ID:             AuthenticAMD
CPU family:            6
Model:                 10
Model name:            AMD Athlon(tm) XP 3200+
Stepping:              0
CPU MHz:               2191.056
BogoMIPS:              4382.11
L1d cache:             64K
L1i cache:             64K
L2 cache:              512K
Comment 1 Lukas Ocilka 2014-04-10 14:48:06 UTC
It would be nice to have Yast logs
Comment 2 Martin Pluskal 2014-04-10 15:00:51 UTC
Created attachment 585863 [details]
yast logs

There does not seem to be anything after 2014-04-09 16:30:41
Comment 3 Martin Pluskal 2014-04-10 15:11:11 UTC
Seems that issue is somewhere else:
# ruby
Illegal instruction
Comment 4 Martin Pluskal 2014-09-19 11:54:07 UTC
Issue is still present with latest factory:

# gdb ruby
....
(gdb) run
Starting program: /usr/bin/ruby
Got object file from memory but can't read symbols: File truncated.
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/libthread_db.so.1".

Program received signal SIGILL, Illegal instruction.
gc_before_sweep (objspace=objspace@entry=0x804c6b8) at gc.c:2862
2862    gc.c: No such file or directory.
(gdb) bt
#0  gc_before_sweep (objspace=objspace@entry=0x804c6b8) at gc.c:2862
#1  0xb7dcee4b in gc_sweep (immediate_sweep=0, objspace=0x804c6b8) at gc.c:3065
#2  garbage_collect_body (objspace=objspace@entry=0x804c6b8, full_mark=<optimized out>, full_mark@entry=0, immediate_sweep=immediate_sweep@entry=0, reason=<optimized out>, reason@entry=256) at gc.c:5012
#3  0xb7dcff5f in heap_prepare_freepage (heap=0x804c6c0, objspace=0x804c6b8) at gc.c:1216
#4  heap_get_freeobj_from_next_freepage (heap=0x804c6c0, objspace=0x804c6b8) at gc.c:1234
#5  heap_get_freeobj (heap=0x804c6c0, objspace=0x804c6b8) at gc.c:1256
#6  newobj_of (klass=klass@entry=0, flags=flags@entry=40, v1=v1@entry=0, v2=v2@entry=0, v3=v3@entry=0) at gc.c:1300
#7  0xb7dd00e7 in rb_newobj_of (klass=0, flags=flags@entry=40) at gc.c:1353
#8  0xb7dd3960 in hash_alloc (klass=<optimized out>) at hash.c:280
#9  0xb7dd51d8 in rb_hash_new () at hash.c:300
#10 0xb7ed5f56 in Init_BareVM () at vm.c:2689
#11 0xb7db5953 in ruby_setup () at eval.c:54
#12 0xb7db6ae4 in ruby_init () at eval.c:75
#13 0x0804870e in ?? ()
#14 0xb7bbc993 in __libc_start_main (main=0x80486c0, argc=1, argv=0xbffff4f4, init=0x8048820 <__libc_csu_init>, fini=0x8048890 <__libc_csu_fini>, rtld_fini=0xb7fed660 <_dl_fini>, stack_end=0xbffff4ec) at libc-start.c:285
#15 0x0804874e in _start ()
(gdb) bt full
#0  gc_before_sweep (objspace=objspace@entry=0x804c6b8) at gc.c:2862
        heap = <optimized out>
#1  0xb7dcee4b in gc_sweep (immediate_sweep=0, objspace=0x804c6b8) at gc.c:3065
        page = <optimized out>
#2  garbage_collect_body (objspace=objspace@entry=0x804c6b8, full_mark=<optimized out>, full_mark@entry=0, immediate_sweep=immediate_sweep@entry=0, reason=<optimized out>, reason@entry=256) at gc.c:5012
No locals.
#3  0xb7dcff5f in heap_prepare_freepage (heap=0x804c6c0, objspace=0x804c6b8) at gc.c:1216
No locals.
#4  heap_get_freeobj_from_next_freepage (heap=0x804c6c0, objspace=0x804c6b8) at gc.c:1234
        page = 0x0
        p = <optimized out>
#5  heap_get_freeobj (heap=0x804c6c0, objspace=0x804c6b8) at gc.c:1256
        p = 0x0
#6  newobj_of (klass=klass@entry=0, flags=flags@entry=40, v1=v1@entry=0, v2=v2@entry=0, v3=v3@entry=0) at gc.c:1300
        objspace = 0x804c6b8
#7  0xb7dd00e7 in rb_newobj_of (klass=0, flags=flags@entry=40) at gc.c:1353
No locals.
#8  0xb7dd3960 in hash_alloc (klass=<optimized out>) at hash.c:280
        hash = <optimized out>
#9  0xb7dd51d8 in rb_hash_new () at hash.c:300
No locals.
#10 0xb7ed5f56 in Init_BareVM () at vm.c:2689
        vm = 0x804c060
        th = 0x804c408
#11 0xb7db5953 in ruby_setup () at eval.c:54
        initialized = 1
        state = 0
#12 0xb7db6ae4 in ruby_init () at eval.c:75
        state = <optimized out>
#13 0x0804870e in ?? ()
No symbol table info available.
#14 0xb7bbc993 in __libc_start_main (main=0x80486c0, argc=1, argv=0xbffff4f4, init=0x8048820 <__libc_csu_init>, fini=0x8048890 <__libc_csu_fini>, rtld_fini=0xb7fed660 <_dl_fini>, stack_end=0xbffff4ec) at libc-start.c:285
        result = <optimized out>
        unwind_buf = {cancel_jmp_buf = {{jmp_buf = {-1210798080, 0, 0, 0, -1771505243, 504536501}, mask_was_saved = 0}}, priv = {pad = {0x0, 0x0, 0x1, 0x804872d <_start>}, data = {prev = 0x0, cleanup = 0x0, canceltype = 1}}}
        not_first_call = <optimized out>
#15 0x0804874e in _start ()
No symbol table info available.
Comment 5 Marcus Rückert 2014-09-19 12:40:03 UTC
please paste the complete /proc/cpuinfo
Comment 8 Michael Matz 2014-09-22 14:43:05 UTC
Please show us the instruction that throws the SIGILL.  From inside gdb,
after SIGILL occurred do:

(gdb) disassemble $pc-32,$pc+32
...
(gdb) p $pc
Comment 9 Marcus Rückert 2014-09-22 14:49:31 UTC
JFYI: this happens because ruby configure checks if it can use SSE2 and our GCC supports it. -> ruby is build with SSE2 instructions.

(found out with your test host)
Comment 10 Martin Pluskal 2014-09-22 15:42:45 UTC
(In reply to Michael Matz from comment #8)
> Please show us the instruction that throws the SIGILL.  From inside gdb,
> after SIGILL occurred do:
> 
> (gdb) disassemble $pc-32,$pc+32
> ...
> (gdb) p $pc

Program received signal SIGILL, Illegal instruction.
gc_before_sweep (objspace=objspace@entry=0x804c6b8) at gc.c:2862
2862    gc.c: No such file or directory.
(gdb) disassemble $pc-32,$pc+32
Dump of assembler code from 0xb7dc7ff5 to 0xb7dc8035:
   0xb7dc7ff5 <gc_before_sweep+21>:     sub    $0x10,%esp
   0xb7dc7ff8 <gc_before_sweep+24>:     lea    0x672c(%ebx),%eax
   0xb7dc7ffe <gc_before_sweep+30>:     mov    (%eax),%eax
   0xb7dc8000 <gc_before_sweep+32>:     mov    0x370(%eax),%edx
   0xb7dc8006 <gc_before_sweep+38>:     test   %edx,%edx
   0xb7dc8008 <gc_before_sweep+40>:     je     0xb7dc8012 <gc_before_sweep+50>
   0xb7dc800a <gc_before_sweep+42>:     mov    %eax,(%esp)
   0xb7dc800d <gc_before_sweep+45>:     call   0xb7ec3590 <rb_sweep_method_entry>
   0xb7dc8012 <gc_before_sweep+50>:     mov    0x3c(%esi),%eax
=> 0xb7dc8015 <gc_before_sweep+53>:     movapd -0xb78d0(%ebx),%xmm1
   0xb7dc801d <gc_before_sweep+61>:     movsd  -0xb78f8(%ebx),%xmm2
   0xb7dc8025 <gc_before_sweep+69>:     add    0x20(%esi),%eax
   0xb7dc8028 <gc_before_sweep+72>:     movsd  -0xb38b8(%ebx),%xmm3
   0xb7dc8030 <gc_before_sweep+80>:     xorpd  %xmm4,%xmm4
   0xb7dc8034 <gc_before_sweep+84>:     movapd %xmm1,%xmm6
End of assembler dump.
(gdb) p $pc
$1 = (void (*)()) 0xb7dc8015 <gc_before_sweep+53>
Comment 11 Arvin Schnell 2014-09-26 17:19:06 UTC
*** Bug 898546 has been marked as a duplicate of this bug. ***
Comment 12 Jan Engelhardt 2014-10-11 11:24:17 UTC
The moment you see -msse in the build log (presuming a verbose make) should raise a hundred eyebrows. And that's the case for ruby2.1. What's really terrible is that ruby places its autodetected flags after CFLAGS - what a mess.
Comment 13 Marcus Rückert 2014-10-13 15:10:10 UTC
backported the fix for configure from trunk
Comment 14 Martin Pluskal 2014-10-15 12:07:48 UTC
Great, thanks a lot.
Comment 15 Lee Matheson 2014-11-09 07:34:35 UTC
I successfully installed openSUSE-13.2 on the same PC that had the http://bugzilla.opensuse.org/show_bug.cgi?id=898546 (32-bit installations fail with YaST error) and it appears the problem is fixed.  I did have to install with safe settings and I do not know if that is related or different.  But I was successful in the end with this install despite the old PC I am using not having SSE2 support (its an MSI KT3 Ultra motherboard, with an athlon 1100 cpu, and 2-GBytes of RAM).

This is another example of the fix applied in this bug report working. :-)

In many cases (boot and application execution) on this 32-bit install it does subjectively appear openSUSE executes faster with openSUSE-13.2 than it did with the older 12.3 on the same hardware.

Many thanks for applying this fix. I know it was a controversal decision - and the efforts here are VERY MUCH appreciated.