Public bug reported:

Some Eoan GCC (9) errors in my environment:

----
In file included from /usr/include/string.h:494,
                 from 
/home/inaddy/work/sources/ubuntu/qemu/include/qemu/osdep.h:101,
                 from 
/home/inaddy/work/sources/ubuntu/qemu/util/qemu-sockets.c:18:
In function ‘strncpy’,
    inlined from ‘unix_connect_saddr.isra.0’ at 
/home/inaddy/work/sources/ubuntu/qemu/util/qemu-sockets.c:925:5:
/usr/include/x86_64-linux-gnu/bits/string_fortified.h:106:10: error: 
‘__builtin_strncpy’ specified bound 108 equals destination size 
[-Werror=stringop-truncation]
  106 |   return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In function ‘strncpy’,
    inlined from ‘unix_listen_saddr.isra.0’ at 
/home/inaddy/work/sources/ubuntu/qemu/util/qemu-sockets.c:880:5:
/usr/include/x86_64-linux-gnu/bits/string_fortified.h:106:10: error: 
‘__builtin_strncpy’ specified bound 108 equals destination size 
[-Werror=stringop-truncation]
  106 |   return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
----

Fixed (and tested) by upstream commit:

commit 2d2023c3b99edb33ad4bb9791f70456ea1a1c049
Author: Daniel P. Berrangé <berra...@redhat.com>
Date:   Wed May 1 11:50:52 2019

    sockets: avoid string truncation warnings when copying UNIX path

----
/home/inaddy/work/sources/ubuntu/qemu/hw/display/qxl.c: In function 
‘init_qxl_ram’:
/home/inaddy/work/sources/ubuntu/qemu/hw/display/qxl.c:50:19: error: taking 
address of packed member of ‘struct QXLReleaseRing_ring_el’ may result in an 
unaligned pointer value [-Werror=address-of-packed-member]
   50 |             ret = &(r)->items[prod].el;                                 
\
      |                   ^~~~~~~~~~~~~~~~~~~~
/home/inaddy/work/sources/ubuntu/qemu/hw/display/qxl.c:429:5: note: in 
expansion of macro ‘SPICE_RING_PROD_ITEM’
  429 |     SPICE_RING_PROD_ITEM(d, &d->ram->release_ring, item);
      |     ^~~~~~~~~~~~~~~~~~~~
/home/inaddy/work/sources/ubuntu/qemu/hw/display/qxl.c: In function 
‘qxl_push_free_res’:
/home/inaddy/work/sources/ubuntu/qemu/hw/display/qxl.c:50:19: error: taking 
address of packed member of ‘struct QXLReleaseRing_ring_el’ may result in an 
unaligned pointer value [-Werror=address-of-packed-member]
   50 |             ret = &(r)->items[prod].el;                                 
\
      |                   ^~~~~~~~~~~~~~~~~~~~
/home/inaddy/work/sources/ubuntu/qemu/hw/display/qxl.c:762:5: note: in 
expansion of macro ‘SPICE_RING_PROD_ITEM’
  762 |     SPICE_RING_PROD_ITEM(d, ring, item);
      |     ^~~~~~~~~~~~~~~~~~~~
/home/inaddy/work/sources/ubuntu/qemu/hw/display/qxl.c: In function 
‘interface_release_resource’:
/home/inaddy/work/sources/ubuntu/qemu/hw/display/qxl.c:50:19: error: taking 
address of packed member of ‘struct QXLReleaseRing_ring_el’ may result in an 
unaligned pointer value [-Werror=address-of-packed-member]
   50 |             ret = &(r)->items[prod].el;                                 
\
      |                   ^~~~~~~~~~~~~~~~~~~~
/home/inaddy/work/sources/ubuntu/qemu/hw/display/qxl.c:795:5: note: in 
expansion of macro ‘SPICE_RING_PROD_ITEM’
  795 |     SPICE_RING_PROD_ITEM(qxl, ring, item);
----

Fixed (and tested) by upstream commit:

commit 94932c95c10400acd286fd768a6b411e7ebbec8f
Author: Daniel P. Berrangé <berra...@redhat.com>
Date:   Fri Apr 12 09:16:26 2019

    qxl: avoid unaligned pointer reads/writes

----

/home/inaddy/work/sources/ubuntu/qemu/hw/usb/hcd-xhci.c: In function 
‘usb_xhci_realize’:
/home/inaddy/work/sources/ubuntu/qemu/hw/usb/hcd-xhci.c:3339:66: error: ‘%d’ 
directive output may be truncated writing between 1 and 10 bytes into a region 
of size 5 [-Werror=format-truncation=]
 3339 |             snprintf(port->name, sizeof(port->name), "usb2 port #%d", 
i+1);
      |                                                                  ^~
/home/inaddy/work/sources/ubuntu/qemu/hw/usb/hcd-xhci.c:3339:54: note: 
directive argument in the range [1, 2147483647]
 3339 |             snprintf(port->name, sizeof(port->name), "usb2 port #%d", 
i+1);
      |                                                      ^~~~~~~~~~~~~~~
In file included from /usr/include/stdio.h:867,
                 from 
/home/inaddy/work/sources/ubuntu/qemu/include/qemu/osdep.h:99,
                 from 
/home/inaddy/work/sources/ubuntu/qemu/hw/usb/hcd-xhci.c:21:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:67:10: note: 
‘__builtin___snprintf_chk’ output between 13 and 22 bytes into a destination of 
size 16
   67 |   return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   68 |        __bos (__s), __fmt, __va_arg_pack ());

----

Fixed (and tested) by upstream commit:

commit ccb799313a5926a6aa49018bbc67fe6165fad7f3
Author: Daniel P. Berrangé <berra...@redhat.com>
Date:   Fri Apr 12 09:16:25 2019

    hw/usb: avoid format truncation warning when formatting port name

----

/home/inaddy/work/sources/ubuntu/qemu/hw/usb/dev-mtp.c: In function 
‘usb_mtp_write_metadata’:
/home/inaddy/work/sources/ubuntu/qemu/hw/usb/dev-mtp.c:1715:36: error: taking 
address of packed member of ‘struct <anonymous>’ may result in an unaligned 
pointer value [-Werror=address-of-packed-member]
 1715 |                             dataset->filename);

----

Fixed (and tested) by upstream commit:

commit 1259f27ec2113d34e54ee731aac5990d9606d9fa
Author: Daniel P. Berrangé <berra...@redhat.com>
Date:   Mon Apr 15 12:45:03 2019

    usb-mtp: fix alignment of access of ObjectInfo filename field

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

** Changed in: qemu (Ubuntu)
       Status: New => Confirmed

** Changed in: qemu (Ubuntu)
   Importance: Undecided => High

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

Title:
  QEMU Eoan FTBS in my machine (gcc9 + amd related ?)

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

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to