Crash while looking up strings in DT_STRTAB on mips64el
While belatedly upgrading to GNOME Shell 44 in Debian (after we stayed on 43 for a while due to the Debian 12 release), we're seeing test failures in all the perf-*
tests on the mips64el and mipsel architectures.
After doing some printf debugging, it seems that this is because maybe_add_rpath_introspection_paths()
assumes that the d_un.d_val
of the DT_STRTAB
is an absolute pointer to the string table, but on mips64el its numeric value is too small to be a reasonable pointer value. I suspect that on mips64el it's actually just an offset, which needs to be added to the base address of the executable (not available in _DYNAMIC
as far as I know) to get an actual pointer. This is a pattern I've seen in other low-level ELF code: it's ambiguous whether the d_un.d_val
is absolute, or relative to the base address (so the linked implementation tries to auto-detect by whether it's numerically greater or less than the base address).
I'm going to try to put together a merge request to just use an environment variable to propagate the search paths into the tests, which seems likely to be less error-prone.