[Ubuntu] [hardy] python-uno: doc.dispose() crashes with "Fatal Python error: PyImport_GetModuleDict: no module dictionary!"

Bug #180964 reported by Thomas Bleher
6
Affects Status Importance Assigned to Milestone
openoffice.org (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

Binary package hint: python-uno

Steps to reproduce:
$ cd /usr/share/doc/openoffice.org/python-uno-demo
$ ooffice -headless '-accept=socket,host=localhost,port=2002;urp;'
$ python ooextract.py ../copyright > /dev/null
Fatal Python error: PyImport_GetModuleDict: no module dictionary!
Aborted (core dumped)
$ uname -m
x86_64
$ dpkg -p python-uno | grep -i version
Version: 1:2.3.0-1ubuntu5.3
Python-Version: 2.5

This is on a Gutsy machine, with all updates. The ooextract.py script fails on all documents I tried. Actually, it outputs the text just fine (like it's supposed to be), but it dies when cleaning up, namely on "doc.dispose()". Unfortunately, leaving this out causes the openoffice server process to leak memory, so this is no solution.

Tags: python-uno
Revision history for this message
Jason Toffaletti (jason) wrote :

I was able to reproduce this with this additional information.
The crash is occurring inside the garbage collection thread after the script has called sys.exit().

jason@hardy:~$ PYUNO_LOGLEVEL=ARGS python ooextract.py copyright
2008-01-16 14:53:39,197 [CALL,tid 1]: Instantiating pyuno bridge
Text (Encoded)
2008-01-16 14:53:39,256 [CALL,tid 1]: try py->uno[0x822c280].createInstanceWithContext((string)"com.sun.star.bridge.UnoUrlResolver", (com.sun.star.uno.XComponentContext)0x81ebe34)
2008-01-16 14:53:39,272 [CALL,tid 1]: success py->uno[0x822c280].createInstanceWithContext()=(com.sun.star.uno.XInterface)0x8236db0
2008-01-16 14:53:39,273 [CALL,tid 1]: try py->uno[0x8239e48].resolve((string)"uno:socket,host=localhost,port=2002;urp;StarOffice.ComponentContext")
2008-01-16 14:53:39,404 [CALL,tid 1]: success py->uno[0x8239e48].resolve()=(com.sun.star.uno.XInterface)0x81cb22c
2008-01-16 14:53:39,417 [CALL,tid 1]: try py->uno[0x8249370].createInstanceWithContext((string)"com.sun.star.frame.Desktop", (com.sun.star.uno.XInterface)0x81cb22c)
2008-01-16 14:53:39,417 [CALL,tid 1]: success py->uno[0x8249370].createInstanceWithContext()=(com.sun.star.uno.XInterface)0x824a1f4
2008-01-16 14:53:39,961 [CALL,tid 1]: try py->uno[0x824db20].loadComponentFromURL((string)"file:///home/jason/copyright", (string)"_blank", (byte)0x0, ([]any){ (any){ (com.sun.star.beans.PropertyValue){ Name = (string)"Hidden", Handle = (long)0x0, Value = (any){ (boolean)true }, State = (com.sun.star.beans.PropertyState)DIRECT_VALUE } } })
2008-01-16 14:53:40,169 [CALL,tid 1]: success py->uno[0x824db20].loadComponentFromURL()=(com.sun.star.lang.XComponent)0x827681c
2008-01-16 14:53:40,221 [CALL,tid 1]: try py->uno[0x8277030].dispose()
2008-01-16 14:53:40,329 [CALL,tid 1]: success py->uno[0x8277030].dispose()=void
Fatal Python error: PyImport_GetModuleDict: no module dictionary!
Aborted (core dumped)

(gdb) info threads
* 5 Thread 0xb5d98b90 (LWP 19348) 0xb7fb6410 in __kernel_vsyscall ()
  3 Thread 0xb6599b90 (LWP 19343) 0xb7fb6410 in __kernel_vsyscall ()
  2 Thread 0xb6d9ab90 (LWP 19341) 0xb7fb6410 in __kernel_vsyscall ()
  1 Thread 0xb7e128c0 (LWP 19332) 0xb7fb6410 in __kernel_vsyscall ()
(gdb) bt
#0 0xb7fb6410 in __kernel_vsyscall ()
#1 0xb7e3df35 in raise () from /lib/tls/i686/cmov/libc.so.6
#2 0xb7e3f8b1 in abort () from /lib/tls/i686/cmov/libc.so.6
#3 0x080e8677 in Py_FatalError (msg=0x8134f4c "PyImport_GetModuleDict: no module dictionary!") at ../Python/pythonrun.c:1561
#4 0x080df147 in PyImport_AddModule (name=0xb7c423ed "__main__") at ../Python/import.c:365
#5 0xb7c27b64 in ?? () from /usr/lib/openoffice/program/libpyuno.so
#6 0xb7c27ee5 in pyuno::Runtime::Runtime () from /usr/lib/openoffice/program/libpyuno.so
#7 0xb7c41dcd in pyuno::GCThread::run () from /usr/lib/openoffice/program/libpyuno.so
#8 0xb7c41fe2 in threadFunc () from /usr/lib/openoffice/program/libpyuno.so
#9 0xb797f5ed in ?? () from /usr/lib/openoffice/program/libuno_sal.so.3

Changed in openoffice.org:
status: New → Triaged
importance: Undecided → Medium
Revision history for this message
Jason Toffaletti (jason) wrote :

I reproduced this on hardy i386 using the latest python-uno and openoffice packages:
python-uno 1:2.3.1-3ubuntu2

Revision history for this message
Jason Toffaletti (jason) wrote :

I talked to the Ubuntu openoffice maintainer and he suggested that most bugs in the Uno API are due to openoffice being compiled with gcj current, which doesn't provide the same level of java support as sun's java compiler. This should change once openjava (icedtea) is used to compile openoffice. This will likely happen in hardy or hardy+1.

Revision history for this message
Paulo Fidalgo (o-kanniball-o) wrote :

In a fedora 8 machine I've solved this problem by installing pydict package.
yum info pydict
Installed Packages
Name : pydict
Arch : noarch
Version: 0.3.0
Release: 11.fc8
Size : 5.1 M
Repo : installed
Summary: English/Chinese Dictionary written with python/gtk
Description:
This is an English/Chinese Dictionary wirtten by Daniel Gau with
python/gtk. The word base was originally in xdict, and was
converted and modified by Daniel Gau and bv1al. This program can be
run in both console mode and X Window GUI mode.

Chris Cheney (ccheney)
Changed in openoffice.org:
status: Triaged → Confirmed
status: Confirmed → In Progress
Revision history for this message
Chris Cheney (ccheney) wrote :

I got a different error when attempting to run it against 1:2.4.1-1ubuntu1. Does anyone know what this means?

ccheney@laptop-c2d:/usr/share/doc/openoffice.org/python-uno-demo$ PYUNO_LOGLEVEL=ARGS python ooextract.py ../copyright
2008-06-14 00:09:18,698 [CALL,tid 1]: Instantiating pyuno bridge
Text (Encoded)
2008-06-14 00:09:18,732 [CALL,tid 1]: try py->uno[0x82303a0].createInstanceWithContext((string)"com.sun.star.bridge.UnoUrlResolver", (com.sun.star.uno.XComponentContext)0x81f3364)
2008-06-14 00:09:18,734 [CALL,tid 1]: success py->uno[0x82303a0].createInstanceWithContext()=(com.sun.star.uno.XInterface)0x823ca98
2008-06-14 00:09:18,735 [CALL,tid 1]: try py->uno[0x823e1a0].resolve((string)"uno:socket,host=localhost,port=2002;urp;StarOffice.ComponentContext")
2008-06-14 00:09:18,747 [CALL,tid 1]: success py->uno[0x823e1a0].resolve()=(com.sun.star.uno.XInterface)0x82354fc
2008-06-14 00:09:18,754 [CALL,tid 1]: try py->uno[0x824c7b0].createInstanceWithContext((string)"com.sun.star.frame.Desktop", (com.sun.star.uno.XInterface)0x82354fc)
2008-06-14 00:09:18,754 [CALL,tid 1]: success py->uno[0x824c7b0].createInstanceWithContext()=(com.sun.star.uno.XInterface)0x824c9bc
2008-06-14 00:09:18,768 [CALL,tid 1]: try py->uno[0x824fa18].loadComponentFromURL((string)"file:///usr/share/doc/openoffice.org-core/copyright", (string)"_blank", (byte)0x0, ([]any){ (any){ (com.sun.star.beans.PropertyValue){ Name = (string)"Hidden", Handle = (long)0x0, Value = (any){ (boolean)true }, State = (com.sun.star.beans.PropertyState)DIRECT_VALUE } } })
2008-06-14 00:09:18,853 [CALL,tid 1]: success py->uno[0x824fa18].loadComponentFromURL()=(com.sun.star.lang.XComponent)0x0
Error (<class 'uno.com.sun.star.uno.Exception'>) during conversion:Couldn't open stream for unknown reason

Changed in openoffice.org:
status: In Progress → Incomplete
Revision history for this message
Chris Cheney (ccheney) wrote :

We are closing this bug report because it lacks the information we need to investigate the problem, as described in the previous comments. Please reopen it if you can give us the missing information, and don't hesitate to submit bug reports in the future. To reopen the bug report you can click on the current status, under the Status column, and change the Status back to "New". Thanks again!

Changed in openoffice.org:
importance: Medium → Undecided
status: Incomplete → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.