Public bug reported:

Running latest Plucky s390x server image in QEMU KVM. Simple conversion
from _Decima32 to double triggers SIGILL. Same for _Decimal64 and
_Decimal128 types too.

Example code below:

cking@plucky-s390x:~$ cat decimal32.c 
#include <stdio.h>

int main(void)
{
        _Decimal32 v;
        double r;

        v = (_Decimal32)10.0 / (_Decimal32)2.0;
        r = (double)v;
        printf("%f\n", r);
        return 0;
}
cking@plucky-s390x:~$ gcc -g -O0 decimal32.c -o decimal32
cking@plucky-s390x:~$ gdb ./decimal32 
GNU gdb (Ubuntu 16.2-8ubuntu1) 16.2
Copyright (C) 2024 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 "s390x-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ./decimal32...
(gdb) run
Starting program: /home/cking/decimal32 

This GDB supports auto-downloading debuginfo from the following URLs:
  <https://debuginfod.ubuntu.com>
Enable debuginfod for this session? (y or [n]) y
Debuginfod has been enabled.
To make this setting permanent, add 'set debuginfod enabled on' to .gdbinit.
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/s390x-linux-gnu/libthread_db.so.1".

Program received signal SIGILL, Illegal instruction.
0x000002aa000007be in main () at decimal32.c:9
9               r = (double)v;
(gdb) disassemble
Dump of assembler code for function main:
   0x000002aa00000790 <+0>:     stmg    %r11,%r15,88(%r15)
   0x000002aa00000796 <+6>:     larl    %r13,0x2aa00000828
   0x000002aa0000079c <+12>:    lay     %r15,-176(%r15)
   0x000002aa000007a2 <+18>:    lgr     %r11,%r15
   0x000002aa000007a6 <+22>:    lde     %f0,0(%r13)
   0x000002aa000007ac <+28>:    ste     %f0,164(%r11)
   0x000002aa000007b0 <+32>:    lde     %f4,164(%r11)
   0x000002aa000007b6 <+38>:    iilf    %r0,17172481
   0x000002aa000007bc <+44>:    pfpo
=> 0x000002aa000007be <+46>:    std     %f0,168(%r11)
   0x000002aa000007c2 <+50>:    ld      %f0,168(%r11)
   0x000002aa000007c6 <+54>:    larl    %r2,0x2aa00000820
   0x000002aa000007cc <+60>:    brasl   %r14,0x2aa00000640 <printf@plt>
   0x000002aa000007d2 <+66>:    lhi     %r1,0
   0x000002aa000007d6 <+70>:    lgfr    %r1,%r1
   0x000002aa000007da <+74>:    lgr     %r2,%r1
   0x000002aa000007de <+78>:    lmg     %r11,%r15,264(%r11)
   0x000002aa000007e4 <+84>:    br      %r14
End of assembler dump.
(gdb) where
#0  0x000002aa000007be in main () at decimal32.c:9
(gdb)

** Affects: qemu (Ubuntu)
     Importance: High
         Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2107554

Title:
  qemu s390x SIGILL on simple _Decimal32 assignments (casts)

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/qemu/+bug/2107554/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to