public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug gdb/26196] New: gdb error message is unclear when attempting to load a file >2GB via gdbserver
@ 2020-07-02 13:37 david.spickett at linaro dot org
  2020-07-07 16:08 ` [Bug gdb/26196] " gbenson at redhat dot com
  2022-04-05 18:30 ` [Bug remote/26196] " tromey at sourceware dot org
  0 siblings, 2 replies; 3+ messages in thread
From: david.spickett at linaro dot org @ 2020-07-02 13:37 UTC (permalink / raw)
  To: gdb-prs

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

            Bug ID: 26196
           Summary: gdb error message is unclear when attempting to load a
                    file >2GB via gdbserver
           Product: gdb
           Version: HEAD
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: gdb
          Assignee: unassigned at sourceware dot org
          Reporter: david.spickett at linaro dot org
  Target Milestone: ---

This is related to https://sourceware.org/bugzilla/show_bug.cgi?id=23198, filed
as a new ticket for the gdb error message specifically.

I attempted to debug lldb by attaching gdbserver to it then connecting to that
with gdb. lldb references a shared library that contains its commands. This
library is >2GB in size when built in debug mode.

The error message gdb gives me when trying to load this is:
Reading
/work/open_source/lldb-cross-compile/build-host-debug/bin/../lib/liblldb.so.11git
from remote target...
Error while mapping shared library sections:
`target:/work/open_source/lldb-cross-compile/build-host-debug/bin/../lib/liblldb.so.11git':
not in executable format: file format not recognized

(gdb) info shared
>From                To                  Syms Read   Shared Object Library
<...>
                                        No         
/work/open_source/lldb-cross-compile/build-host-debug/bin/../lib/liblldb.so.11git

We can see from logging in gdbserver that the failure is because the offset
sent to pread is invalid when trying to get the first section header.
require_int in gdbserver is checking that the offset is not > 0x80000000.
getpkt ("vFile:pread:a,3fff,9ab473c8");  [no ack sent]
putpkt ("$F-1,16#37"); [noack mode] // 0x16 aka FILEIO_EINVAL

(https://sourceware.org/gdb/current/onlinedocs/gdb/Host-I_002fO-Packets.html)

The error message implies that the format is incorrect (although it earlier
read the ELF bytes) and I initially thought that gdbserver had read the symlink
as a real file (liblldb.so.11git links to the real .so). Which I'm not sure is
even possible but I tried to narrow it down from there.

I think this error message should say something like "<file>: file offset of X
is beyond limit of vFile:pread packet". (or bail a lot earlier once we see that
the size is >2GB)
The root issue would be the vFile packet itself but this is a niche use case
and you can workaround it by setting a sysroot to load the file from the local
machine. An improved error would make it clearer what you need to do.

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug gdb/26196] gdb error message is unclear when attempting to load a file >2GB via gdbserver
  2020-07-02 13:37 [Bug gdb/26196] New: gdb error message is unclear when attempting to load a file >2GB via gdbserver david.spickett at linaro dot org
@ 2020-07-07 16:08 ` gbenson at redhat dot com
  2022-04-05 18:30 ` [Bug remote/26196] " tromey at sourceware dot org
  1 sibling, 0 replies; 3+ messages in thread
From: gbenson at redhat dot com @ 2020-07-07 16:08 UTC (permalink / raw)
  To: gdb-prs

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

Gary Benson <gbenson at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |gbenson at redhat dot com

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug remote/26196] gdb error message is unclear when attempting to load a file >2GB via gdbserver
  2020-07-02 13:37 [Bug gdb/26196] New: gdb error message is unclear when attempting to load a file >2GB via gdbserver david.spickett at linaro dot org
  2020-07-07 16:08 ` [Bug gdb/26196] " gbenson at redhat dot com
@ 2022-04-05 18:30 ` tromey at sourceware dot org
  1 sibling, 0 replies; 3+ messages in thread
From: tromey at sourceware dot org @ 2022-04-05 18:30 UTC (permalink / raw)
  To: gdb-prs

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

Tom Tromey <tromey at sourceware dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |tromey at sourceware dot org
          Component|gdb                         |remote

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-04-05 18:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-02 13:37 [Bug gdb/26196] New: gdb error message is unclear when attempting to load a file >2GB via gdbserver david.spickett at linaro dot org
2020-07-07 16:08 ` [Bug gdb/26196] " gbenson at redhat dot com
2022-04-05 18:30 ` [Bug remote/26196] " tromey at sourceware dot org

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).