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 gdb/23326] make_output_phdrs mishandles inaccessible sections


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

Simon Marchi <simon.marchi at ericsson dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |simon.marchi at ericsson dot com

--- Comment #1 from Simon Marchi <simon.marchi at ericsson dot com> ---
GDB takes the mapping info from /proc/<pid>/smaps, which contains the RWX
information.  So it should be possible to use that information to conditionally
put the PF_R flag.

7f07cf9a0000-7f07cfb60000 r-xp 00000000 fd:01 395798                    
/lib/x86_64-linux-gnu/libc-2.23.so
Size:               1792 kB
KernelPageSize:        4 kB
MMUPageSize:           4 kB
Rss:                1088 kB
Pss:                  16 kB
Shared_Clean:       1088 kB
Shared_Dirty:          0 kB
Private_Clean:         0 kB
Private_Dirty:         0 kB
Referenced:         1088 kB
Anonymous:             0 kB
LazyFree:              0 kB
AnonHugePages:         0 kB
ShmemPmdMapped:        0 kB
Shared_Hugetlb:        0 kB
Private_Hugetlb:       0 kB
Swap:                  0 kB
SwapPss:               0 kB
Locked:               16 kB
VmFlags: rd ex mr mw me sd 
7f07cfb60000-7f07cfd60000 ---p 001c0000 fd:01 395798                    
/lib/x86_64-linux-gnu/libc-2.23.so
Size:               2048 kB
KernelPageSize:        4 kB
MMUPageSize:           4 kB
Rss:                   0 kB
Pss:                   0 kB
Shared_Clean:          0 kB
Shared_Dirty:          0 kB
Private_Clean:         0 kB
Private_Dirty:         0 kB
Referenced:            0 kB
Anonymous:             0 kB
LazyFree:              0 kB
AnonHugePages:         0 kB
ShmemPmdMapped:        0 kB
Shared_Hugetlb:        0 kB
Private_Hugetlb:       0 kB
Swap:                  0 kB
SwapPss:               0 kB
Locked:                0 kB
VmFlags: mr mw me sd 


The second section looks like the 2MB section you are talking about.

> This is a regression but I haven't checked how recent it is.  Older versions of gdb correctly handled inaccessible sections by writing phdrs for inaccessible sections, with PF_R correctly turned off and no image in the core.

I tested with versions as old as 7.1 (from 2010) and all PH are readable.

-- 
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]