Issue 100367

Summary: Uno objects that contain members that have different life-time dependencies must not be destroyed in the dtor.
Product: Calc Reporter: carsten.driesner
Component: codeAssignee: AOO issues mailing list <issues>
Status: CONFIRMED --- QA Contact:
Severity: Trivial    
Priority: P3 CC: issues
Version: OOO310m5   
Target Milestone: ---   
Hardware: All   
OS: All   
Issue Type: DEFECT Latest Confirmation in: ---
Developer Difficulty: ---

Description carsten.driesner 2009-03-19 15:53:50 UTC
Uno objects that contain members that have different life-time dependencies must
not be destroyed in the dtor. This is a real problem when Java applications uses
the remote bridge and keep references to these UNO objects. The dtor is called
late during the shutdown phase which leads to deadlocks or crashes. For example
look at the following call stack which shows a deadlock (without the deadlock
the code would crash only some lines later).

Main thread:
 	remotebridge.uno.dll!remotebridges_bridge::ORemoteBridge::disposing()  Line
361	C++
 	cppuhelper3MSC.dll!cppu::OComponentHelper::dispose()  Line 184 + 0x9 bytes	C++
 	offaccmi.dll!desktop::Acceptor::~Acceptor()  Line 107 + 0x17 bytes	C++
 	offaccmi.dll!desktop::Acceptor::`scalar deleting destructor'()  + 0xb bytes	C++
 	cppuhelper3MSC.dll!cppu::OWeakObject::release()  Line 236	C++
 	sofficeapp.dll!_STL::pair<rtl::OUString const
,com::sun::star::uno::Reference<com::sun::star::lang::XInitialization>
>::`scalar deleting destructor'()  + 0x56 bytes	C++
 	sofficeapp.dll!_STL::_Rb_tree<rtl::OUString,_STL::pair<rtl::OUString const
,com::sun::star::uno::Reference<com::sun::star::lang::XInitialization>
>,_STL::_Select1st<_STL::pair<rtl::OUString const
,com::sun::star::uno::Reference<com::sun::star::lang::XInitialization> >
>,_STL::less<rtl::OUString>,_STL::allocator<_STL::pair<rtl::OUString const
,com::sun::star::uno::Reference<com::sun::star::lang::XInitialization> > >
>::_M_erase(_STL::_Rb_tree_node<_STL::pair<rtl::OUString const
,com::sun::star::uno::Reference<com::sun::star::lang::XInitialization> > > *
__x=key={"pipe,name=macromigrationwizard;urp;"} data={0x616764e8})  Line 642	C++
 	sofficeapp.dll!_STL::_Rb_tree<rtl::OUString,_STL::pair<rtl::OUString const
,com::sun::star::uno::Reference<com::sun::star::lang::XInitialization>
>,_STL::_Select1st<_STL::pair<rtl::OUString const
,com::sun::star::uno::Reference<com::sun::star::lang::XInitialization> >
>,_STL::less<rtl::OUString>,_STL::allocator<_STL::pair<rtl::OUString const
,com::sun::star::uno::Reference<com::sun::star::lang::XInitialization> > >
>::clear()  Line 448	C++
 	sofficeapp.dll!desktop::Desktop::DeregisterServices()  Line 399	C++
>	sofficeapp.dll!desktop::Desktop::Main()  Line 1628	C++
 	vclmi.dll!ImplSVMain()  Line 196	C++
 	vclmi.dll!SVMain()  Line 237	C++
 	sofficeapp.dll!soffice_main()  Line 54	C++
 	soffice.bin!0040101b() 	
 	soffice.bin!0040103c() 	
 	soffice.bin!004011e6() 	
 	kernel32.dll!77e6f23b() 	

UNO thread:
 	ntdll.dll!_KiFastSystemCallRet@0() 	
 	ntdll.dll!_NtWaitForSingleObject@12()  + 0xc bytes	
 	ntdll.dll!_RtlpWaitOnCriticalSection@8()  - 0xe4 bytes	
 	ntdll.dll!_RtlEnterCriticalSection@4()  + 0x22f21 bytes	
 	sal3.dll!osl_acquireMutex(_oslMutexImpl * Mutex=0x01d18598)  Line 146	C
 	vos3MSC.dll!vos::OMutex::acquire()  Line 63 + 0xb bytes	C++
 	vclmi.dll!SalYieldMutex::acquire()  Line 119	C++
 	scmi.dll!vos::OGuard::OGuard(vos::IMutex & rMutex={...})  Line 130 + 0x5 bytes	C++
 	scmi.dll!ScUnoGuard::ScUnoGuard()  Line 45 + 0x1f bytes	C++
 	scmi.dll!ScCellTextData::~ScCellTextData()  Line 981 + 0x8 bytes	C++
 	scmi.dll!ScCellTextData::`scalar deleting destructor'()  + 0xb bytes	C++
 	scmi.dll!ScCellEditSource::~ScCellEditSource()  Line 185	C++
 	scmi.dll!ScCellEditSource::`scalar deleting destructor'()  + 0xb bytes	C++
	scmi.dll!ScCellFieldObj::~ScCellFieldObj()  Line 543	C++
 	scmi.dll!ScCellFieldObj::`scalar deleting destructor'()  + 0xb bytes	C++
 	cppuhelper3MSC.dll!cppu::OWeakObject::release()  Line 236	C++
 	cppuhelper3MSC.dll!cppu::OWeakAggObject::release()  Line 285 + 0x6 bytes	C++
 	cppuhelper3MSC.dll!cppu::OComponentHelper::release()  Line 119 + 0x6 bytes	C++
 	cppuhelper3MSC.dll!cppu::OComponentHelper::release()  Line 113 + 0x11 bytes	C++
 
msci_uno.dll!bridges::cpp_uno::shared::freeUnoInterfaceProxy(_uno_ExtEnvironment
* pEnv=0x03d84240, void * pProxy=0x0c3e78e8)  Line 59	C++
 	cppu3.dll!s_stub_defenv_revokeInterface(char * * pParam=0x00000000)  Line 412	C++
 	cppu3.dll!s_environment_invoke_v(_uno_Environment * pCurrEnv=0x00000000,
_uno_Environment * pTargetEnv=0x03d84240, void (char * *)* pCallee=0x6574e6ff,
char * * pParam=0x0a8ffd74)  Line 295 + 0x6 bytes	C++
 	cppu3.dll!uno_Environment_invoke_v(_uno_Environment * pTargetEnv=0x03d84240,
void (char * *)* pCallee=0x6574e6ff, char * * pParam=0x0a8ffd74)  Line 314 +
0x14 bytes	C++
 	cppu3.dll!uno_Environment_invoke(_uno_Environment * pEnv=0x03d84240, void
(char * *)* pCallee=0x6574e6ff, ...)  Line 323 + 0xf bytes	C++
 	cppu3.dll!defenv_revokeInterface(_uno_ExtEnvironment * pEnv=0x03d84240, void *
pInterface=0x0c3e78e8)  Line 466 + 0x13 bytes	C++
 	msci_uno.dll!bridges::cpp_uno::shared::releaseProxy(_uno_Interface *
pUnoI=0x0c3e78e8)  Line 99 + 0xb bytes	C++
 	urp_uno.dll!bridges_remote::Uno2RemoteStub::~Uno2RemoteStub()  Line 332	C++
 	urp_uno.dll!bridges_remote::Uno2RemoteStub::`scalar deleting destructor'() 
+ 0xb bytes	C++
 	urp_uno.dll!bridges_remote::freeUno2RemoteStub(_uno_ExtEnvironment *
__formal=0x03e0c430, void * stub=0x0c491a80)  Line 292	C++
 	cppu3.dll!s_stub_defenv_revokeInterface(char * * pParam=0x00000000)  Line 412	C++
 	cppu3.dll!s_environment_invoke_v(_uno_Environment * pCurrEnv=0x00000000,
_uno_Environment * pTargetEnv=0x03e0c430, void (char * *)* pCallee=0x6574e6ff,
char * * pParam=0x0a8ffe70)  Line 295 + 0x6 bytes	C++
 	cppu3.dll!uno_Environment_invoke_v(_uno_Environment * pTargetEnv=0x03e0c430,
void (char * *)* pCallee=0x6574e6ff, char * * pParam=0x0a8ffe70)  Line 314 +
0x14 bytes	C++
 	cppu3.dll!uno_Environment_invoke(_uno_Environment * pEnv=0x03e0c430, void
(char * *)* pCallee=0x6574e6ff, ...)  Line 323 + 0xf bytes	C++
 	cppu3.dll!defenv_revokeInterface(_uno_ExtEnvironment * pEnv=0x03e0c430, void *
pInterface=0x0c4827c8)  Line 466 + 0x13 bytes	C++
 	urp_uno.dll!thisRelease(remote_Interface * pThis=0x0c4827c8)  Line 61 + 0xb
bytes	C++
 	urp_uno.dll!bridges_urp::ServerMultiJob::execute()  Line 697	C++
 	urp_uno.dll!doit(void * job=0x0c4ce300)  Line 73	C++
 	cppu3.dll!cppu_threadpool::JobQueue::enter(__int64
nDisposeId=768553061603255960, unsigned char bReturnWhenNoJob='')  Line 121	C++
 	cppu3.dll!cppu_threadpool::ORequestThread::run()  Line 201	C++
 	cppu3.dll!cppu_requestThreadWorker(void * pVoid=0x03e6a698)  Line 50	C++
 	sal3.dll!oslWorkerWrapperFunction(void * pData=0x03e6a810)  Line 71 + 0x9 bytes	C
 	msvcr90.dll!78543433() 	
 	[Frames below may be incorrect and/or missing, no symbols loaded for msvcr90.dll]	
 	msvcr90.dll!785434c7() 	
 	kernel32.dll!77e64829()
Comment 1 carsten.driesner 2009-03-19 15:55:35 UTC
The last two lines of the main thread were missing:

 	sal3.dll!osl_waitCondition(void * Condition=0x000004e8, const TimeValue *
pTimeout=0x00000000)  Line 111 + 0x10 bytes	C
 	urp_uno.dll!RemoteEnvironment_thisDispose(_uno_Environment *
pEnvRemote=0x03e0c430)  Line 314 + 0x8 bytes	C++
Comment 2 Marcus 2017-05-20 11:11:50 UTC
Reset assigne to the default "issues@openoffice.apache.org".