NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: lib/59567 (dladdr(3) doesn't work properly especially when main executable is loaded at high memory address)



Synopsis: dladdr(3) doesn't work properly especially when main executable is loaded at high memory address

State-Changed-From-To: open->analyzed
State-Changed-By: riastradh%NetBSD.org@localhost
State-Changed-When: Sun, 03 Aug 2025 19:58:28 +0000
State-Changed-Why:
Problem has been analyzed.  Patch has been provided.

Need:
[ ] automatic test to exercise the bug
[ ] pullup-9, [ ] pullup-10, [ ] pullup-11

We appear to have absolutely no direct tests of dladdr(3).  Closest
we have is tests of libexecinfo's backtrace_symbols_fmt, which calls
dladdr(3), in tests/lib/libexecinfo.  We could add a variant
libexecinfo test with -fno-plt -Ttext-segment=<high> to trigger this,
but we should also have some direct tests of dladdr(3).

Rather than relying on -fno-plt -Ttext-segment=<high> and using
dladdr's search as a proxy, I wonder if obj->mapsize or obj->textsize
is exposed more directly anywhere else like dlinfo(3) RTLD_DI_LINKMAP
which we could compare to the PT_LOAD segment obtained by
dl_iterate_phdr(3).

(Writing down all the analogous linker arguments for each
architecture, and verifying they exercise the bug, sounds like a
pain!)





Home | Main Index | Thread Index | Old Index