https://bugs.kde.org/show_bug.cgi?id=452802

--- Comment #9 from Paul Floyd <pjfl...@wanadoo.fr> ---
I've gone with plan A. 

In ULong VG_(di_notify_mmap) I replaced the call to ML_(is_elf_object_file)
with a call to a new function ML_(check_elf_and_get_rw_loads) .

This is an ultra-stripped down version of ML_(read_elf_debug_info) that just
1. calls ML_(is_elf_object_file) and then
2. iterates over the PHDRs counting RW PT_LOADs

Also modified ML_(read_elf_debug_info) to count RW mappings, look for a second
one if the count is two and to use this second rw mapping if present for bss
data and got.plt

The good news is that this fixes all of the failures in varinfo5 like this

- Address 0x........ is 7 bytes inside data symbol "static_local_undef.XXXX"
+ Address 0x........ is in a rw- mapped file
/usr/home/paulf/scratch/valgrind/memcheck/tests/varinfo5so.so segment

(not reading debuginfo in shared libraries correctly)

The bad news is that I'm getting 3 new failures

< == 759 tests, 13 stderr failures, 0 stdout failures, 0 stderrB failures, 0
stdoutB failures, 0 post failures ==
---
> == 759 tests, 16 stderr failures, 0 stdout failures, 0 stderrB failures, 0 
> stdoutB failures, 0 post failures ==
2212a2220
> drd/tests/annotate_hb_race               (stderr)
2217a2226,2227
> none/tests/mmap_fcntl_bug                (stderr)
> none/tests/vgprintf                      (stderr)

--pid-- di_notify_mmap-0:
--pid-- di_notify_mmap-1: 0x200000-0x200fff r--
--pid-- di_notify_mmap-2: /usr/home/paulf/scratch/valgrind/none/tests/vgprintf
--pid-- di_notify_mmap-3: is_rx_map 0, is_rw_map 0, is_ro_map 1
--pid-- di_notify_mmap-4: noting details in DebugInfo* at 0x40247C220
--pid-- di_notify_mmap-6: no dinfo loaded
/usr/home/paulf/scratch/valgrind/none/tests/vgprintf (no rx or no rw mapping)
--pid-- di_notify_mmap-0:
--pid-- di_notify_mmap-1: 0x201000-0x201fff r-x
--pid-- di_notify_mmap-2: /usr/home/paulf/scratch/valgrind/none/tests/vgprintf
--pid-- di_notify_mmap-3: is_rx_map 1, is_rw_map 0, is_ro_map 0
--pid-- di_notify_mmap-4: noting details in DebugInfo* at 0x40247C220
--pid-- di_notify_mmap-6: no dinfo loaded
/usr/home/paulf/scratch/valgrind/none/tests/vgprintf (no rx or no rw mapping)
--pid-- di_notify_mmap-0:
--pid-- di_notify_mmap-1: 0x202000-0x203fff rw-
--pid-- di_notify_mmap-2: /usr/home/paulf/scratch/valgrind/none/tests/vgprintf
--pid-- di_notify_mmap-3: is_rx_map 0, is_rw_map 1, is_ro_map 0
--pid-- di_notify_mmap-4: noting details in DebugInfo* at 0x40247C220
--pid-- di_notify_mmap-6: no dinfo loaded
/usr/home/paulf/scratch/valgrind/none/tests/vgprintf (no rx or no rw mapping)

Here is the problem. Why no second notify_mmap for the other RW PT_LOAD?

--pid-- di_notify_mmap-0:
--pid-- di_notify_mmap-1: 0x4000000-0x4005fff r--
--pid-- di_notify_mmap-2: /libexec/ld-elf.so.1
--pid-- di_notify_mmap-3: is_rx_map 0, is_rw_map 0, is_ro_map 1
--pid-- di_notify_mmap-4: noting details in DebugInfo* at 0x40247C7C0
--pid-- di_notify_mmap-6: no dinfo loaded /libexec/ld-elf.so.1 (no rx or no rw
mapping)

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to