This is the mail archive of the gdb-prs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug compile/23672] New: compile command SEGVs computing target triplet pattern on non-Linux targets


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

            Bug ID: 23672
           Summary: compile command SEGVs computing target triplet pattern
                    on non-Linux targets
           Product: gdb
           Version: HEAD
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: compile
          Assignee: unassigned at sourceware dot org
          Reporter: sandra at codesourcery dot com
  Target Milestone: ---

The compile_to_object function in compile/compile.c has some logic to compute a
target triplet regexp from the gdbarch.  This is causing a SEGV on non-Linux
targets because osabi_triplet_regexp returns NULL for every other flavor of
osabi -- see the gdb_osabi_names[] definition in osabi.c.  The NULL pointer is
passed to the + string operator, which turns into the append method, which
tries to call strlen on the NULL pointer.

Even if an empty string were used instead of NULL, the resulting regexp would
be invalid.  Probably this should just default to the target triplet GDB was
configured for?

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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]