Hi, I am compiling tshark (1.6.4) without wireshark. I am using following configure option: ./configure --with-ssl=/usr --with-krb5 --disable-wireshark --disable-gtk2 --disable-editcap --disable-idl2wrs --disable-ipv6 --enable-setuid-install --libdir=/usr/lib64 On my build server libpcap-devel 1.3.0 is installed. But on production system (on which tshark rpm will be installed) have libpcap 0.9.4 version installed. When I instal tshark rpm (created on build server) on production system, it gives error message that libpcap.so.1(64 bit) not found. I can not upgrade libpcap version on production system. Can I do static linking of libpcap with tshark binary while compilation of tshark so that I don't need libpcap on production system. Thanks asked 16 Apr '13, 23:24 friends |
3 Answers:
You could remove the dynamic libpcap.so files on your compile server, forcing the linker to use the static one. answered 17 Apr '13, 07:33 JeffMorriss ♦ I'd be more inclined to temporarily rename them, and then move them back, in case somebody wants to run, on that machine, a program dynamically linked with libpcap. Renaming and then renaming them back still leaves a window in which those programs won't work, but it's only open while Wireshark is being built. (17 Apr '13, 10:31) Guy Harris ♦♦ I compiled tshark with static linking of libpcap 1.3.0.
============ When I am running tshark, it throws memory corruption error:
(18 Apr ‘13, 03:49) friends |
If your OS has a linker that's not stupid, i.e. a linker that allows you to specify that certain particular libraries be linked statically without requiring that everything be linked statically, it should be possible to link libpcap statically. That would require that you manually edit the Makefile; you'd put, for example, "-Bstatic" before "-lpcap" and "-Bdynamic" after it. Finding the appropriate places to edit is left as an exercise for the reader (i.e., I'm not going to provide any more help here). answered 17 Apr '13, 00:25 Guy Harris ♦♦ Thanks for your response.. Is there any parameter supported which can be passed to configure script?? Whenever I create tshark rpm, it does configure, make, install and build rpm. Manually modifying Makefile will not be feasible. (17 Apr '13, 03:44) friends No, there's no configure parameter for that. The way to do this kind of thing when building RPMs is to create a patch against the Makefile and apply it in the RPM spec file (e.g., after 'configure' but before 'make'). (17 Apr '13, 07:34) JeffMorriss ♦ |
...which is what you should be doing; the libpcap-devel version should match the libpcap version!
...which almost certainly has nothing whatsoever to do with the libpcap-devel version, given that you're getting the same crash when building with a later version of libpcap. That's probably just a Wireshark bug; try building a newer version of TShark than 1.6.4, such as the current version, 1.8.6 - perhaps the bug will be fixed in that version. (By the way, unless you're trying to test whether TShark can read from a pipe, doing
is silly; you could just do
This is what's called a "useless use of cat".) answered 18 Apr '13, 09:27 Guy Harris ♦♦ edited 18 Apr '13, 09:34 |
What version of what OS are your build server and your production system running? From "tshark rpm", I assume the production system is running some Linux distribution that uses RPMs.
What do
ls -l /usr/lib64/libpcap.so* /usr/lib/libpcap.so*
print on the build server and on the production machine?Output of ls commands:
My production system and build server are using RHEL 5.7. On both the server libpcap 0.9.4 is installed. But when I compile tshark using libpcap-devel 0.9.4 and install the rpm, then it gives memory corruption error.
But you said earlier that
So do you mean that, on the build server, you have libpcap 0.9.4 and libpcap-devel 1.3.0 installed? That sounds inconsistent - shouldn’t the same version of libpcap and libpcap-devel be installed?