Skip to content

build-bench-env.sh: fix guarder's thread function lookup - #289

Open
derSteFfi wants to merge 1 commit into
daanx:masterfrom
derSteFfi:guarder_pthread_stub
Open

derSteFfi wants to merge 1 commit into
daanx:masterfrom
derSteFfi:guarder_pthread_stub

Conversation

@derSteFfi

Copy link
Copy Markdown
Contributor

Guarder resolves the real pthread_create with dlopen("libpthread.so.0", RTLD_NOLOAD). Since glibc 2.34 that library is an empty compatibility stub that nothing loads, so the handle comes back NULL and dlsym(NULL, name) searches the global scope from the front - which finds guarder's own interposer. Every pthread_create() then recursed into itself until the 128-entry thread table was full and guarder aborted with "maximum concurrent thread limit reached (128)"; an interposer mounted in front of libguarder.so counts 128 creations and no joins for "./mstress 4 50 25". That is the mstressN and rptestN failure in the gd jobs on ubuntu and fedora, and with the fallback both return to exit 0. RTLD_NEXT starts the search after libguarder.so, at the real libc; the same file already resolves malloc() and free() that way. larsonN-sized still fails, for a reason unrelated to the lookup.

Guarder resolves the real pthread_create with
dlopen("libpthread.so.0", RTLD_NOLOAD).  Since glibc 2.34 that library is an
empty compatibility stub that nothing loads, so the handle comes back NULL and
dlsym(NULL, name) searches the global scope from the front - which finds
guarder's own interposer.  Every pthread_create then recursed into itself until
the 128-entry thread table was full and guarder aborted with "maximum
concurrent thread limit reached (128)"; an interposer mounted in front of
libguarder.so counts 128 creations and no joins for "./mstress 4 50 25".  That
is the mstressN and rptestN failure in the gd jobs on ubuntu and fedora, and
with the fallback both return to exit 0. RTLD_NEXT starts the search after
libguarder.so, at the real libc; the same file already resolves malloc and free
that way. larsonN-sized still fails, for a reason unrelated to the lookup.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant