Bug 1468084
Summary: | undefined symbol my_progname in libnetsnmptrapd.so | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | Red Hat Enterprise Linux 7 | Reporter: | k-endou | ||||||
Component: | net-snmp | Assignee: | Josef Ridky <jridky> | ||||||
Status: | CLOSED ERRATA | QA Contact: | David Jež <djez> | ||||||
Severity: | low | Docs Contact: | |||||||
Priority: | unspecified | ||||||||
Version: | 7.3 | CC: | awilliam, djez, ovasik, ppisar | ||||||
Target Milestone: | rc | ||||||||
Target Release: | --- | ||||||||
Hardware: | x86_64 | ||||||||
OS: | Linux | ||||||||
Whiteboard: | |||||||||
Fixed In Version: | net-snmp-5.7.2-39.el7 | Doc Type: | If docs needed, set a value | ||||||
Doc Text: | Story Points: | --- | |||||||
Clone Of: | |||||||||
: | 1470004 (view as bug list) | Environment: | |||||||
Last Closed: | 2019-08-06 13:08:42 UTC | Type: | Bug | ||||||
Regression: | --- | Mount Type: | --- | ||||||
Documentation: | --- | CRM: | |||||||
Verified Versions: | Category: | --- | |||||||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||||
Cloudforms Team: | --- | Target Upstream Version: | |||||||
Embargoed: | |||||||||
Bug Depends On: | |||||||||
Bug Blocks: | 1470004 | ||||||||
Attachments: |
|
Description
k-endou
2017-07-06 01:39:15 UTC
# ldd -r /usr/lib64/perl5/vendor_perl/auto/NetSNMP/TrapReceiver/TrapReceiver.so [...] undefined symbol: my_progname (/lib64/libnetsnmptrapd.so.31) undefined symbol: mysql_close (/lib64/libnetsnmptrapd.so.31) undefined symbol: mysql_stmt_error (/lib64/libnetsnmptrapd.so.31) undefined symbol: mysql_autocommit (/lib64/libnetsnmptrapd.so.31) undefined symbol: load_defaults (/lib64/libnetsnmptrapd.so.31) undefined symbol: mysql_stmt_init (/lib64/libnetsnmptrapd.so.31) undefined symbol: mysql_stmt_prepare (/lib64/libnetsnmptrapd.so.31) undefined symbol: mysql_stmt_close (/lib64/libnetsnmptrapd.so.31) undefined symbol: mysql_real_connect (/lib64/libnetsnmptrapd.so.31) undefined symbol: mysql_commit (/lib64/libnetsnmptrapd.so.31) undefined symbol: my_init (/lib64/libnetsnmptrapd.so.31) undefined symbol: mysql_error (/lib64/libnetsnmptrapd.so.31) undefined symbol: mysql_stmt_bind_param (/lib64/libnetsnmptrapd.so.31) undefined symbol: mysql_server_end (/lib64/libnetsnmptrapd.so.31) undefined symbol: mysql_stmt_sqlstate (/lib64/libnetsnmptrapd.so.31) undefined symbol: mysql_sqlstate (/lib64/libnetsnmptrapd.so.31) undefined symbol: mysql_errno (/lib64/libnetsnmptrapd.so.31) undefined symbol: mysql_init (/lib64/libnetsnmptrapd.so.31) undefined symbol: mysql_stmt_execute (/lib64/libnetsnmptrapd.so.31) undefined symbol: mysql_stmt_errno (/lib64/libnetsnmptrapd.so.31) undefined symbol: mysql_insert_id (/lib64/libnetsnmptrapd.so.31) From net-snmp build log: libtool: link: gcc -shared -fPIC -DPIC .libs/snmptrapd_handlers.o .libs/snmptrapd_log.o .libs/snmptrapd_auth.o .libs/snmptrapd_sql.o -L/builddir/build/BUILD/net-snmp-5.7.2/agent/.libs -L/builddir/build/BUILD/net-snmp-5.7.2/snmplib/.libs ../agent/.libs/libnetsnmpmibs.so -L/usr/lib64/perl5/CORE /builddir/build/BUILD/net-snmp-5.7.2/agent/.libs/libnetsnmpagent.so -lwrap /builddir/build/BUILD/net-snmp-5.7.2/snmplib/.libs/libnetsnmp.so -lsensors -lrpm -lrpmio ../snmplib/.libs/libnetsnmp.so -lssl -lcrypto -lperl -lresolv -lnsl -ldl -lm -lcrypt -lutil -lpthread -lc -O2 -fstack-protector-strong -m64 -mtune=generic -fstack-protector -Wl,--enable-new-dtags -Wl,-rpath -Wl,/usr/lib64/perl5/CORE -fstack-protector -Wl,-z -Wl,relro -Wl,-z -Wl,now -Wl,-soname -Wl,libnetsnmptrapd.so.31 -o .libs/libnetsnmptrapd.so.31.0.2 The symbols are indeed provided by libmysqlclient.so and the path is added into ld-linux.so configuration by file /etc/ld.so.conf.d/mariadb-x86_64.conf. So the only missing piece is $(mysql_config --libs) option to the libnetsnmptrapd.so.31.0.2's linker command. Obviously upstream thinks that plugins does not need explicit linkage <https://sourceforge.net/p/net-snmp/bugs/1563/>. I think this is a bug in net-snmp build script. Created attachment 1296787 [details]
patch with solution
That patch really doesn't seem like the right way to fix this. The only way I can think it might work is that it effectively results in that definition of LIBS getting 'leaked' out of the configure step, such that *everything* in the entire build process likely winds up getting linked against libmysqlclient / libmariadb . Wouldn't a more appropriate fix be to change the rule for libnetsnmptrapd.$(LIB_EXTENSION)$(LIB_VERSION) in apps/Makefile.in ? Created attachment 1301954 [details]
better patch
I think this patch is more correct; it adds MYSQL_LIBS to the linking of libnetsnmptrapd. The other patch results in 21 occurrences of -lmariadb in the build process, including linking some libraries against libmariadb that do not *need* to be linked against it at all; this patch results in 8 occurrences of -lmariadb , but still fixes the bug (at least, the ldd command no longer reports any unresolved symbols).
Filed upstream https://sourceforge.net/p/net-snmp/bugs/2792/ with my patch. I'm doing a Fedora Rawhide build with my patch, too. Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2019:2239 |