public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug gdb/18168] New: "set write on" or "--write" corrupt the binary file
@ 2015-03-26 16:52 mail at cristos dot x25.pl
  2015-03-26 18:10 ` [Bug gdb/18168] " mail at cristos dot x25.pl
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: mail at cristos dot x25.pl @ 2015-03-26 16:52 UTC (permalink / raw)
  To: gdb-prs

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

            Bug ID: 18168
           Summary: "set write on" or "--write" corrupt the binary file
           Product: gdb
           Version: HEAD
            Status: NEW
          Severity: critical
          Priority: P2
         Component: gdb
          Assignee: unassigned at sourceware dot org
          Reporter: mail at cristos dot x25.pl

Created attachment 8213
  --> https://sourceware.org/bugzilla/attachment.cgi?id=8213&action=edit
the hexdumps of a binary file before and after executing commands in the
description

When enabling binary patching via "set write on" command or "--write" command
line switch, the exectuable loaded becomes corrupted. Try executing:

$ gdb --write a_binary_file
(gdb)quit
# ./a_binary_file
bash: ./a_binary_file: cannot execute binary file: Exec format error

Careful examination of the binary shows this:
# file ./a_binary_file
a_binary_file: data

# readelf -a ./a_binary_file
readelf: Error: Not an ELF file - it has the wrong magic bytes at the start

Attached are the hexdumps of the files before and after executing "gdb --write"
and quitting gdb immediately

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


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

end of thread, other threads:[~2022-05-13 10:08 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-26 16:52 [Bug gdb/18168] New: "set write on" or "--write" corrupt the binary file mail at cristos dot x25.pl
2015-03-26 18:10 ` [Bug gdb/18168] " mail at cristos dot x25.pl
2015-03-26 18:43 ` mail at cristos dot x25.pl
2015-07-26 20:34 ` jan.kratochvil at redhat dot com
2015-07-27 16:30 ` [Bug gdb/18168] "set write on" or "--write" corrupt the binary file - 7.9 regression jan.kratochvil at redhat dot com
2022-05-13 10:08 ` pedro at palves dot net

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