Summary: | remote / python / UNO malfunctions | ||
---|---|---|---|
Product: | LibreOffice | Reporter: | Michael Meeks <michael.meeks> |
Component: | Libreoffice | Assignee: | Björn Michaelsen <bjoern.michaelsen> |
Status: | CLOSED FIXED | QA Contact: | |
Severity: | major | ||
Priority: | medium | CC: | lemoyne.castle |
Version: | 3.4.0 Beta4 | ||
Hardware: | Other | ||
OS: | All | ||
Whiteboard: | |||
i915 platform: | i915 features: |
Description
Michael Meeks
2011-05-17 09:00:17 UTC
The basic problem seems to be (put a break in 'shutdown') that we close the connection while we would still rather be reading & writing to it ;-) - magically, from another thread; thus: Thread 4 (Thread 0xb63ddb70 (LWP 23311)): #0 0xb7d54510 in shutdown () from /lib/libc.so.6 #1 0xb7a5d030 in osl_shutdownSocket () from /opt/OOInstall/basis3.4/program/../ure-link/lib/libuno_sal.so.3 #2 0xb6c64280 in osl::Socket::shutdown (this=0xb6c9e8d4, Direction=osl_Socket_DirReadWrite) at /data/opt/libreoffice/bootstrap/solver/340/unxlngi6.pro/inc/osl/socket.hxx:259 #3 0xb6c63ca6 in stoc_connector::SocketConnection::close (this=0xb6c9e8b8) at /data/opt/libreoffice/bootstrap/clone/ure/io/source/connector/ctr_socket.cxx:228 #4 0xb6c1bc7f in binaryurp::Bridge::terminate (this=0xb6c9d9b0) at /data/opt/libreoffice/bootstrap/clone/ure/binaryurp/source/bridge.cxx:253 #5 0xb6c38ff9 in binaryurp::Reader::run (this=0xb63de008) at /data/opt/libreoffice/bootstrap/clone/ure/binaryurp/source/reader.cxx:152 #6 0xb6c20b9a in osl::threadFunc (param=0xb63de008) at /data/opt/libreoffice/bootstrap/solver/340/unxlngi6.pro/inc/osl/thread.hxx:188 #7 0xb7a5e1b8 in ?? () from /opt/OOInstall/basis3.4/program/../ure-link/lib/libuno_sal.so.3 #8 0xb7e25b05 in start_thread () from /lib/libpthread.so.0 #9 0xb7d52d5e in clone () from /lib/libc.so.6 Thread 3 (Thread 0xb6beeb70 (LWP 23310)): #0 0xffffe424 in __kernel_vsyscall () #1 0xb7e2a105 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/libpthread.so.0 #2 0xb7a5b390 in osl_waitCondition () from /opt/OOInstall/basis3.4/program/../ure-link/lib/libuno_sal.so.3 #3 0xb6c212ce in osl::Condition::wait (this=0xb6c9dc0c, pTimeout=0x0) at /data/opt/libreoffice/bootstrap/solver/340/unxlngi6.pro/inc/osl/conditn.hxx:84 #4 0xb6c3ea34 in binaryurp::Writer::run (this=0xb6c9db70) at /data/opt/libreoffice/bootstrap/clone/ure/binaryurp/source/writer.cxx:160 #5 0xb6c20b9a in osl::threadFunc (param=0xb6c9db70) at /data/opt/libreoffice/bootstrap/solver/340/unxlngi6.pro/inc/osl/thread.hxx:188 #6 0xb7a5e1b8 in ?? () from /opt/OOInstall/basis3.4/program/../ure-link/lib/libuno_sal.so.3 #7 0xb7e25b05 in start_thread () from /lib/libpthread.so.0 #8 0xb7d52d5e in clone () from /lib/libc.so.6 Thread 2 (Thread 0xb7920b70 (LWP 23298)): #0 0xffffe424 in __kernel_vsyscall () #1 0xb7e2a432 in pthread_cond_timedwait@@GLIBC_2.3.2 () from /lib/libpthread.so.0 #2 0xb7a7eb3c in ?? () from /opt/OOInstall/basis3.4/program/../ure-link/lib/libuno_sal.so.3 #3 0xb7e25b05 in start_thread () from /lib/libpthread.so.0 #4 0xb7d52d5e in clone () from /lib/libc.so.6 Thread 1 (Thread 0xb7c7e6c0 (LWP 23297)): #0 0xffffe424 in __kernel_vsyscall () #1 0xb7e2a105 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/libpthread.so.0 #2 0xb7a5b390 in osl_waitCondition () from /opt/OOInstall/basis3.4/program/../ure-link/lib/libuno_sal.so.3 #3 0xb7b44205 in ?? () from /opt/OOInstall/basis3.4/program/../ure-link/lib/libuno_cppu.so.3 #4 0xb7b413d6 in ?? () from /opt/OOInstall/basis3.4/program/../ure-link/lib/libuno_cppu.so.3 #5 0xb7b41a37 in uno_threadpool_enter () from /opt/OOInstall/basis3.4/program/../ure-link/lib/libuno_cppu.so.3 #6 0xb6c1db2a in binaryurp::Bridge::makeCall (this=0xb6c9d9b0, oid=..., member=..., setter=false, inArguments=..., returnValue=0xbfffdd58, outArguments=0xbfffdd4c) at /data/opt/libreoffice/bootstrap/clone/ure/binaryurp/source/bridge.cxx:572 #7 0xb6c3817c in binaryurp::Proxy::do_dispatch_throw (this=0x8118b88, member=0x80f8e48, returnValue=0xbfffe234, arguments=0xbfffdeb0, exception=0xbfffdf24) at /data/opt/libreoffice/bootstrap/clone/ure/binaryurp/source/proxy.cxx:191 #8 0xb6c37bdb in binaryurp::Proxy::do_dispatch (this=0x8118b88, member=0x80f8e48, returnValue=0xbfffe234, arguments=0xbfffdeb0, exception=0xbfffdf24) at /data/opt/libreoffice/bootstrap/clone/ure/binaryurp/source/proxy.cxx:117 #9 0xb6c37938 in binaryurp::(anonymous namespace)::proxy_dispatchInterface (pUnoI=0x8118b88, pMemberType=0x80f8e48, pReturn=0xbfffe234, pArgs=0xbfffdeb0, ppException=0xbfffdf24) at /data/opt/libreoffice/bootstrap/clone/ure/binaryurp/source/proxy.cxx:70 #10 0xb6df6033 in ?? () from /data/opt/OOInstall/ure/lib/libgcc3_uno.so #11 0xb6df665a in ?? () from /data/opt/OOInstall/ure/lib/libgcc3_uno.so #12 0xb6df7165 in ?? () from /data/opt/OOInstall/ure/lib/libgcc3_uno.so #13 0xb6cc7d26 in ?? () from /data/opt/OOInstall/ure/lib/introspection.uno.so #14 0xb6ccaf26 in ?? () from /data/opt/OOInstall/ure/lib/introspection.uno.so #15 0xb6cfc4e2 in ?? () from /data/opt/OOInstall/ure/lib/invocation.uno.so #16 0xb6cfc917 in ?? () from /data/opt/OOInstall/ure/lib/invocation.uno.so #17 0xb6cfca3a in ?? () from /data/opt/OOInstall/ure/lib/invocation.uno.so #18 0xb7b61bf2 in pyuno::PyUNO_new_UNCHECKED(com::sun::star::uno::Any const&, com::sun::star::uno::Reference<com::sun::star::lang::XSingleServiceFactory> const&) () from /opt/OOInstall/basis3.4/program/pyuno.so #19 0xb7b61ce5 in pyuno::PyUNO_new(com::sun::star::uno::Any const&, com::sun::star::uno::Reference<com::sun::star::lang::XSingleServiceFactory> const&) () from /opt/OOInstall/basis3.4/program/pyuno.so #20 0xb7b5ba9d in pyuno::Runtime::any2PyObject(com::sun::star::uno::Any const&) const () from /opt/OOInstall/basis3.4/program/pyuno.so #21 0xb7b63899 in pyuno::PyUNO_callable_call(_object*, _object*, _object*) () from /opt/OOInstall/basis3.4/program/pyuno.so ... which occurs just before the main thread gets its answer back and we get the exception. That seems a bit enthusiastic of thread 4. #5 0xb6c38ff9 in binaryurp::Reader::run (this=0xb63de008) at /data/opt/libreoffice/bootstrap/clone/ure/binaryurp/source/reader.cxx:152 152 bridge_->terminate(); (gdb) l 147 OSL_LOG_PREFIX "caught UNO exception '%s'", 148 rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8).getStr()); 149 } catch (std::exception & e) { 150 OSL_TRACE(OSL_LOG_PREFIX "caught C++ exception '%s'", e.what()); 151 } 152 bridge_->terminate(); 153 } 154 Do we -really- want to terminate the bridge after each 'run' call ? Surely we can re-use the socket. 238 void Bridge::terminate() { 239 rtl::Reference< Reader > r; 240 rtl::Reference< Writer > w; 241 Listeners ls; 242 { 243 osl::MutexGuard g(mutex_); 244 if (terminated_) { (gdb) 245 return; 246 } 247 std::swap(reader_, r); 248 std::swap(writer_, w); 249 ls.swap(listeners_); 250 terminated_ = true; 251 } 252 try { 253 connection_->close(); 254 } catch (css::io::IOException & e) { All looks most odd to me :-) Ho hum - the reason the cnx is shutdown, is due to an earlier exception being thrown, from here: #4 0xb6da1165 in ?? () from /data/opt/OOInstall/ure/lib/libgcc3_uno.so #5 0xb6c4aea3 in stoc_inspect::ImplIntrospection::implInspect (this=0xb6cb4290, aToInspectObj=...) at /data/opt/libreoffice/bootstrap/clone/ure/stoc/source/inspect/introspection.cxx:2070 #6 0xb6c4a924 in stoc_inspect::ImplIntrospection::inspect (this=0xb6cb4290, aToInspectObj=...) at /data/opt/libreoffice/bootstrap/clone/ure/stoc/source/inspect/introspection.cxx:1955 #7 0xb6c9ca9a in stoc_inv::Invocation_Impl::setMaterial (this=0xb6bec89c, rMaterial=...) at /data/opt/libreoffice/bootstrap/clone/ure/stoc/source/invocation/invocation.cxx:426 #8 0xb6c9bc3a in stoc_inv::Invocation_Impl::Invocation_Impl (this=0xb6bec89c, rAdapted=..., rTC=..., rI=..., rCR=...) at /data/opt/libreoffice/bootstrap/clone/ure/stoc/source/invocation/invocation.cxx:284 #9 0xb6ca0622 in stoc_inv::InvocationService::createInstanceWithArguments (this=0xb70e37e8, rArguments=...) at /data/opt/libreoffice/bootstrap/clone/ure/stoc/source/invocation/invocation.cxx:1205 #10 0xb7b61bf2 in pyuno::PyUNO_new_UNCHECKED(com::sun::star::uno::Any const&, com::sun::star::uno::Reference<com::sun::star::lang::XSingleServiceFactory> const&) () from /opt/OOInstall/basis3.4/program/pyuno.so #11 0xb7b61ce5 in pyuno::PyUNO_new(com::sun::star::uno::Any const&, com::sun::star::uno::Reference<com::sun::star::lang::XSingleServiceFactory> const&) () from /opt/OOInstall/basis3.4/program/pyuno.so #12 0xb7b5ba9d in pyuno::Runtime::any2PyObject(com::sun::star::uno::Any const&) const () from /opt/OOInstall/basis3.4/program/pyuno.so #13 0xb7b63899 in pyuno::PyUNO_callable_call(_object*, _object*, _object*) () from /opt/OOInstall/basis3.4/program/pyuno.so #14 0xb7ec2b40 in PyObject_Call (func=0xb7c6f130, arg=0xb7c325cc, kw=0x0) at Objects/abstract.c:2522 #15 0xb7ede4d3 in do_call (f=0x80d1e3c, throwflag=0) at Python/ceval.c:4230 #16 call_function (f=0x80d1e3c, throwflag=0) at Python/ceval.c:4035 #17 PyEval_EvalFrameEx (f=0x80d1e3c, throwflag=0) at Python/ceval.c:2665 I guess something goes badly wrong in the introspection mechanics - as if by a miracle [etc.] following the discussion at http://nabble.documentfoundation.org/python-XInvocation-snafu-td2961502.html I had a look at VclStringResourceLoader and it is broken beyond repair. With commit http://cgit.freedesktop.org/libreoffice/components/commit/?h=feature/gsoc2011_wizards&id=264c9ed93f3d338f6aee84310135569710705783 I removed the broken service and implemented a org.libreoffice.extensions.resource.ResourceStringIndexAccess service as a replacement. Here is a piece of Basic code that shows how to use it (inspired by http://opengrok.libreoffice.org/xref/components/wizards/com/sun/star/wizards/common/TerminateWizardException.java ): Sub Main dim xSM dim xContext dim xRSIA as Object dim aArgs(0) aArgs(0) = "dbw" xSM = GetProcessServiceManager() xContext = xSM.DefaultContext xRSIA = xSM.createInstanceWithArguments("org.libreoffice.resource.ResourceStringIndexAccess", aArgs) msgbox xRSIA.getByIndex(1006) end sub I commited the change to the feature branch gsoc2011_wizards as this change would break master because I have not yet changed the clients of VclStringResourceLoader to use ResourceStringIndexAccess instead. Because in some places also StringLists are needed as resources, I had to change the API has to take care of that too. Here is an updated example: Sub Main dim xSM dim xContext dim xRessouceIndexAccess as Object dim xStringIndexAccess as Object dim xStringListIndexAcess as Object dim pv() as Object dim aArgs(0) aArgs(0) = "svt" xSM = GetProcessServiceManager() xResourceIndexAccess = xSM.createInstanceWithArguments( _ "org.libreoffice.resource.ResourceIndexAccess", _ aArgs) xStringListIndexAccess = xResourceIndexAccess.getByName("StringList") pv = xStringListIndexAccess.getByIndex(16633) msgbox pv(0).Name msgbox pv(0).Value xStringIndexAccess = xResourceIndexAccess.getByName("String") msgbox xStringIndexAccess.getByIndex(16390) end sub closing as fixed on master closing |
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.