GCC 13 on Lunar exhibits AddressSanitizer/UndefinedBehaviorSanitizer bug that doesn't manifest elsewhere
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
gcc-13 (Ubuntu) |
Confirmed
|
Undecided
|
Unassigned |
Bug Description
When initializing a class with a data member with alignment `__attribute_
One-liner reproduction:
```
docker run ubuntu:23.04 bash -c 'apt-get update && apt-get install -y g++-13 && echo "struct Packet { int a = 0; int b __attribute_
```
```
foo.cpp:1:8: runtime error: member access within misaligned address 0x7f535a800020 for type 'struct Packet', which requires 64 byte alignment
0x7f535a800020: note: pointer points here
fe 7f 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
^
```
This also occurs if a more recent version, 13.1.0-
```
docker run ubuntu:23.04 bash -c 'apt-get update && apt-get install -y software-
```
The issue does not manifest on Fedora:
```
docker run fedora:38 bash -c 'yum -y update && yum -y install g++ libasan libubsan && echo "struct Packet { int a = 0; int b __attribute_
```
Or on Compiler Explorer: https:/
I suspect that an Ubuntu GCC patch is introducing the bug.
This issue is also likely not to be coming from Debian since the `docker run` reproduction doesn't occur when the image used is `debian:sid`