public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug dynamic-link/27646] New: Linker error for non-existing NSS symbols (e.g. _nss_files_getcanonname_r) from within a dlmopen namespace.
@ 2021-03-24 18:03 alfonso.peterssen at oracle dot com
  2021-03-31 10:00 ` [Bug dynamic-link/27646] " gilles.m.duboscq at gmail dot com
                   ` (17 more replies)
  0 siblings, 18 replies; 19+ messages in thread
From: alfonso.peterssen at oracle dot com @ 2021-03-24 18:03 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=27646

            Bug ID: 27646
           Summary: Linker error for non-existing NSS symbols (e.g.
                    _nss_files_getcanonname_r) from within a dlmopen
                    namespace.
           Product: glibc
           Version: 2.33
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: dynamic-link
          Assignee: unassigned at sourceware dot org
          Reporter: alfonso.peterssen at oracle dot com
  Target Milestone: ---

Consider the following library (libfoo.so) + test program:

cat <<EOF > foo.c
#include <netdb.h>
#include <stdio.h>
void bar() {
  gethostbyname("localhost");
  puts("foo bar!");
}
EOF

cat <<EOF > test.c
#define _GNU_SOURCE
#include <dlfcn.h>
int main() {
  // dlopen works fine, dlmopen crashes
  // dlopen("./libfoo.so", RTLD_LAZY);
  void* foo = dlmopen(LM_ID_NEWLM, "./libfoo.so", RTLD_LAZY); 
  void (*bar)() = dlsym(foo, "bar");
  bar();
  return 0;
}
EOF

gcc -shared foo.c -o libfoo.so
gcc test.c -ldl -o test
./test


Description:

libnss_files.so symbol lookup explodes from within a dlmopen namespace with the
following error:
./test: symbol lookup error: /usr/lib/libnss_files.so.2: undefined symbol:
_nss_files_getcanonname_r

The regression appeared in 2.33 related to changes in NSS (not seen in 2.32)
but it is rather a symbol resolution issue.
The program works as expected with dlopen.

As a workaround, it runs fine with (I cannot explain why):
LD_DEBUG=unused ./test

We rely on dlmopen to provide native isolation for Java on Truffle (Espresso),
a component of the GraalVM project; this regression forces users to prepend
LD_DEBUG=unused to run Java on Truffle (Espresso).

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2021-12-03 11:03 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-24 18:03 [Bug dynamic-link/27646] New: Linker error for non-existing NSS symbols (e.g. _nss_files_getcanonname_r) from within a dlmopen namespace alfonso.peterssen at oracle dot com
2021-03-31 10:00 ` [Bug dynamic-link/27646] " gilles.m.duboscq at gmail dot com
2021-05-16  3:39 ` evangelos at foutrelis dot com
2021-06-09 11:57 ` mbhangui at gmail dot com
2021-06-09 13:51 ` fweimer at redhat dot com
2021-06-09 13:57 ` fweimer at redhat dot com
2021-06-09 16:45 ` fweimer at redhat dot com
2021-06-14  7:45 ` gilles.m.duboscq at gmail dot com
2021-06-14  8:54 ` fweimer at redhat dot com
2021-06-14  8:55 ` fweimer at redhat dot com
2021-06-14  9:48 ` fweimer at redhat dot com
2021-06-17 13:09 ` fweimer at redhat dot com
2021-07-02 16:26 ` mbhangui at gmail dot com
2021-07-06 11:14 ` fweimer at redhat dot com
2021-07-06 11:33 ` mbhangui at gmail dot com
2021-07-06 11:47 ` fweimer at redhat dot com
2021-07-06 16:19 ` gilles.m.duboscq at gmail dot com
2021-07-06 16:23 ` fweimer at redhat dot com
2021-12-03 11:03 ` lewurm at gmail dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).