Bug 28569 - UBSAN error: libbacktrace/elf.c:3835:29:
Summary: UBSAN error: libbacktrace/elf.c:3835:29:
Status: RESOLVED MOVED
Alias: None
Product: binutils
Classification: Unclassified
Component: binutils (show other bugs)
Version: 2.38
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-11-09 14:11 UTC by Martin Liska
Modified: 2021-11-13 07:45 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:
Project(s) to access:
ssh public key:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Liska 2021-11-09 14:11:37 UTC
UBSAN error: /home/mliska/Programming/binutils-gdb/libbacktrace/elf.c:3835:29: 
The following fails when I build binutils with:
configure --build=x86_64-linux --disable-gdb --disable-gdbserver --enable-obsolete --target=aarch64-elf CFLAGS="-g -O2 -fsanitize=address,undefined -Wno-error" CXXLAGS="-g -O2 -fsanitize=address,undefined -Wno-error" LDFLAGS="-ldl"
Target: aarch64-elf
FAIL: symver symver14
Executing on host: sh -c {../as-new   /home/mliska/Programming/binutils-gdb/gas/testsuite/gas/symver/symver15.s 2>&1}  /dev/null dump.out (timeout = 300)
/home/mliska/Programming/binutils-gdb/libbacktrace/elf.c:3835:29: runtime error: left shift of 251 by 24 places cannot be represented in type 'int'
Comment 1 Martin Liska 2021-11-09 14:14:13 UTC
Similarly here:

UBSAN error: /home/mliska/Programming/binutils-gdb/libbacktrace/elf.c:3894:29: 
The following fails when I build binutils with:
configure --build=x86_64-linux --disable-gdb --disable-gdbserver --enable-obsolete --target=aarch64-elf CFLAGS="-g -O2 -fsanitize=address,undefined -Wno-error" CXXLAGS="-g -O2 -fsanitize=address,undefined -Wno-error" LDFLAGS="-ldl"
Target: aarch64-elf
FAIL: symver symver14
Executing on host: sh -c {../as-new   /home/mliska/Programming/binutils-gdb/gas/testsuite/gas/symver/symver15.s 2>&1}  /dev/null dump.out (timeout = 300)
/home/mliska/Programming/binutils-gdb/libbacktrace/elf.c:3894:29: runtime error: left shift of 182 by 24 places cannot be represented in type 'int'
Comment 2 Alan Modra 2021-11-09 21:43:45 UTC
libbacktrace belongs to the gcc project.  Please report bugs there.
Comment 3 Martin Liska 2021-11-10 10:29:07 UTC
Oh, you are right, moved here: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103167.
Comment 4 Martin Liska 2021-11-12 14:10:06 UTC
(In reply to Alan Modra from comment #2)
> libbacktrace belongs to the gcc project.  Please report bugs there.

Fixed in gcc project, Alan, can you please sync it to binutils?
Comment 5 Alan Modra 2021-11-13 00:17:12 UTC
OK, I'll wait until your libbacktrace/ChangeLog entry appears.  Might as well have the directory consistent.
Comment 6 Martin Liska 2021-11-13 07:45:22 UTC
(In reply to Alan Modra from comment #5)
> OK, I'll wait until your libbacktrace/ChangeLog entry appears.  Might as
> well have the directory consistent.

Sure, it's there now:
https://gcc.gnu.org/git/?p=gcc.git;a=blobdiff;f=libbacktrace/ChangeLog;h=983f81672fb1d1c7e9fd93b5dca273acc57dae2a;hp=2c8a8a4de0e6eaff0b0359e614049fc6a52c8071;hb=af2852b9dc3b1d9ef20d72d20de5a2f7938b87b3;hpb=1bac7d31a1276f06bfa6cd3fae775b0ad7fec164