boost, LD_PRELOAD and segfault
Hi all,
I'm experiencing something very weird. I'm developing a shared object
written in C++ and linked against libboost-serialization-gcc41.so. This
dynamic library is preloaded before launching a test program (proftpd).
As soon as a try to log into the ftp server using a non-anonymous user, I
get a segfault from the child the was handling the client connection. Of
course, the same code, without libboost-serialization-gcc41.so linked
against is perfectly working.
I also removed any serialize method so basically only the libboost header
file are included with the library linked as well.
Do you guys have any idea of what's going on?
Libboost version 1.34.1, gcc version 4.1. I'm going to build the gcc-3.4
version of the library and I'll turn debugging on.
TIA, bye
Lorenzo
PS: of course I tried to debug but what I got was pretty useless. No clue.
For instance, strace showed a syscall (gettimeofday) is successfully invoked
before the segfault.
--
Lorenzo `Gigi Sullivan' Cavallaro
Lorenzo Cavallaro wrote:
Hi all,
I'm experiencing something very weird. I'm developing a shared object written in C++ and linked against libboost-serialization-gcc41.so. This dynamic library is preloaded before launching a test program (proftpd).
As soon as a try to log into the ftp server using a non-anonymous user, I get a segfault from the child the was handling the client connection. Of course, the same code, without libboost-serialization-gcc41.so linked against is perfectly working.
I also removed any serialize method so basically only the libboost header file are included with the library linked as well.
Do you guys have any idea of what's going on?
No, but logically thinking there are two ways how boost serialization can affect things: 1. It can have a static constructors that kills things. 2. It can have a function that LD_PRELOAD-y overrides something it should not. I'd suggest incrementally decrease the number of files that are linked into boost serialization. Of course removing any file from link will give use useless boost serialization, and you say that for test purposes, you've removed any use. I think that sooner or later you'll get a minimal example reproducing the problem and it all will be obvious. - Volodya
Hi, On Mon, Sep 03, 2007 at 11:17:28PM +0400, Vladimir Prus wrote:
Do you guys have any idea of what's going on?
No, but logically thinking there are two ways how boost serialization can affect things:
1. It can have a static constructors that kills things. 2. It can have a function that LD_PRELOAD-y overrides something it should not.
As for 2 I'm pretty sure this is not happening (I'm overriding some functions/system call wrappers). Likewise, for 1 this shouldn't happen either. I'm not making an extreme use of C++ feature, just the fewer that are needed for the serialization part. However, I removed basically everything related to C++ code, beside keeping libboost includes and, however, linking libboost_serialization to it (even if this shouldn't have linked actually anything, if all the serialization-dependent code has been correctly removed).
I'd suggest incrementally decrease the number of files that are linked into boost serialization. Of course removing any file from link will give use useless boost serialization, and you say that for test purposes, you've removed any use. I think that sooner or later you'll get a minimal example reproducing the problem and it all will be obvious.
True. However, as a side note I tried linking my code with
libboost_serialization-gcc41-d.so. Looking at the size and considering the
-d I presume this is the library with debugging info (but I may be wrong,
of coure). Weird enough, everything works perfectly.
TIA, bye
Lorenzo
--
Lorenzo `Gigi Sullivan' Cavallaro
participants (2)
-
Lorenzo Cavallaro
-
Vladimir Prus