Crashed caused by Library_merged

Michael Meeks michael.meeks at suse.com
Thu Apr 4 05:56:44 PDT 2013


Hi Peter,

On Wed, 2013-04-03 at 21:54 -0400, Peter Foley wrote:
> While working on adding more libraries to Library_merged, I ran into
> some bizarre crashes in unit tests.

	Glad that the tests are catching these things.

> The errors seem to be related to exporting documents.
> They only occur when building with --enable-mergelibs.
> I've attached a log with backtraces from the segfaults.
> My configure args are: --with-system-cairo --enable-mergelibs
> --enable-debug CC=clang CXX=clang++
> I'm also using the gold linker.
> Suggestions as to what might be breaking or how to further debug this
> would be greatly appreciated.

	I guess the crash on: FlushData(); is down to it being the first
virtual method touched on that stream - which will in turn try to
de-reference the vtable pointer which is (presuambly) invalid while the
instance itself is not (allowing the earlier members to get touched).

	I'd be inclined to run it under valgrind if you can:

export VALGRIND=memcheck            # for memory checking

	That may help; why it would work under mergedlibs and not elsewhere is
something more of a mystery of course.

	You would hope that gold would warn on multiple definitions of classes
in case that is the problem; things like 'StreamData' in tools/ look a
bit open to duplication ;-) and of course many previously local internal
functions / classes will be pushed into a global scope by the mergelibs
work. The more that goes in the more risk.

	I guess it might be possible to bisect the issue out by chopping stuff
into / out of mergelibs to find the two modules that interfere with each
other somehow - but that'd be quite painful I expect.

	In this case, looking at:

#0  0x00002aaabd442384 in SvStream::Flush (this=0xffff50)
at /home/peter/libreoffice/tools/source/stream/stream.cxx:1475
#1  0x00002aaab4ffc373 in GraphicHelper::getThumbnailFormatFromGDI_Impl
(pMetaFile=0xfbe4d0, bSigned=0 '\000', xStream=uno::Reference to
(XInterface) 0x2aaac3b7de20)
at /home/peter/libreoffice/sfx2/source/doc/graphhelp.cxx:397

	which seems to go wrong pretty quickly with the stream pointer, the
situation looks rather fun :-) I'd be inclined to chase through to see
where the pStream pointer goes wonky in that method personally.

	 vcl/source/gdi/cvtgrf.cxx

	is the GraphicConverter impl. that seems to defer to the results of
Application::SetFilterHdl - in a typically obscure chain of calls.

	The test::BootstrapFixture::setup() method does some work around here:

    // Make GraphicConverter work, normally done in
desktop::Desktop::Main()
    Application::SetFilterHdl( LINK( this, test::BootstrapFixture,
ImplInitFilterHdl ) );

	Might be worth digging around there ?

	HTH,

		Michael.

-- 
michael.meeks at suse.com  <><, Pseudo Engineer, itinerant idiot



More information about the LibreOffice mailing list