public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug gdb/31578] New: GDB shows wrong offset value using 'info proc mapping'
@ 2024-03-29 13:24 toyaniv at gmail dot com
2024-03-29 13:39 ` [Bug gdb/31578] " tromey at sourceware dot org
` (7 more replies)
0 siblings, 8 replies; 9+ messages in thread
From: toyaniv at gmail dot com @ 2024-03-29 13:24 UTC (permalink / raw)
To: gdb-prs
https://sourceware.org/bugzilla/show_bug.cgi?id=31578
Bug ID: 31578
Summary: GDB shows wrong offset value using 'info proc mapping'
Product: gdb
Version: 12.1
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: gdb
Assignee: unassigned at sourceware dot org
Reporter: toyaniv at gmail dot com
Target Milestone: ---
Created attachment 15445
--> https://sourceware.org/bugzilla/attachment.cgi?id=15445&action=edit
info prov mapping with wrong offset on 4th row
solving hackthebox retired pwn challenge I found out that gdb show wrong
offset:
we can see on 3rd (start addr 0x562634049000) that offset is 0x8000 and size is
0x2000
but in 4th (start adr 0x56263404b000) it shows offset 0x9000 instead of
expected offset 0xa000 (0x8000+0x2000)
(gdb) info proc mapping
process 25
Mapped address spaces:
Start Addr End Addr Size Offset Perms objfile
0x562634041000 0x562634044000 0x3000 0x0 r--p
/home/ctf/device_control
0x562634044000 0x562634049000 0x5000 0x3000 r-xp
/home/ctf/device_control
0x562634049000 0x56263404b000 0x2000 0x8000 r--p
/home/ctf/device_control
0x56263404b000 0x56263404c000 0x1000 0x9000 r--p
/home/ctf/device_control
0x56263404c000 0x56263404d000 0x1000 0xa000 rw-p
/home/ctf/device_control
0x5626340c8000 0x56263412b000 0x63000 0x0 rw-p [heap]
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug gdb/31578] GDB shows wrong offset value using 'info proc mapping'
2024-03-29 13:24 [Bug gdb/31578] New: GDB shows wrong offset value using 'info proc mapping' toyaniv at gmail dot com
@ 2024-03-29 13:39 ` tromey at sourceware dot org
2024-03-29 13:49 ` toyaniv at gmail dot com
` (6 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: tromey at sourceware dot org @ 2024-03-29 13:39 UTC (permalink / raw)
To: gdb-prs
https://sourceware.org/bugzilla/show_bug.cgi?id=31578
Tom Tromey <tromey at sourceware dot org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |tromey at sourceware dot org
--- Comment #1 from Tom Tromey <tromey at sourceware dot org> ---
"info proc mapping" is just a very thin wrapper that
reads /proc/$pid/maps. Can you examine that file with "cat"?
I suspect there's no gdb problem here.
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug gdb/31578] GDB shows wrong offset value using 'info proc mapping'
2024-03-29 13:24 [Bug gdb/31578] New: GDB shows wrong offset value using 'info proc mapping' toyaniv at gmail dot com
2024-03-29 13:39 ` [Bug gdb/31578] " tromey at sourceware dot org
@ 2024-03-29 13:49 ` toyaniv at gmail dot com
2024-03-29 14:31 ` schwab@linux-m68k.org
` (5 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: toyaniv at gmail dot com @ 2024-03-29 13:49 UTC (permalink / raw)
To: gdb-prs
https://sourceware.org/bugzilla/show_bug.cgi?id=31578
--- Comment #2 from Yaniv Buta <toyaniv at gmail dot com> ---
(In reply to Tom Tromey from comment #1)
> "info proc mapping" is just a very thin wrapper that
> reads /proc/$pid/maps. Can you examine that file with "cat"?
> I suspect there's no gdb problem here.
Hi Tom
Thanks for replying that fast.
Indeed, below is that cat command and now it seems as OS bug...
Can you suggest what actually going on ?
I wonder what makes the offset be miscalculated that way by the OS ...
(gdb) shell
$ uname -a
Linux 0d142311433c 6.6.9-amd64 #1 SMP PREEMPT_DYNAMIC Kali 6.6.9-1kali1
(2024-01-08) x86_64 x86_64 x86_64 GNU/Linux
$ cat /proc/25/maps
562634041000-562634044000 r--p 00000000 08:01 1208457
/home/ctf/device_control
562634044000-562634049000 r-xp 00003000 08:01 1208457
/home/ctf/device_control
562634049000-56263404b000 r--p 00008000 08:01 1208457
/home/ctf/device_control
56263404b000-56263404c000 r--p 00009000 08:01 1208457
/home/ctf/device_control
56263404c000-56263404d000 rw-p 0000a000 08:01 1208457
/home/ctf/device_control
Thanks,
Yaniv
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug gdb/31578] GDB shows wrong offset value using 'info proc mapping'
2024-03-29 13:24 [Bug gdb/31578] New: GDB shows wrong offset value using 'info proc mapping' toyaniv at gmail dot com
2024-03-29 13:39 ` [Bug gdb/31578] " tromey at sourceware dot org
2024-03-29 13:49 ` toyaniv at gmail dot com
@ 2024-03-29 14:31 ` schwab@linux-m68k.org
2024-03-29 14:42 ` toyaniv at gmail dot com
` (4 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: schwab@linux-m68k.org @ 2024-03-29 14:31 UTC (permalink / raw)
To: gdb-prs
https://sourceware.org/bugzilla/show_bug.cgi?id=31578
--- Comment #3 from Andreas Schwab <schwab@linux-m68k.org> ---
Why do you think the offset is wrong?
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug gdb/31578] GDB shows wrong offset value using 'info proc mapping'
2024-03-29 13:24 [Bug gdb/31578] New: GDB shows wrong offset value using 'info proc mapping' toyaniv at gmail dot com
` (2 preceding siblings ...)
2024-03-29 14:31 ` schwab@linux-m68k.org
@ 2024-03-29 14:42 ` toyaniv at gmail dot com
2024-03-29 15:29 ` schwab@linux-m68k.org
` (3 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: toyaniv at gmail dot com @ 2024-03-29 14:42 UTC (permalink / raw)
To: gdb-prs
https://sourceware.org/bugzilla/show_bug.cgi?id=31578
--- Comment #4 from Yaniv Buta <toyaniv at gmail dot com> ---
(In reply to Andreas Schwab from comment #3)
> Why do you think the offset is wrong?
Hello Andreas
Check 4th row in the output display that I attached,
that's because 0x56263404b000- 0x562634041000 is 0xa000 and not 0x9000 as map
/procmap shows under offset column for this row.
(can't see any address overlap as for former rows)
Yaniv
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug gdb/31578] GDB shows wrong offset value using 'info proc mapping'
2024-03-29 13:24 [Bug gdb/31578] New: GDB shows wrong offset value using 'info proc mapping' toyaniv at gmail dot com
` (3 preceding siblings ...)
2024-03-29 14:42 ` toyaniv at gmail dot com
@ 2024-03-29 15:29 ` schwab@linux-m68k.org
2024-03-29 15:31 ` toyaniv at gmail dot com
` (2 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: schwab@linux-m68k.org @ 2024-03-29 15:29 UTC (permalink / raw)
To: gdb-prs
https://sourceware.org/bugzilla/show_bug.cgi?id=31578
--- Comment #5 from Andreas Schwab <schwab@linux-m68k.org> ---
The offset is a _file_ offset, not a vm offset.
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug gdb/31578] GDB shows wrong offset value using 'info proc mapping'
2024-03-29 13:24 [Bug gdb/31578] New: GDB shows wrong offset value using 'info proc mapping' toyaniv at gmail dot com
` (4 preceding siblings ...)
2024-03-29 15:29 ` schwab@linux-m68k.org
@ 2024-03-29 15:31 ` toyaniv at gmail dot com
2024-03-29 15:32 ` toyaniv at gmail dot com
2024-03-30 21:34 ` toyaniv at gmail dot com
7 siblings, 0 replies; 9+ messages in thread
From: toyaniv at gmail dot com @ 2024-03-29 15:31 UTC (permalink / raw)
To: gdb-prs
https://sourceware.org/bugzilla/show_bug.cgi?id=31578
Yaniv Buta <toyaniv at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Resolution|--- |NOTABUG
Status|UNCONFIRMED |RESOLVED
--- Comment #6 from Yaniv Buta <toyaniv at gmail dot com> ---
not a bug
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug gdb/31578] GDB shows wrong offset value using 'info proc mapping'
2024-03-29 13:24 [Bug gdb/31578] New: GDB shows wrong offset value using 'info proc mapping' toyaniv at gmail dot com
` (5 preceding siblings ...)
2024-03-29 15:31 ` toyaniv at gmail dot com
@ 2024-03-29 15:32 ` toyaniv at gmail dot com
2024-03-30 21:34 ` toyaniv at gmail dot com
7 siblings, 0 replies; 9+ messages in thread
From: toyaniv at gmail dot com @ 2024-03-29 15:32 UTC (permalink / raw)
To: gdb-prs
https://sourceware.org/bugzilla/show_bug.cgi?id=31578
--- Comment #7 from Yaniv Buta <toyaniv at gmail dot com> ---
(In reply to Andreas Schwab from comment #5)
> The offset is a _file_ offset, not a vm offset.
I closed it
thanks
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug gdb/31578] GDB shows wrong offset value using 'info proc mapping'
2024-03-29 13:24 [Bug gdb/31578] New: GDB shows wrong offset value using 'info proc mapping' toyaniv at gmail dot com
` (6 preceding siblings ...)
2024-03-29 15:32 ` toyaniv at gmail dot com
@ 2024-03-30 21:34 ` toyaniv at gmail dot com
7 siblings, 0 replies; 9+ messages in thread
From: toyaniv at gmail dot com @ 2024-03-30 21:34 UTC (permalink / raw)
To: gdb-prs
https://sourceware.org/bugzilla/show_bug.cgi?id=31578
Yaniv Buta <toyaniv at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|RESOLVED |CLOSED
--- Comment #8 from Yaniv Buta <toyaniv at gmail dot com> ---
closed
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2024-03-30 21:34 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-29 13:24 [Bug gdb/31578] New: GDB shows wrong offset value using 'info proc mapping' toyaniv at gmail dot com
2024-03-29 13:39 ` [Bug gdb/31578] " tromey at sourceware dot org
2024-03-29 13:49 ` toyaniv at gmail dot com
2024-03-29 14:31 ` schwab@linux-m68k.org
2024-03-29 14:42 ` toyaniv at gmail dot com
2024-03-29 15:29 ` schwab@linux-m68k.org
2024-03-29 15:31 ` toyaniv at gmail dot com
2024-03-29 15:32 ` toyaniv at gmail dot com
2024-03-30 21:34 ` toyaniv at gmail dot com
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).