This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug libc/24967] jemalloc static linking causes runtime failure
- From: "fweimer at redhat dot com" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sourceware dot org
- Date: Thu, 05 Sep 2019 13:55:43 +0000
- Subject: [Bug libc/24967] jemalloc static linking causes runtime failure
- Auto-submitted: auto-generated
- References: <bug-24967-131@http.sourceware.org/bugzilla/>
https://sourceware.org/bugzilla/show_bug.cgi?id=24967
--- Comment #6 from Florian Weimer <fweimer at redhat dot com> ---
(In reply to Adhemerval Zanella from comment #5)
> (In reply to Florian Weimer from comment #3)
> > _dl_get_origin calls malloc, which in the case of jemalloc calls
> > clock_gettime, and the pointers to vDSO functions have not been initialized
> > yet at this point.
> >
> > We may need a minimal malloc for the static linking case as well and call
> > that until the binary has fully relocated itself.
>
> The {INTERNAL,INLINE}_VSYSCALL macros should detect if the value was not
> initialized and issue the syscall directly using INTERNAL_SYSCALL macro. The
> issue is the PTR_DEMANGLE is applied *before* checking the __vdso_* value,
> so an uninitialized __vdso_* will never be null after the demangle and in
> turn, the VSYSCALL macro will try to branch to a bogus address.
>
> A straightforward fix would be to demangle the __vdso_* after iff __vdso_*
> is not NULL as
Sorry, I don't think that's correct. The NULL check must come after
demangling, otherwise it will sporadically deliver incorrect results.
--
You are receiving this mail because:
You are on the CC list for the bug.