public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug gdb/26857] New: Runtime error when building with UBSan on ARM/Linux
@ 2020-11-09 18:39 simark at simark dot ca
  0 siblings, 0 replies; only message in thread
From: simark at simark dot ca @ 2020-11-09 18:39 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=26857

            Bug ID: 26857
           Summary: Runtime error when building with UBSan on ARM/Linux
           Product: gdb
           Version: HEAD
            Status: NEW
          Severity: normal
          Priority: P2
         Component: gdb
          Assignee: unassigned at sourceware dot org
          Reporter: simark at simark dot ca
  Target Milestone: ---

I'm building GDB on Ubuntu 18.04 on ARM, with:

./configure 'CC=ccache gcc' 'CXX=ccache g++' '--with-system-readline'
'--with-system-zlib' '--disable-binutils' '--disable-gold' '--disable-ld'
'--disable-gprof' '--disable-gas' '--with-expat=yes' 'CFLAGS=-g3 -O0
-fsanitize=address' 'CXXFLAGS=-g3 -O0 -fsanitize=address -D_GLIBCXX_DEBUG=1'
'LDFLAGS=-fuse-ld=gold -fsanitize=address' '--enable-ubsan'

Trying to run any command results in:

(gdb) help
top.c:564:64: runtime error: reference binding to misaligned address 0x018125e1
for type '<unknown>', which requires 2 byte alignment
0x018125e1: note: pointer points here
 0b d1 02  2d e9 f0 47 a2 b0 00 af  07 f1 88 03 23 f0 1f 03  87 4d 7d 44 a3 f1
60 04  a2 46 86 4b eb
              ^ 
This corresponds to the line:

    auto cleanup_if_error = make_scope_exit (bpstat_clear_actions);

The function bpstat_clear_actions is at address 0x18125e0.  The low-order bit
of the address just means it's a Thumb-mode function, but the address of the
code is really 0x18125e0.  0x18125e1 is not an error.  So I have the feeling
that the UBSan check is just confused by that and that this is a false
positive.

I am building with "gcc (Ubuntu/Linaro 7.5.0-3ubuntu1~18.04) 7.5.0".  Perhaps
it's indeed a bug and it's fixed in a later gcc release, but I can't test for
now.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-11-09 18:39 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-09 18:39 [Bug gdb/26857] New: Runtime error when building with UBSan on ARM/Linux simark at simark dot ca

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).