← Back to team overview

maria-developers team mailing list archive

Re: 0c37211c2a2: Fixed my_addr_resolve


Hi, Michael!

On Mar 28, Michael Widenius wrote:
> revision-id: 0c37211c2a2 (mariadb-10.5.2-517-g0c37211c2a2)
> parent(s): 555c4470130
> author: Michael Widenius <michael.widenius@xxxxxxxxx>
> committer: Michael Widenius <michael.widenius@xxxxxxxxx>
> timestamp: 2021-03-24 14:31:53 +0200
> message:
> Fixed my_addr_resolve
> At least on openSUSE Leap 15.1 one should not use the dli_fbase offset
> provided by dladdr() for addresses in the main program.
> Without this patch the stack traces from sf_report_leaked_memory()
> are not usable.

This is very strange. First, the whole purpose of this code is to use
dli_fbase offset for the main program. That's why it was added in the
first place. PIE binaries can be loaded at any address in memory and the
address you see with addr2line or nm or readelf is not the same address
you'll see in gdb or in a strack trace. We have to subtract the base
address first.

But may be openSUSE is different?
So, I built on openSUSE Leap and the stack trace was perfectly usable
without your patch. I tried both `kill -ABRT` and an artificially
introduced memory leak.

So I suspect there was some misunderstanding and the problem was
somewhere else (I cannot know what, of course, but just as an example -
the build was bad and recompilation fixed it).

VP of MariaDB Server Engineering
and security@xxxxxxxxxxx

Follow ups