[Bug 194] New: Can't open libsyslog-ng-crypto. so during module loading on Fedora
https://bugzilla.balabit.com/show_bug.cgi?id=194 Summary: Can't open libsyslog-ng-crypto.so during module loading on Fedora Product: syslog-ng Version: 3.3.x Platform: All OS/Version: Linux Status: ASSIGNED Severity: normal Priority: unspecified Component: syslog-ng AssignedTo: algernon@balabit.hu ReportedBy: algernon@balabit.hu CC: algernon@balabit.hu Type of the Report: --- Estimated Hours: 0.0 This clone is to track the library path issue separately. +++ This bug was initially created as a clone of Bug #188 +++ Linux distro: Fedora 17 x86_64 Syslog-ng source tarball: syslog-ng-3.3.5.90-20120810-v3.3.5-43-g19f6c.tar.gz we have encountered a couple of problems when running syslog-ng-3.3.5.90-20120810 under Fedora 17 x86_64: 1) ld.so library path 2) undefined symbol: tls_context_setup_session Steps to reproduce the problem: 1) just run "/usr/sbin/syslog-ng --version" ---------- # /usr/sbin/syslog-ng --version syslog-ng 3.3.5.90 Installer-Version: 3.3.5.90 Revision: Compile-Date: Aug 17 2012 22:09:52 Default-Modules: affile,afprog,afsocket,afuser,basicfuncs,csvparser,dbparser,syslogformat,afsql Error opening plugin module; module='afsocket', error='libsyslog-ng-crypto.so: cannot open shared object file: No such file or directory' Error opening plugin module; module='afsocket-notls', error='//usr/lib64/syslog-ng/libafsocket-notls.so: undefined symbol: tls_context_setup_session' Error opening plugin module; module='afsocket-tls', error='libsyslog-ng-crypto.so: cannot open shared object file: No such file or directory' Available-Modules: dummy,afsql,tfjson,dbparser,csvparser,convertfuncs,afuser,basicfuncs,afmongodb,confgen,syslogformat,affile,afprog Enable-Debug: off Enable-GProf: off Enable-Memtrace: off Enable-IPv6: on Enable-Spoof-Source: on Enable-TCP-Wrapper: on Enable-Linux-Caps: on Enable-Pcre: on ---------- The library path problem can be solved by creating the file "/etc/ld.so.conf.d/syslog-ng.conf" containing the syslog-ng module directory ( /usr/lib64/syslog-ng in this particular case ). Running syslog-ng under strace without touching the ld.so library paths produces: ---------- # # strace -e trace=file /usr/sbin/syslog-ng --version ... access("//usr/lib64/syslog-ng/libafsocket.so", F_OK) = 0 stat("//usr/lib64/syslog-ng/libafsocket.so", {st_mode=S_IFREG|0755, st_size=103560, ...}) = 0 open("//usr/lib64/syslog-ng/libafsocket.so", O_RDONLY|O_CLOEXEC) = 4 open("/lib64/tls/libsyslog-ng-crypto.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) open("/lib64/libsyslog-ng-crypto.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) open("/usr/lib64/tls/x86_64/libsyslog-ng-crypto.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) stat("/usr/lib64/tls/x86_64", 0x7fff0f81fcb0) = -1 ENOENT (No such file or directory) open("/usr/lib64/tls/libsyslog-ng-crypto.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) stat("/usr/lib64/tls", {st_mode=S_IFDIR|0555, st_size=4096, ...}) = 0 open("/usr/lib64/x86_64/libsyslog-ng-crypto.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) stat("/usr/lib64/x86_64", 0x7fff0f81fcb0) = -1 ENOENT (No such file or directory) open("/usr/lib64/libsyslog-ng-crypto.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) stat("/usr/lib64", {st_mode=S_IFDIR|0555, st_size=49152, ...}) = 0 Error opening plugin module; module='afsocket', error='libsyslog-ng-crypto.so: cannot open shared object file: No such file or directory' ... ----------- Note that all syslog-ng modules with the exception of libsyslog-ng-crypto.so are loaded from the syslog-ng modules directory. Output of "syslog-ng --version" after creating the file "/etc/ld.so.conf.d/syslog-ng.conf" ---------- # /usr/sbin/syslog-ng --version syslog-ng 3.3.5.90 Installer-Version: 3.3.5.90 Revision: Compile-Date: Aug 17 2012 22:09:52 Default-Modules: affile,afprog,afsocket,afuser,basicfuncs,csvparser,dbparser,syslogformat,afsql Error opening plugin module; module='afsocket-notls', error='//usr/lib64/syslog-ng/libafsocket-notls.so: undefined symbol: tls_context_setup_session' Available-Modules: dummy,afsocket,afsql,tfjson,dbparser,csvparser,convertfuncs,afuser,basicfuncs,afmongodb,afsocket-tls,confgen,syslogformat,affile,afprog Enable-Debug: off Enable-GProf: off Enable-Memtrace: off Enable-IPv6: on Enable-Spoof-Source: on Enable-TCP-Wrapper: on Enable-Linux-Caps: on Enable-Pcre: on ---------- /jpo -- Configure bugmail: https://bugzilla.balabit.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are watching all bug changes.
https://bugzilla.balabit.com/show_bug.cgi?id=194 Gergely Nagy <algernon@balabit.hu> changed: What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|--- |3.3.7 -- Configure bugmail: https://bugzilla.balabit.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are watching all bug changes.
https://bugzilla.balabit.com/show_bug.cgi?id=194 Jose Oliveira <jpo@di.uminho.pt> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jpo@di.uminho.pt -- Configure bugmail: https://bugzilla.balabit.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are watching all bug changes.
https://bugzilla.balabit.com/show_bug.cgi?id=194 --- Comment #1 from Gergely Nagy <algernon@balabit.hu> 2012-09-06 16:47:49 --- Right. I checked my build logs, and at make install time, I see this: libtool: relink: gcc -std=gnu99 -shared -fPIC -DPIC .libs/libafsocket_tls_la-afsocket.o .libs/libafsocket_tls_la-afunix.o .libs/libafsocket_tls_la-afinet.o .libs/libafsocket_tls_la-afsocket-grammar.o .libs/libafsocket_tls_la-afsocket-parser.o .libs/libafsocket_tls_la-afsocket-plugin.o -Wl,-rpath -Wl,/home/algernon/install/syslog-ng/ose-3.3/lib -Wl,-rpath -Wl,/home/algernon/install/syslog-ng/ose-3.3/lib/syslog-ng -L/home/algernon/install/syslog-ng/ose-3.3/lib -lsyslog-ng -L/home/algernon/install/syslog-ng/ose-3.3/lib/syslog-ng -lsyslog-ng-crypto -lssl -lcrypto -L/usr/lib -lnet -lwrap -lsystemd-daemon -O0 -pthread -pthread -Wl,-soname -Wl,libafsocket-tls.so -o .libs/libafsocket-tls.so This sets the RPATH of libafsocket.so correctly, and this should be done by libtool automatically. I'm not entirely sure why that doesn't happen on Fedora, or if it does, then what strips the RPATH out of the ELF later. Do you happen to have a build log I could look at? Also, would it be possible to check the output of objdump -p /usr/lib64/syslog-ng/libafsocket-tls.so | grep RPATH ? -- Configure bugmail: https://bugzilla.balabit.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are watching all bug changes.
https://bugzilla.balabit.com/show_bug.cgi?id=194 --- Comment #2 from Jose Oliveira <jpo@di.uminho.pt> 2012-09-07 13:22:06 --- Package: syslog-ng-3.3.7-0.1.fc17 Source tarball: syslog-ng v3.3.6.90 RPMS and mock build logs: http://um-pe09-2.di.uminho.pt/fedora/build.logs/fedora-17-x86_64/syslog-ng-3... Main build log: http://um-pe09-2.di.uminho.pt/fedora/build.logs/fedora-17-x86_64/syslog-ng-3... $ objdump -p syslog-ng-3.3.7-0.1.fc17.x86_64/usr/lib64/syslog-ng/libafsocket-tls.so | grep RPATH (no output) $ echo $? 1 -- Configure bugmail: https://bugzilla.balabit.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are watching all bug changes.
https://bugzilla.balabit.com/show_bug.cgi?id=194 --- Comment #3 from Gergely Nagy <algernon@balabit.hu> 2012-09-07 14:18:05 ---
$ objdump -p syslog-ng-3.3.7-0.1.fc17.x86_64/usr/lib64/syslog-ng/libafsocket-tls.so | grep RPATH (no output)
The problem appears to be these lines: + sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool + sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool These pretty much tell libtool never to add an rpath, which can be observed later, when linking libafsocket-tls, for example: /bin/sh ../../libtool --tag=CC --mode=link gcc -std=gnu99 -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -Wall -pthread -avoid-version -module -no-undefined -Wl,-z,relro -o libafsocket-tls.la -rpath //usr/lib64/syslog-ng libafsocket_tls_la-afsocket.lo libafsocket_tls_la-afunix.lo libafsocket_tls_la-afinet.lo libafsocket_tls_la-afsocket-grammar.lo libafsocket_tls_la-afsocket-parser.lo libafsocket_tls_la-afsocket-plugin.lo libafsocket_tls_la-sd-daemon.lo ../../lib/libsyslog-ng.la ../../lib/libsyslog-ng-crypto.la -lssl -lcrypto -lnet -lwrap Notice that this correctly has "-rpath //usr/lib64/syslog-ng", while the command libtool ends up running, does not: libtool: link: gcc -std=gnu99 -shared .libs/libafsocket_tls_la-afsocket.o .libs/libafsocket_tls_la-afunix.o .libs/libafsocket_tls_la-afinet.o .libs/libafsocket_tls_la-afsocket-grammar.o .libs/libafsocket_tls_la-afsocket-parser.o .libs/libafsocket_tls_la-afsocket-plugin.o .libs/libafsocket_tls_la-sd-daemon.o ../../lib/.libs/libsyslog-ng.so ../../lib/.libs/libsyslog-ng-crypto.so -lssl -lcrypto -lnet -lwrap -m64 -mtune=generic -pthread -Wl,-z -Wl,relro -pthread -Wl,-soname -Wl,libafsocket-tls.so -o .libs/libafsocket-tls.so Having looked at the spec file, the rpath-murdering is in the build target, just after configure. I believe that should be removed, so that shared objects that do need an RPATH, will end up with one, the rest can be stripped of rpath later (chrpath -d does a marvellous job at that). Though, I'd think that libtool is clever enough to not add rpath when not necessary. This is a problem in the redhat packaging, I'd say, syslog-ng's build system does the right thing and adds the rpath to the private modules. -- Configure bugmail: https://bugzilla.balabit.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are watching all bug changes.
https://bugzilla.balabit.com/show_bug.cgi?id=194 Gergely Nagy <algernon@balabit.hu> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution| |INVALID Status|ASSIGNED |RESOLVED --- Comment #4 from Gergely Nagy <algernon@balabit.hu> 2012-10-27 11:31:03 --- Setting this to resolved, because the syslog-ng build system is doing the right thing here. -- Configure bugmail: https://bugzilla.balabit.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are watching all bug changes.
participants (1)
-
bugzilla@bugzilla.balabit.com