Bug 731455

Summary: libreoffice-kde4 crashes because QPixmaps are created outside the main thread
Product: [openSUSE] openSUSE 12.1 Reporter: Christian Ehrlicher <ch.ehrlicher>
Component: LibreOfficeAssignee: Dirk Mueller <dmueller>
Status: RESOLVED FIXED QA Contact: Yifan Jiang <yfjiang>
Severity: Critical    
Priority: P5 - None CC: forgotten_--EoyBps8f, novel, publio.escipion.el.africano, yfjiang
Version: Final   
Target Milestone: ---   
Hardware: x86-64   
OS: openSUSE 11.4   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Attachments: Testcase

Description Christian Ehrlicher 2011-11-18 20:06:25 UTC
Created attachment 462984 [details]
Testcase

User-Agent:       Mozilla/5.0 (X11; Linux x86_64; rv:7.0.1) Gecko/20100101 Firefox/7.0.1

During problems developing a libreoffice plugin with ure it turned out that my program was correct but libreoffice was crashing for no good reason. I was trying to connect to LO over a uno socket which worked with LO 3.2/3.3. See also here: http://lists.freedesktop.org/archives/libreoffice/2011-November/020889.html

Here the backtrace:
-------------------------------8<---------------------------
QPixmap: It is not safe to use pixmaps outside the GUI thread
QPixmap: It is not safe to use pixmaps outside the GUI thread
QPixmap: It is not safe to use pixmaps outside the GUI thread

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffda7fd700 (LWP 18110)]
qt_toX11Pixmap (pixmap=...) at image/qpixmap_x11.cpp:98
98      image/qpixmap_x11.cpp: Datei oder Verzeichnis nicht gefunden.
        in image/qpixmap_x11.cpp
(gdb) bt
#0  qt_toX11Pixmap (pixmap=...) at image/qpixmap_x11.cpp:98
#1  0x00007fffeb647a40 in QX11PaintEngine::drawPixmap (this=<optimized out>, r=<optimized out>, px=<optimized out>, _sr=<optimized out>)
    at painting/qpaintengine_x11.cpp:1918
#2  0x00007fffeb583bf5 in QPaintEngine::drawImage (this=0x1df9fb0, r=..., image=..., sr=<optimized out>, flags=<optimized out>)
    at painting/qpaintengine.cpp:624
#3  0x00007fffeb64bc72 in QX11PaintEngine::drawImage (this=0x1df9fb0, r=..., image=..., sr=..., flags=...)
    at painting/qpaintengine_x11.cpp:1903
#4  0x00007fffeb59dc1e in QPainter::drawImage (this=0x7fffda7f98b0, targetRect=..., image=..., sourceRect=..., flags=...)
    at painting/qpainter.cpp:5720
#5  0x00007fffed747914 in ?? () from /usr/lib64/libreoffice/basis3.4/program/libvclplug_kde4lx.so
#6  0x00007ffff39d4667 in SalGraphics::DrawNativeControl(unsigned int, unsigned int, Rectangle const&, unsigned int, ImplControlValue const&, rtl::OUString const&, OutputDevice const*) () from /usr/lib64/libreoffice/program/../basis-link/program/libvcllx.so
#7  0x00007ffff3947e7e in OutputDevice::DrawNativeControl(unsigned int, unsigned int, Rectangle const&, unsigned int, ImplControlValue const&, rtl::OUString) () from /usr/lib64/libreoffice/program/../basis-link/program/libvcllx.so
#8  0x00007ffff3945d5b in OutputDevice::Erase() () from /usr/lib64/libreoffice/program/../basis-link/program/libvcllx.so
#9  0x00007ffff3a8fae2 in ?? () from /usr/lib64/libreoffice/program/../basis-link/program/libvcllx.so
#10 0x00007ffff3a8fd13 in Window::Update() () from /usr/lib64/libreoffice/program/../basis-link/program/libvcllx.so
#11 0x00007ffff3a62025 in StatusBar::SetProgressValue(unsigned short) ()
   from /usr/lib64/libreoffice/program/../basis-link/program/libvcllx.so
#12 0x00007fffdda90d54 in ?? () from /usr/lib64/libreoffice/program/../basis-link/program/libfwklx.so
#13 0x00007fffdda9e270 in ?? () from /usr/lib64/libreoffice/program/../basis-link/program/libfwklx.so
#14 0x00007fffdd954e81 in ?? () from /usr/lib64/libreoffice/program/../basis-link/program/libfwklx.so
#15 0x00007fffdd951475 in ?? () from /usr/lib64/libreoffice/program/../basis-link/program/libfwklx.so
#16 0x00007fffd8363378 in ProgressBarHelper::SetValue(int) () from /usr/lib64/libreoffice/program/../basis-link/program/libxolx.so
#17 0x00007fffd842e127 in ?? () from /usr/lib64/libreoffice/program/../basis-link/program/libxolx.so
#18 0x00007fffd8434e4b in ?? () from /usr/lib64/libreoffice/program/../basis-link/program/libxolx.so
#19 0x00007fffd843ac74 in ?? () from /usr/lib64/libreoffice/program/../basis-link/program/libxolx.so
#20 0x00007fffd8396328 in SvXMLImport::startElement(rtl::OUString const&, com::sun::star::uno::Reference<com::sun::star::xml::sax::XAttributeList> const&) () from /usr/lib64/libreoffice/program/../basis-link/program/libxolx.so
#21 0x00007fffd80455f0 in ?? () from /usr/lib64/libreoffice/program/../basis-link/program/sax.uno.so
#22 0x00007fffe6debaf6 in ?? () from /lib64/libexpat.so.1
---Type <return> to continue, or q <return> to quit---q


Reproducible: Sometimes

Steps to Reproduce:
1. set env var URE_MORE_TYPES to /usr/lib64/libreoffice/basis-link/program/offapi.rdb
2. Compile the attached testcase (CMake based, you need libreoffice-sdk)
3. start soffice in a separate console and attach with gdb: /usr/lib64/libreoffice/program/soffice.bin -quickstart -nodefault -norestore -invisible -accept="socket,host=localhost,port=2083;urp;StarOffice.ServiceManager"
4. start the testcase: ./ooo-test /path/to/a/document.odf
5. gdb should give you a similar backtrace like the one described above

Actual Results:  
LibreOffice crashes

Expected Results:  
No crash anymore :)
Comment 1 Yifan Jiang 2011-11-21 03:29:17 UTC
Hi Lubos, 

I can reproduce it on SUSE build 3.4.2.6 as well.

Would you help to have a look? Thanks!
Comment 2 Lubos Lunak 2011-11-21 17:15:30 UTC
*** Bug 731599 has been marked as a duplicate of this bug. ***
Comment 3 Lubos Lunak 2011-11-22 15:12:31 UTC
This is caused by Qt being way too paranoid and asserting (in this case) needlessly. To-be Qt-4.8 has a way to turn it off, but there does not seem to be any easy way except for backporting this to our 4.7.x. I suggest the changes in home:llunak:branches:openSUSE_12.1:Update:Test/libqt4 + online update.

A much simpler way to reproduce (and more important problem) is e.g. trying drag&drop of cells in Calc.
Comment 4 Lubos Lunak 2011-11-29 12:19:59 UTC
*** Bug 732885 has been marked as a duplicate of this bug. ***
Comment 5 Dirk Mueller 2011-12-01 08:30:38 UTC
Update?
Comment 6 Benjamin Brunner 2011-12-03 17:15:19 UTC
Hi Lubos, could you do a submitrequest to openSUSE:12.1:Update:Test, please. I'll start an update.
Comment 7 Lubos Lunak 2011-12-05 13:54:50 UTC
sr #95458
Comment 8 Bernhard Wiedemann 2011-12-05 14:00:13 UTC
This is an autogenerated message for OBS integration:
This bug (731455) was mentioned in
https://build.opensuse.org/request/show/95458 12.1 / libqt4
Comment 9 Rainer Hurtado Navarro 2011-12-06 23:26:09 UTC
Without involving any update of this sort, it seems that nor bug 733387, nor bug 731455 (my report: bug 732885), are in LibreOffice 3.4.4 / OOO340m1 (Build:402), that I downloaded from its site.

I hope this information be helpful.

Also is not present an issue I haven't reported yet that occurs when shifting windows or maximizing them, involving LO windows: SuSE's LO display the written text upside down, and, in a flash, rotates it to normal. Also, some times, it seems that, in the upside down text, Latin letters are exchange with Hebrew ones.

LO from libreoffice.org is installed in /opt and user preferences are stored in $HOME/.libreoffice/3. So, as LO bundled in SuSE is installed in /usr and user preferences are stored in $HOME/.libreoffice/3-suse, both installations coexist.
Thus, I will be able to retain SuSE's packages to perform any test required, although, as suggestion from Petr Mladek (bug 733387#c9), I will update LO from Stable OBS repository.
Comment 10 Dirk Mueller 2012-01-19 14:10:28 UTC
the related libqt4 update has been released.