On Wed, May 30, 2012 at 7:59 AM, Noel O'Boyle <baoille...@gmail.com> wrote:

> I've just confirmed what Craig was seeing. I have CMake 2.8.5.
>
> I always install locally but once I added the installed lib directory
> to the front of LD_LIBRARY_PATH, all the tests started to segfault.
> I'll look into it....
>

Well, good, I thought I was going crazy. ;-)

Here's an observation that might help: valgrind reports LOTS of errors, all
related to double-free memory.  There seems to be something about the test
programs specifically that screws up the C++ constructor/destructor
system.  It appears to be deleting objects prematurely.

In some cases it happens during the test.  The place it's most obvious is
when programs complete, but then get a segfault during the exit() call as
the destructors are being run.

My guess, and this is a wild guess, is that the test programs are doing
something unusual with the dynamic loader that's not done by the mainstream
OpenBabel programs.  Maybe they have some tricky code in there that (for
convenience) tries to find the shared libraries even when they're not in
LD_LIBRARY_PATH, and in doing so they cause something to go haywire.

Another observation: the .so files that are installed don't have the same
checksums as the .so files in the build/lib directory.  I thought that was
odd, but there's probably a good reason.

Craig


>
> - Noel
>
> On 30 May 2012 14:41, Geoff Hutchison <ge...@geoffhutchison.net> wrote:
> > I asked about cmake because newer versions should set env variables
> correctly to use the build dir.
> >
> > Geoff
> >
> > On May 30, 2012, at 4:41 AM, My Th <rei4...@gmail.com> wrote:
> >
> >> T , 2012-05-30 09:26 +0100, Noel O'Boyle rakstīja:
> >>> On 30 May 2012 00:06, Craig James <cja...@emolecules.com> wrote:
> >>>> On Tue, May 29, 2012 at 2:42 PM, My Th <rei4...@gmail.com> wrote:
> >>>>>
> >>>>> O , 2012-05-29 14:29 -0700, Craig James rakstīja:
> >>>>>> I've confirmed absolutely on Ubuntu: Testing in the build directory
> >>>>>> works.  Testing with an installed OpenBabel system doesn't.
> >>>>>>
> >>>>>> I started with a completely clean computer ... it didn't even have
> a g
> >>>>>> ++ compiler, cmake, or anything else (definitely not OpenBabel).
> This
> >>>>>> computer had never been used before.
> >>>>>>
> >>>>>> After installing svn, cmake and g++, I checked out the very latest
> >>>>>> OpenBabel (r4834) into $HOME/test-svn.  Then:
> >>>>>>
> >>>>>> $ cd ../build-test-svn/
> >>>>>> $ \rm -rf *
> >>>>>> $ sudo /bin/bash
> >>>>>> # \rm -rf /usr/local/openbabel/*
> >>>>>> # exit
> >>>>>> $ cmake -DCMAKE_INSTALL_PREFIX=/usr/local/openbabel ../test-svn
> >>>>>> $ make
> >>>>>> $ make test
> >>>>>>
> >>>>>> At this point, most tests pass, and there are no segfaults.
> >>>>>>
> >>>>>> Now install:
> >>>>>>
> >>>>>> $ sudo /bin/bash
> >>>>>> # make install/fast
> >>>>>> # exit
> >>>>>> $ make test
> >>>>>
> >>>>> Here make test probably picks your installed version and fails as a
> >>>>> result.
> >>>>
> >>>>
> >>>> That doesn't make sense.  Why should it fail if it finds the installed
> >>>> version?  It's the same version.  That was the point of my test: I
> compiled
> >>>> and installed it on an absolutely clean system that couldn't possibly
> have
> >>>> two versions of OpenBabel.
> >>>>
> >>>> The whole point of this exercise is to prove that when it DID find the
> >>>> installed version, it crashes.
> >>>>
> >>>>>
> >>>>> Try setting LD_LIBRARY_PATH and friends (using absolute paths,
> >>>>> set also PYTHON_PATH if you are compiling python bindings) before
> >>>>> running make test: LD_LIBRARY_PATH=./lib/ BABEL_LIBDIR=./lib/
> >>>>> BABEL_DATADIR=../test-svn/openbabel/trunk/data/ make test
> >>>>
> >>>>
> >>>> So you're saying that "make test" SHOULD fail if you've done "make
> install"
> >>>> and have LD_LIBRARY_PATH set, even if the libraries are correctly
> >>>> installed?  That seems really confusing.  Why shouldn't "make test"
> work
> >>>> either way?
> >>
> >> No, I'm saying that prepending the paths to make test would let you to
> >> know, that the issue is with tests going off the wrong path. And yes, I
> >> think they should always work by picking the files in your build dir and
> >> not looking for any installed files.
> >>
> >>> I agree with you Craig it's a problem. I'll look into it. It could be
> >>> something as simple as the tests cannot find the test files and just
> >>> segfault.
> >>
> >> Thanks, it would be really helpful if the build system would make sure
> >> that make test is using files from build dir and data files from source
> >> tree.
> >>
> >>
> >> Reinis
> >>
> >>
> >>
> ------------------------------------------------------------------------------
> >> Live Security Virtual Conference
> >> Exclusive live event will cover all the ways today's security and
> >> threat landscape has changed and how IT managers can respond.
> Discussions
> >> will include endpoint security, mobile security and the latest in
> malware
> >> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> >> _______________________________________________
> >> OpenBabel-Devel mailing list
> >> OpenBabel-Devel@lists.sourceforge.net
> >> https://lists.sourceforge.net/lists/listinfo/openbabel-devel
>
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
OpenBabel-Devel mailing list
OpenBabel-Devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-devel

Reply via email to