Bug 33785 - Particular WMF causes crash
Summary: Particular WMF causes crash
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
3.3.0 release
Hardware: All Windows (All)
: high major
Assignee: Cédric Bosdonnat
URL:
Whiteboard:
Keywords:
: 30721 32119 33572 33806 33894 34032 34172 (view as bug list)
Depends on:
Blocks: 32894 34032
  Show dependency treegraph
 
Reported: 2011-01-31 14:18 UTC by Jesus Corrius
Modified: 2013-11-24 18:00 UTC (History)
10 users (show)

See Also:
Crash report or crash signature:


Attachments
The Document that Crashes Writer (at least on Windows) (34.23 KB, application/vnd.oasis.opendocument.text)
2011-01-31 14:18 UTC, Jesus Corrius
Details
See Comment 1 (21.20 KB, image/x-wmf)
2011-01-31 22:23 UTC, Rainer Bielefeld Retired
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jesus Corrius 2011-01-31 14:18:47 UTC
Created attachment 42781 [details]
The Document that Crashes Writer (at least on Windows)

I don't know if it's a Windows specific bug or it happens also in other platforms.

Steps to reproduce:

1. Open the attached document, LibreOffice Writer appears.
2. Scroll down a bit.
3. LibreOffice 3.3.0 crashes
Comment 1 Rainer Bielefeld Retired 2011-01-31 22:23:01 UTC
[Reproducible] with "LibreOffice 3.3.0 RC4 - WIN7  Home Premium (64bit) German UI  [OOO330m19 (build 6 / tag 3.3.0.4)]"

Works fine with "Ooo-Dev 3.4.0 multilingual version English UI WIN XP: [OOo300m98 (Build 9568)]"!

LibO also crashes with a document that has been saved with OOo, but no longer after I have had deleted "Figura 1.- Niveles de prioridad según urgencia e impacto" with OOo.

Reason for the crash is inserted picture "20000058000060220000447FF170EB24.WMF", I extracted and attached the file. 

Steps to reproduce:

1. Open new WRITER document
2. Menu 'Insert > Picture > from file - select 
   "20000058000060220000447FF170EB24.WMF"' <ok>
   LibO WRITER will crash after few moments

CALC and DRAW will not crash.
Comment 2 Rainer Bielefeld Retired 2011-01-31 22:23:45 UTC
Created attachment 42795 [details]
See Comment 1
Comment 3 Michael Meeks 2011-02-01 06:24:26 UTC
great job cutting this down Rainer ! :-) interestingly, it works fine if I insert this under Linux; which is curious; but it does crash nicely under windows as you say; fun. I wonder what it says when run under valgrind on Linux.
Comment 4 Rainer Bielefeld Retired 2011-02-01 06:36:49 UTC
*** Bug 33806 has been marked as a duplicate of this bug. ***
Comment 5 Michael Meeks 2011-02-01 06:50:25 UTC
I back-ported Caolan's G_SLICE fix to libreoffice-3-3 to help debugging, but even so valgrind shows thing that interesting. Potentially there is some problem in the saving code doing deflation:

Thread:      1 :CairoCanvas destroyed
==19014== Conditional jump or move depends on uninitialised value(s)
==19014==    at 0xDC9248B: longest_match (in /data/opt/TTInstall/basis3.3/program/libpackage2.so)
==19014==    by 0xDC928E5: deflate_slow (in /data/opt/TTInstall/basis3.3/program/libpackage2.so)
==19014==    by 0xDC93A5E: z_deflate (in /data/opt/TTInstall/basis3.3/program/libpackage2.so)
==19014==    by 0xDC6F71C: Deflater::doDeflateBytes(com::sun::star::uno::Sequence<signed char>&, long, long) (in /data/opt/TTInstall/basis3.3/program/libpackage2.so)
==19014==    by 0xDC6F780: Deflater::doDeflateSegment(com::sun::star::uno::Sequence<signed char>&, long, long) (in /data/opt/TTInstall/basis3.3/program/libpackage2.so)
==19014==    by 0xDC745A7: ZipOutputStream::doDeflate() (in /data/opt/TTInstall/basis3.3/program/libpackage2.so)
==19014==    by 0xDC747BE: ZipOutputStream::closeEntry() (in /data/opt/TTInstall/basis3.3/program/libpackage2.so)
==19014==    by 0xDC8304B: ZipPackageFolder::saveContents(rtl::OUString&, _STL::vector<com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue>, _STL::allocator<com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> > >&, ZipOutputStream&, com::sun::star::uno::Sequence<signed char>&, void*&) (in /data/opt/TTInstall/basis3.3/program/libpackage2.so)
==19014==    by 0xDC8282D: ZipPackageFolder::saveContents(rtl::OUString&, _STL::vector<com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue>, _STL::allocator<com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> > >&, ZipOutputStream&, com::sun::star::uno::Sequence<signed char>&, void*&) (in /data/opt/TTInstall/basis3.3/program/libpackage2.so)
==19014==    by 0xDC79CCF: ZipPackage::writeTempFile() (in /data/opt/TTInstall/basis3.3/program/libpackage2.so)
==19014==    by 0xDC7A482: ZipPackage::commitChanges() (in /data/opt/TTInstall/basis3.3/program/libpackage2.so)
==19014==    by 0x116035FB: OStorage_Impl::Commit() (in /data/opt/TTInstall/basis3.3/program/libxstor.so)

But ... prolly that is unrelated.

Jesus - any chance you can get a decent stack trace from a Windows build with debug symbols ? :-)
Comment 6 Don't use this account, use tml@iki.fi 2011-02-01 11:02:41 UTC
Had to rebuild all of sw with debug=t to get symbols of even part of it; a partial rebuild with debug=t didn't work, I just got more and more obscure unresolved symbols or duplicate symbols. Oh well.

Anyway, when I then load the attached .odt file and then scroll it forward, I get an unhandled exception in the debugger:

Unhandled exception at 0x7c812afb in soffice.bin: Microsoft C++ exception: com::sun::star::loader::CannotActivateFactoryException at memory location 0x0145c968..

with a call stack:
 	kernel32.dll!7c812afb() 	
 	[Frames below may be incorrect and/or missing, no symbols loaded for kernel32.dll]	
 	kernel32.dll!7c812afb() 	
 	msvcr90.dll!785838da() 	
 	sal3.dll!10003392() 	
>	swmi.dll!SwRects::_resize(unsigned int n=0x00000000)  Line 41 + 0x3d bytes	C++
 	swmi.dll!SwRects::Remove(unsigned short nP=0x0000, unsigned short nL=0x0001)  Line 41 + 0xbd bytes	C++
 	swmi.dll!SwRegionRects::operator-=(const SwRect & rRect={...})  Line 144	C++
 	000002bd()	
 	swmi.dll!SwTaggedPDFHelper::SwTaggedPDFHelper(const Num_Info * pNumInfo=0x00000000, const Frm_Info * pFrmInfo=0x00720060, const Por_Info * pPorInfo=0x0deb0b18, OutputDevice & rOut={...})  Line 288 + 0x9 bytes	C++

which seems a bit weird and stops in the middle, so maybe the stack is fscked up and the debugger can't give any better backtrack? Does this give any hint at all?
Comment 7 Jesus Corrius 2011-02-01 11:25:03 UTC
I am building a full debug build now. Let's see if I can get a better stack trace on Windows.
Comment 8 Jesus Corrius 2011-02-02 06:12:30 UTC
In my master build in debug, LibO crashes at:

>	cppuhelper3MSC.dll!cppu::loadSharedLibComponentFactory(const rtl::OUString & rLibName={...}, const rtl::OUString & rPath={...}, const rtl::OUString & rImplName={...}, const com::sun::star::uno::Reference<com::sun::star::lang::XMultiServiceFactory> & xMgr={...}, const com::sun::star::uno::Reference<com::sun::star::registry::XRegistryKey> & xKey={...})  Line 364 + 0x9b bytes	C++

Variables:

+		aModulePath	{pData=0x122ce018 }	rtl::OUString
                +		pData	0x122ce018 {refCount=1 length=90 buffer=0x122ce020 "file:///C:/Archivos%20de%20programa/LibreOffice%203/program/../program/mtfrenderer.uno.dll" }	_rtl_uString *
+		lib	0x00000000	void *


The code is the following one and it's basically throwing the exception beause it can't load the module:

    oslModule lib = osl_loadModule(
        aModulePath.pData, SAL_LOADMODULE_LAZY | SAL_LOADMODULE_GLOBAL );
    if (! lib)
    {
        throw loader::CannotActivateFactoryException(
            OUSTR("loading component library failed: ") + aModulePath,
            Reference< XInterface >() );
    }

Here it is the complete stacktrace:

 	kernel32.dll!_RaiseException@16()  + 0x52 bytes	
 	msvcr90d.dll!_CxxThrowException(void * pExceptionObject=0x015bd014, const _s__ThrowInfo * pThrowInfo=0x01abe33c)  Line 161	C++
>	cppuhelper3MSC.dll!cppu::loadSharedLibComponentFactory(const rtl::OUString & rLibName={...}, const rtl::OUString & rPath={...}, const rtl::OUString & rImplName={...}, const com::sun::star::uno::Reference<com::sun::star::lang::XMultiServiceFactory> & xMgr={...}, const com::sun::star::uno::Reference<com::sun::star::registry::XRegistryKey> & xKey={...})  Line 364 + 0x9b bytes	C++
 	bootstrap.uno.dll!stoc_loader::DllComponentLoader::activate(const rtl::OUString & rImplName={...}, const rtl::OUString & __formal={...}, const rtl::OUString & rLibName={...}, const com::sun::star::uno::Reference<com::sun::star::registry::XRegistryKey> & xKey={...})  Line 226 + 0x58 bytes	C++
 	cppuhelper3MSC.dll!cppu::ORegistryFactoryHelper::createModuleFactory()  Line 880 + 0x43 bytes	C++
 	cppuhelper3MSC.dll!cppu::ORegistryFactoryHelper::createInstanceWithArgumentsAndContext(const com::sun::star::uno::Sequence<com::sun::star::uno::Any> & rArguments={...}, const com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext> & xContext={...})  Line 792 + 0xf bytes	C++
 	bootstrap.uno.dll!stoc_smgr::OServiceManager::createInstanceWithArgumentsAndContext(const rtl::OUString & rServiceSpecifier={...}, const com::sun::star::uno::Sequence<com::sun::star::uno::Any> & rArguments={...}, const com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext> & xContext={...})  Line 1311 + 0x29 bytes	C++
 	bootstrap.uno.dll!stoc_smgr::OServiceManager::createInstanceWithArguments(const rtl::OUString & rServiceSpecifier={...}, const com::sun::star::uno::Sequence<com::sun::star::uno::Any> & rArguments={...})  Line 1367 + 0x25 bytes	C++
 	vclmi.dll!GDIMetaFile::ImplPlayWithRenderer(OutputDevice * pOut=0x0b032e94, const Point & rPos={...}, Size rDestSize={...})  Line 527 + 0x69 bytes	C++
 	vclmi.dll!GDIMetaFile::Play(OutputDevice * pOut=0x0b032e94, const Point & rPos={...}, const Size & rSize={...}, unsigned long nPos=4294967295)  Line 658 + 0x29 bytes	C++
 	svtmi.dll!GraphicManager::ImplDraw(OutputDevice * pOut=0x0b032e94, const Point & rPt={...}, const Size & rSz={...}, const GDIMetaFile & rMtf={...}, const GraphicAttr & rAttr={...})  Line 1890	C++
 	svtmi.dll!GraphicManager::ImplCreateOutput(OutputDevice * pOut=0x0b032e94, const Point & rPt={...}, const Size & rSz={...}, const GDIMetaFile & rMtf={...}, const GraphicAttr & rAttr={...}, const unsigned long __formal=3, GDIMetaFile & rOutMtf={...}, BitmapEx & rOutBmpEx={...})  Line 918 + 0x19 bytes	C++
 	svtmi.dll!GraphicManager::ImplDraw(OutputDevice * pOut=0x0b032e94, const Point & rPt={...}, const Size & rSz={...}, GraphicObject & rObj={...}, const GraphicAttr & rAttr={...}, const unsigned long nFlags=3, unsigned char & rCached=0)  Line 356 + 0x31 bytes	C++
 	svtmi.dll!GraphicManager::DrawObj(OutputDevice * pOut=0x0b032e94, const Point & rPt={...}, const Size & rSz={...}, GraphicObject & rObj={...}, const GraphicAttr & rAttr={...}, const unsigned long nFlags=3, unsigned char & rCached=0)  Line 260 + 0x24 bytes	C++
 	svtmi.dll!GraphicObject::Draw(OutputDevice * pOut=0x0b032e94, const Point & rPt={...}, const Size & rSz={...}, const GraphicAttr * pAttr=0x015bdbb0, unsigned long nFlags=3)  Line 618 + 0x2d bytes	C++
 	svtmi.dll!GraphicObject::DrawWithPDFHandling(OutputDevice & rOutDev={...}, const Point & rPt={...}, const Size & rSz={...}, const GraphicAttr * pGrfAttr=0x015bdda0, const unsigned long nFlags=3)  Line 685 + 0x1f bytes	C++
 	swmi.dll!SwNoTxtFrm::PaintPicture(OutputDevice * pOut=0x0b032e94, const SwRect & rGrfArea={...})  Line 915	C++
 	swmi.dll!SwNoTxtFrm::Paint(const SwRect & rRect={...}, const SwPrtOptions * __formal=0x00000000)  Line 329	C++
 	swmi.dll!SwLayoutFrm::Paint(const SwRect & rRect={...}, const SwPrtOptions * __formal=0x00000000)  Line 3245	C++
 	swmi.dll!SwFlyFrm::Paint(const SwRect & rRect={...}, const SwPrtOptions * __formal=0x00000000)  Line 3672	C++
 	swmi.dll!SwFlyCntPortion::Paint(const SwTxtPaintInfo & rInf={...})  Line 269	C++
 	swmi.dll!SwTxtPainter::DrawTextLine(const SwRect & rPaint={...}, SwSaveClip & rClip={...}, const unsigned char bUnderSz=0)  Line 414	C++
 	swmi.dll!SwTxtFrm::Paint(const SwRect & rRect={...}, const SwPrtOptions * __formal=0x00000000)  Line 730	C++
 	swmi.dll!SwLayoutFrm::Paint(const SwRect & rRect={...}, const SwPrtOptions * __formal=0x00000000)  Line 3245	C++
 	swmi.dll!SwBodyFrm::Paint(const SwRect & rRect={...}, const SwPrtOptions * __formal=0x00000000)  Line 200	C++
 	swmi.dll!SwLayoutFrm::Paint(const SwRect & rRect={...}, const SwPrtOptions * __formal=0x00000000)  Line 3245	C++
 	swmi.dll!SwRootFrm::Paint(const SwRect & rRect={...}, const SwPrtOptions * pPrintData=0x00000000)  Line 2976	C++
 	swmi.dll!ViewShell::Paint(const Rectangle & rRect={...})  Line 1719	C++
 	swmi.dll!SwCrsrShell::Paint(const Rectangle & rRect={...})  Line 1167	C++
 	swmi.dll!SwEditWin::Paint(const Rectangle & rRect={...})  Line 541	C++
 	vclmi.dll!Window::ImplCallPaint(const Region * pRegion=0x00000000, unsigned short nPaintFlags=48)  Line 2433	C++
 	vclmi.dll!Window::Update()  Line 7568	C++
 	swmi.dll!ViewShell::VisPortChgd(const SwRect & rRect={...})  Line 1101	C++
 	swmi.dll!SwCrsrShell::VisPortChgd(const SwRect & rRect={...})  Line 1206	C++
 	swmi.dll!SwView::SetVisArea(const Rectangle & rRect={...}, unsigned char bUpdateScrollbar=0)  Line 271	C++
 	swmi.dll!SwView::SetVisArea(const Point & rPt={...}, unsigned char bUpdateScrollbar=0)  Line 335	C++
 	swmi.dll!SwView::EndScrollHdl(SwScrollbar * pScrollbar=0x0b33e790)  Line 765	C++
 	swmi.dll!SwView::ScrollHdl(SwScrollbar * pScrollbar=0x0b33e790)  Line 694	C++
 	swmi.dll!SwView::LinkStubScrollHdl(void * pThis=0x0b3279b0, void * pCaller=0x0b33e790)  Line 678 + 0xf bytes	C++
 	tlmi.dll!Link::Call(void * pCaller=0x0b33e790)  Line 140 + 0x1b bytes	C++
 	vclmi.dll!Control::ImplCallEventListenersAndHandler(unsigned long nEvent=1111, const Link & rHandler={...}, void * pCaller=0x0b33e790)  Line 386	C++
 	vclmi.dll!ScrollBar::Scroll()  Line 1465	C++
 	vclmi.dll!ScrollBar::ImplScroll(long nNewPos=9750, unsigned char bCallEndScroll='')  Line 869	C++
 	vclmi.dll!ScrollBar::DoScroll(long nNewPos=9750)  Line 1482 + 0xe bytes	C++
 	vclmi.dll!Window::ImplHandleScroll(ScrollBar * pHScrl=0x00000000, long nX=0, ScrollBar * pVScrl=0x0b33e790, long nY=-6)  Line 1299	C++
 	vclmi.dll!Window::HandleScrollCommand(const CommandEvent & rCmd={...}, ScrollBar * pHScrl=0x0b335468, ScrollBar * pVScrl=0x0b33e790)  Line 1223	C++
 	swmi.dll!SwView::HandleWheelCommands(const CommandEvent & rCEvt={...})  Line 1333 + 0x27 bytes	C++
 	swmi.dll!SwEditWin::Command(const CommandEvent & rCEvt={...})  Line 4705 + 0x15 bytes	C++
 	vclmi.dll!ImplCallWheelCommand(Window * pWindow=0x0b327d00, const Point & rPos={...}, const CommandWheelData * pWheelData=0x015bf574)  Line 1448	C++
 	vclmi.dll!ImplHandleWheelEvent(Window * pWindow=0x0afe41b8, const SalWheelMouseEvent & rEvt={...})  Line 1521 + 0x11 bytes	C++
 	vclmi.dll!ImplWindowFrameProc(Window * pWindow=0x0afe41b8, SalFrame * __formal=0x0afe9698, unsigned short nEvent=21, const void * pEvent=0x015bf6b4)  Line 2477 + 0xd bytes	C++
 	vclmi.dll!SalFrame::CallCallback(unsigned short nEvent=21, const void * pEvent=0x015bf6b4)  Line 294 + 0x2e bytes	C++
 	vclmi.dll!ImplHandleWheelMsg(HWND__ * hWnd=0x00590184, unsigned int nMsg=522, unsigned int wParam=4279238656, long lParam=40305444)  Line 3515 + 0xe bytes	C++
 	vclmi.dll!SalFrameWndProc(HWND__ * hWnd=0x00590184, unsigned int nMsg=522, unsigned int wParam=4279238656, long lParam=40305444, int & rDef=1)  Line 5861 + 0x15 bytes	C++
 	vclmi.dll!SalFrameWndProcW(HWND__ * hWnd=0x00590184, unsigned int nMsg=522, unsigned int wParam=4279238656, long lParam=40305444)  Line 6246 + 0x19 bytes	C++
 	user32.dll!_InternalCallWinProc@20()  + 0x28 bytes	
 	user32.dll!_UserCallWinProcCheckWow@32()  + 0xb7 bytes	
 	user32.dll!_DispatchMessageWorker@8()  + 0xdc bytes	
 	user32.dll!_DispatchMessageW@4()  + 0xf bytes	
 	vclmi.dll!ImplDispatchMessage(const tagMSG * lpMsg=0x015bf8e4)  Line 152	C++
 	vclmi.dll!ImplSalDispatchMessage(tagMSG * pMsg=0x015bf8e4)  Line 663 + 0x9 bytes	C++
 	vclmi.dll!ImplSalYield(unsigned char bWait='', unsigned char bHandleAllCurrentEvents=0)  Line 681 + 0x9 bytes	C++
 	vclmi.dll!WinSalInstance::Yield(bool bWait=true, bool bHandleAllCurrentEvents=false)  Line 738 + 0xf bytes	C++
 	vclmi.dll!ImplYield(bool i_bWait=true, bool i_bAllEvents=false)  Line 460	C++
 	vclmi.dll!Application::Yield(bool i_bAllEvents=false)  Line 493 + 0xc bytes	C++
 	vclmi.dll!Application::Execute()  Line 436 + 0x7 bytes	C++
 	sofficeapp.dll!desktop::Desktop::Main()  Line 1860	C++
 	vclmi.dll!ImplSVMain()  Line 178 + 0x13 bytes	C++
 	vclmi.dll!SVMain()  Line 220	C++
 	sofficeapp.dll!soffice_main()  Line 68 + 0x5 bytes	C++
 	soffice.bin!sal_main()  Line 37	C
 	soffice.bin!main(int argc=2, char * * argv=0x05bf7cd8)  Line 35 + 0x19 bytes	C
 	soffice.bin!WinMain(void * _hinst=0x00400000, void * _dummy=0x00000000, char * _cmdline=0x0005234c, int _nshow=1)  Line 35 + 0x28 bytes	C
 	soffice.bin!__tmainCRTStartup()  Line 578 + 0x35 bytes	C
 	soffice.bin!WinMainCRTStartup()  Line 403	C
 	kernel32.dll!_BaseProcessStart@4()  + 0x23 bytes
Comment 9 Jesus Corrius 2011-02-02 06:15:42 UTC
It's fun, but if I copy the file mtfrenderer.uno.dll

from:

C:\Archivos de programa\LibreOffice 3\Basis\program

(where it's installed by default)

to:

C:\Archivos de programa\LibreOffice 3\program

I get other errors, but the LibO doesn't crash.

I guess this is a good hint ;)
Comment 10 Cor Nouws 2011-02-02 07:47:25 UTC
could be related to this one:
http://qa.openoffice.org/issues/show_bug.cgi?id=115836
Comment 11 Jesus Corrius 2011-02-03 08:52:49 UTC
It's funny because OpenOffice.org 3.3 doesn't ship mtfrenderer.uno.dll.

This commit in the master branch fixes the crash for me. I guess it should be cherry picked for the 3.3.1 version:

http://cgit.freedesktop.org/libreoffice/bootstrap/commit/?id=f03160af274dc3915f86b671e0b153eb8db943d8
Comment 12 Michael Meeks 2011-02-03 10:07:38 UTC
> This commit in the master branch fixes the crash for me. I guess it should
> be cherry picked for the 3.3.1 version:

URK! Jesus - please revert that from master. I am concerned that we 'fix' the problem, by moving / removing that library, simply to somewhere where it cannot be found - and thus, the code is not executed, and thus no crash.

No doubt just removing the mtfrenderer.uno.dll  alters behaviour - but is it really what we want to do ?

I'd like Thorsten to weigh in on it, personally.
Comment 13 Jesus Corrius 2011-02-03 10:20:32 UTC
No, Michael. It's preciselly the oposite. It wasn't found before (that's why it crashed) and now in C:\Program Files\LibreOffice 3\program is able to find and load it.

My debugger shows how is it loaded by the soffice.bin process. But I am a bit concerned that OOo doesn't ship it.
Comment 14 Jesus Corrius 2011-02-03 10:28:50 UTC
Now I am getting a more interesting exception, although LibO doesn't crash here. Here it's the stack trace:

 	kernel32.dll!_RaiseException@16()  + 0x52 bytes	
 	vclmi.dll!SalAbort(const String & rErrorText={...})  Line 98	C++
 	vclmi.dll!Application::Abort(const String & rErrorText={...})  Line 396 + 0x9 bytes	C++
 	vclmi.dll!DbgPrintMsgBox(const char * pLine=0x015b82a0)  Line 1909 + 0x32 bytes	C++
 	tlmi.dll!DbgOut(const char * pMsg=0x115dc314, unsigned short nDbgOut=3, const char * pFile=0x0cfc0b90, unsigned short nLine=0)  Line 1740 + 0x12 bytes	C++
 	tlmi.dll!dbg_printOslDebugMessage(const char * pszFileName=0x0cfc0b90, long nLine=3191, const char * pszMessage=0x115dc314)  Line 959 + 0x29 bytes	C++
 	sal3.dll!osl_assertFailedLine(const char * pszFileName=0x0cfc0b90, long nLine=3191, const char * pszMessage=0x115dc314)  Line 129 + 0x12 bytes	C
 	cppcanvasmi.dll!cppcanvas::internal::ImplRenderer::draw()  Line 3191 + 0xad bytes	C++
>	mtfrenderer.uno.dll!MtfRenderer::draw(double fScaleX=711.00000000000000, double fScaleY=505.00000000000000)  Line 51	C++
 	vclmi.dll!GDIMetaFile::ImplPlayWithRenderer(OutputDevice * pOut=0x133af584, const Point & rPos={...}, Size rDestSize={...})  Line 538 + 0x46 bytes	C++
 	vclmi.dll!GDIMetaFile::Play(OutputDevice * pOut=0x133af584, const Point & rPos={...}, const Size & rSize={...}, unsigned long nPos=4294967295)  Line 658 + 0x29 bytes	C++
 	svtmi.dll!GraphicManager::ImplDraw(OutputDevice * pOut=0x133af584, const Point & rPt={...}, const Size & rSz={...}, const GDIMetaFile & rMtf={...}, const GraphicAttr & rAttr={...})  Line 1890	C++
 	svtmi.dll!GraphicManager::ImplCreateOutput(OutputDevice * pOut=0x133af584, const Point & rPt={...}, const Size & rSz={...}, const GDIMetaFile & rMtf={...}, const GraphicAttr & rAttr={...}, const unsigned long __formal=3, GDIMetaFile & rOutMtf={...}, BitmapEx & rOutBmpEx={...})  Line 918 + 0x19 bytes	C++
 	svtmi.dll!GraphicManager::ImplDraw(OutputDevice * pOut=0x133af584, const Point & rPt={...}, const Size & rSz={...}, GraphicObject & rObj={...}, const GraphicAttr & rAttr={...}, const unsigned long nFlags=3, unsigned char & rCached=0)  Line 356 + 0x31 bytes	C++
 	svtmi.dll!GraphicManager::DrawObj(OutputDevice * pOut=0x133af584, const Point & rPt={...}, const Size & rSz={...}, GraphicObject & rObj={...}, const GraphicAttr & rAttr={...}, const unsigned long nFlags=3, unsigned char & rCached=0)  Line 260 + 0x24 bytes	C++
 	svtmi.dll!GraphicObject::Draw(OutputDevice * pOut=0x133af584, const Point & rPt={...}, const Size & rSz={...}, const GraphicAttr * pAttr=0x015bdd68, unsigned long nFlags=3)  Line 618 + 0x2d bytes	C++
 	svtmi.dll!GraphicObject::DrawWithPDFHandling(OutputDevice & rOutDev={...}, const Point & rPt={...}, const Size & rSz={...}, const GraphicAttr * pGrfAttr=0x015bdf58, const unsigned long nFlags=3)  Line 685 + 0x1f bytes	C++
 	swmi.dll!SwNoTxtFrm::PaintPicture(OutputDevice * pOut=0x133af584, const SwRect & rGrfArea={...})  Line 915	C++
 	swmi.dll!SwNoTxtFrm::Paint(const SwRect & rRect={...}, const SwPrtOptions * __formal=0x00000000)  Line 329	C++
 	swmi.dll!SwLayoutFrm::Paint(const SwRect & rRect={...}, const SwPrtOptions * __formal=0x00000000)  Line 3245	C++
 	swmi.dll!SwFlyFrm::Paint(const SwRect & rRect={...}, const SwPrtOptions * __formal=0x00000000)  Line 3672	C++
 	swmi.dll!SwFlyCntPortion::Paint(const SwTxtPaintInfo & rInf={...})  Line 269	C++
 	swmi.dll!SwTxtPainter::DrawTextLine(const SwRect & rPaint={...}, SwSaveClip & rClip={...}, const unsigned char bUnderSz=0)  Line 414	C++
 	swmi.dll!SwTxtFrm::Paint(const SwRect & rRect={...}, const SwPrtOptions * __formal=0x00000000)  Line 730	C++
 	swmi.dll!SwLayoutFrm::Paint(const SwRect & rRect={...}, const SwPrtOptions * __formal=0x00000000)  Line 3245	C++
 	swmi.dll!SwBodyFrm::Paint(const SwRect & rRect={...}, const SwPrtOptions * __formal=0x00000000)  Line 200	C++
 	swmi.dll!SwLayoutFrm::Paint(const SwRect & rRect={...}, const SwPrtOptions * __formal=0x00000000)  Line 3245	C++
 	swmi.dll!SwRootFrm::Paint(const SwRect & rRect={...}, const SwPrtOptions * pPrintData=0x00000000)  Line 2976	C++
 	swmi.dll!ViewShell::Paint(const Rectangle & rRect={...})  Line 1719	C++
 	swmi.dll!SwCrsrShell::Paint(const Rectangle & rRect={...})  Line 1167	C++
 	swmi.dll!SwEditWin::Paint(const Rectangle & rRect={...})  Line 541	C++
 	vclmi.dll!Window::ImplCallPaint(const Region * pRegion=0x00000000, unsigned short nPaintFlags=48)  Line 2433	C++
 	vclmi.dll!Window::Update()  Line 7568	C++
 	swmi.dll!ViewShell::VisPortChgd(const SwRect & rRect={...})  Line 1101	C++
 	swmi.dll!SwCrsrShell::VisPortChgd(const SwRect & rRect={...})  Line 1206	C++
 	swmi.dll!SwView::SetVisArea(const Rectangle & rRect={...}, unsigned char bUpdateScrollbar=0)  Line 271	C++
 	swmi.dll!SwView::SetVisArea(const Point & rPt={...}, unsigned char bUpdateScrollbar=0)  Line 335	C++
 	swmi.dll!SwView::EndScrollHdl(SwScrollbar * pScrollbar=0x0b132568)  Line 765	C++
 	swmi.dll!SwView::ScrollHdl(SwScrollbar * pScrollbar=0x0b132568)  Line 694	C++
 	swmi.dll!SwView::LinkStubScrollHdl(void * pThis=0x0b12e7f0, void * pCaller=0x0b132568)  Line 678 + 0xf bytes	C++
 	tlmi.dll!Link::Call(void * pCaller=0x0b132568)  Line 140 + 0x1b bytes	C++
 	vclmi.dll!Control::ImplCallEventListenersAndHandler(unsigned long nEvent=1111, const Link & rHandler={...}, void * pCaller=0x0b132568)  Line 386	C++
 	vclmi.dll!ScrollBar::Scroll()  Line 1465	C++
 	vclmi.dll!ScrollBar::ImplDragThumb(const Point & rMousePos={...})  Line 1008	C++
 	vclmi.dll!ScrollBar::Tracking(const TrackingEvent & rTEvt={...})  Line 1193	C++
 	vclmi.dll!ImplHandleMouseEvent(Window * pWindow=0x0b11ee40, unsigned short nSVEvent=3, unsigned char bMouseLeave=0, long nX=1274, long nY=319, unsigned long nMsgTime=11642531, unsigned short nCode=1, unsigned short nMode=2)  Line 765	C++
 	vclmi.dll!ImplHandleSalMouseMove(Window * pWindow=0x0b11ee40, SalMouseEvent * pEvent=0x015bf6ac)  Line 2054 + 0x39 bytes	C++
 	vclmi.dll!ImplWindowFrameProc(Window * pWindow=0x0b11ee40, SalFrame * __formal=0x0b11f158, unsigned short nEvent=1, const void * pEvent=0x015bf6ac)  Line 2376 + 0xd bytes	C++
 	vclmi.dll!SalFrame::CallCallback(unsigned short nEvent=1, const void * pEvent=0x015bf6ac)  Line 294 + 0x2e bytes	C++
 	vclmi.dll!ImplHandleMouseMsg(HWND__ * hWnd=0x00760390, unsigned int nMsg=512, unsigned int wParam=1, long lParam=20907258)  Line 3425 + 0x11 bytes	C++
 	vclmi.dll!SalFrameWndProc(HWND__ * hWnd=0x00760390, unsigned int nMsg=512, unsigned int wParam=1, long lParam=20907258, int & rDef=1)  Line 5814 + 0x15 bytes	C++
 	vclmi.dll!SalFrameWndProcW(HWND__ * hWnd=0x00760390, unsigned int nMsg=512, unsigned int wParam=1, long lParam=20907258)  Line 6246 + 0x19 bytes	C++
 	user32.dll!_InternalCallWinProc@20()  + 0x28 bytes	
 	user32.dll!_UserCallWinProcCheckWow@32()  + 0xb7 bytes	
 	user32.dll!_DispatchMessageWorker@8()  + 0xdc bytes	
 	user32.dll!_DispatchMessageW@4()  + 0xf bytes	
 	vclmi.dll!ImplDispatchMessage(const tagMSG * lpMsg=0x015bf8e4)  Line 152	C++
 	vclmi.dll!ImplSalDispatchMessage(tagMSG * pMsg=0x015bf8e4)  Line 663 + 0x9 bytes	C++
 	vclmi.dll!ImplSalYield(unsigned char bWait='', unsigned char bHandleAllCurrentEvents=0)  Line 681 + 0x9 bytes	C++
 	vclmi.dll!WinSalInstance::Yield(bool bWait=true, bool bHandleAllCurrentEvents=false)  Line 738 + 0xf bytes	C++
 	vclmi.dll!ImplYield(bool i_bWait=true, bool i_bAllEvents=false)  Line 460	C++
 	vclmi.dll!Application::Yield(bool i_bAllEvents=false)  Line 493 + 0xc bytes	C++
 	vclmi.dll!Application::Execute()  Line 436 + 0x7 bytes	C++
 	sofficeapp.dll!desktop::Desktop::Main()  Line 1860	C++
 	vclmi.dll!ImplSVMain()  Line 178 + 0x13 bytes	C++
 	vclmi.dll!SVMain()  Line 220	C++
 	sofficeapp.dll!soffice_main()  Line 68 + 0x5 bytes	C++
 	soffice.bin!sal_main()  Line 37	C
 	soffice.bin!main(int argc=2, char * * argv=0x05bf7c98)  Line 35 + 0x19 bytes	C
 	soffice.bin!WinMain(void * _hinst=0x00400000, void * _dummy=0x00000000, char * _cmdline=0x0005234c, int _nshow=1)  Line 35 + 0x28 bytes	C
 	soffice.bin!__tmainCRTStartup()  Line 578 + 0x35 bytes	C
 	soffice.bin!WinMainCRTStartup()  Line 403	C
 	kernel32.dll!_BaseProcessStart@4()  + 0x23 bytes
Comment 15 Rainer Bielefeld Retired 2011-02-08 07:56:38 UTC
Bug 34032 - Document with particular .emf crashes
might be a DUP of or related to this one. Can someone with more knowledge than me please check that?
Comment 16 Marc Kaulisch 2011-02-08 11:38:38 UTC
Trying to solve my issue in bug 34032 (https://bugs.freedesktop.org/show_bug.cgi?id=34032), I followed Jesus hint at comment 9: LO does not crash anymore but the picture is not displayed - I see that there is a picture but it looks empty.
Comment 17 Michael Meeks 2011-02-10 09:02:24 UTC
*** Bug 33894 has been marked as a duplicate of this bug. ***
Comment 18 Michael Meeks 2011-02-10 09:16:42 UTC
vclmi.dll!GDIMetaFile::ImplPlayWithRenderer is in:

vcl/source/gdi/gdimtf.cxx
   + and seems to be -totally- un-prepared for any kind of exception being thrown :-) I guess we need to have a big try/catch around all of that, and in particular the second Jesus' exception:

     xMtfRenderer->draw( rDestSize.Width(), rDestSize.Height() );

and mine (from the debugger) which claims to be from:

                xMtfRenderer.set( xFactory->createInstanceWithArguments( ::rtl::OUString::createFromAscii( "com.sun.star.rendering.MtfRenderer" ),
                                                                         args ), uno::UNO_QUERY );

Which could clearly fail if it cannot create that instance; though why it should fail is a mystery. I would -guess- (since I don't have full debuginfo) that the exception thrown from the missing component is:


    OUString aModulePath( makeComponentPath( rLibName, rPath ) );
    if (! checkAccessPath( &aModulePath ))
    {
        throw loader::CannotActivateFactoryException(
            OUSTR("permission denied to load component library: ") +
            aModulePath,
            Reference< XInterface >() );
    }

since it seems to happen very early, and we get a CannotAcivateFactoryException.
Comment 19 Michael Meeks 2011-02-10 09:31:18 UTC
So Jesus - sorry for comment #11 - of course you're right the renderer is in completely the wrong place - nothing else is in the basis/ directory on Windows ; we should back merge that patch ASAP. I'll try to get a 3rd review for it.
Comment 20 Michael Meeks 2011-02-10 09:43:10 UTC
I've committed a belt+braces other half of this to master - to catch any exceptions thrown inside all that UNO logic; otherwise we simply crash - potentially we might want to have that in 3.3.1 as well, as a belt+braces fix.
Comment 21 Jan Holesovsky 2011-02-10 09:48:55 UTC
The scp2 patch looks good to me - please get it to 3.3.1.  And adding an Easy Hack to remove the basis and brand layer distinction out of the LibO sources.
Comment 22 Jesus Corrius 2011-02-10 09:55:35 UTC
/me making a new Win32 debug build of the master branch to test the fixes.
Comment 23 Thorsten Behrens (allotropia) 2011-02-10 10:07:44 UTC
Yes, patch is alright - let's have it for 3.3.1
Comment 24 Michael Meeks 2011-02-10 12:55:02 UTC
I've merged Jesus' fix into libreoffice-3-3-1 - it should be in 3.3.1 it might be nice to have the master exception catching fix too, ie:

http://cgit.freedesktop.org/libreoffice/libs-gui/commit/?id=29e6053738f10979a9a282d4c14de1af0e5538ab

if the rename doesn't help - I suspect it still breaks for me, since the library is owned by the wrong people, and I'm using the test doc from: bug #33894.
Comment 25 Fridrich Strba 2011-02-14 06:37:52 UTC
OK for inclusion of http://cgit.freedesktop.org/libreoffice/libs-gui/commit/?id=29e6053738f10979a9a282d4c14de1af0e5538ab in the libreoffice-3-3-1 branch
Comment 26 Fridrich Strba 2011-02-14 23:54:52 UTC
Just tested a build of libreoffice-3-3-1 branch with the sal_True -> sal_False change and the emf file previews are displayed correctly.
Comment 27 Michael Meeks 2011-02-15 04:48:49 UTC
Pushed the exception catch, and disabling to libreoffice-3-3 (thanks).
Pushed the disabling EMF+ on Win32 to libreoffice-3-3-1.
Comment 28 hmoi 2011-03-09 19:56:16 UTC
Bug 34245 
might be a DUP of or related to this one. Could anyone please check that?
Comment 29 Rainer Bielefeld Retired 2011-03-09 21:15:13 UTC
Indeed, seems to be fixed  for "LibreOffice 3.3.1  – WIN7  Home Premium  (64bit) German UI [OOO330m19 (build 8 / tag 3.3.1.2)]". I can't reproduce a crash any longer.

Concerning Bug 34245 I can confirm that the problem has vanished with my a.m. current OOo version.
Comment 30 Marc Kaulisch 2011-04-13 01:17:33 UTC
*** Bug 30721 has been marked as a duplicate of this bug. ***
Comment 31 Marc Kaulisch 2011-04-13 01:22:28 UTC
*** Bug 34172 has been marked as a duplicate of this bug. ***
Comment 32 Marc Kaulisch 2011-04-13 01:26:00 UTC
*** Bug 32119 has been marked as a duplicate of this bug. ***
Comment 33 Marc Kaulisch 2011-04-13 01:36:17 UTC
*** Bug 33572 has been marked as a duplicate of this bug. ***
Comment 34 Marc Kaulisch 2011-04-13 01:38:46 UTC
*** Bug 34032 has been marked as a duplicate of this bug. ***