Open Clipart import dialog crashes with concurrent searches

Bug #1281104 reported by jazzynico
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Inkscape
Fix Released
High
jazzynico

Bug Description

Originaly reported in meta Bug #943275 (New 'Import Clip Art…' dialog crashes).

Reproduced on Ubuntu 12.04 and Crunchbang Waldorf.

Steps:
1. Open the Import Openclipart dialog (File>Import Clipart).
2. Search for "a"
3. Click any result
4. While the preview image is still loading
5. Search for "b"
6. Click any result

Trace (Crunchbang, r13033):
-----
(gdb) run
Starting program: /usr/local/bin/inkscape
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7fffdf0e9700 (LWP 6600)]
GLib (gthread-posix.c): Unexpected error from C library during 'pthread_setspecific': Argument invalide. Aborting.

Program received signal SIGABRT, Aborted.
[Switching to Thread 0x7fffdf0e9700 (LWP 6600)]
0x00007fffeee8b475 in raise () from /lib/x86_64-linux-gnu/libc.so.6
(gdb) bt
#0 0x00007fffeee8b475 in raise () from /lib/x86_64-linux-gnu/libc.so.6
#1 0x00007fffeee8e6f0 in abort () from /lib/x86_64-linux-gnu/libc.so.6
#2 0x00007fffefbbb143 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#3 0x00007fffefc24815 in g_private_set () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#4 0x00007ffff56952e3 in g_input_stream_read () from /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0
#5 0x00007ffff567cd1a in ?? () from /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0
#6 0x00007ffff568116f in g_file_copy () from /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0
#7 0x00007ffff568198a in ?? () from /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0
#8 0x00007ffff56967ae in ?? () from /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0
#9 0x00007fffefc0b742 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#10 0x00007fffefc0af45 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#11 0x00007fffef1e9b50 in start_thread () from /lib/x86_64-linux-gnu/libpthread.so.0
#12 0x00007fffeef33a7d in clone () from /lib/x86_64-linux-gnu/libc.so.6
#13 0x0000000000000000 in ?? ()
-----

The console adds the following message (when launched without gdb):

[xcb] Unknown request in queue while dequeuing
[xcb] Most likely this is a multi-threaded client and XInitThreads has not been called
[xcb] Aborting, sorry about that.
inkscape: ../../src/xcb_io.c:179: dequeue_pending_request: Assertion `!xcb_xlib_unknown_req_in_deq' failed.
Aborted

Revision history for this message
jazzynico (jazzynico) wrote :

Not reproduced on Windows XP, Inkscape trunk revision 13031.

Revision history for this message
jazzynico (jazzynico) wrote :

A possible workaround would be to deactivate the search field and button while a file is being downloaded.
I'm going to take a look on how complex it would be.

Revision history for this message
jazzynico (jazzynico) wrote :

Forgot my previous comment, Inkscape crashes even if the preview zone is updated with the first clipart's thumbnail.

Revision history for this message
jazzynico (jazzynico) wrote :

Based on the libxml2 document (http://xmlsoft.org/threads.html), xmlCleanupParser() should be called only once. In openclipart.cpp, it is called each time we update the search list.

The attached patch moves xmlCleanupParser() to the dialog's destructor.
Tested successfully on Windows XP and Crunchbang Waldorf, Inkscape trunk revision 13033.

Changed in inkscape:
assignee: nobody → jazzynico (jazzynico)
status: Triaged → In Progress
Revision history for this message
jazzynico (jazzynico) wrote :

Please confirm it fixes the issue on other systems.

Revision history for this message
jazzynico (jazzynico) wrote :

Correction, the libxml2 related link is: http://xmlsoft.org/html/libxml-parser.html#xmlCleanupParser

Revision history for this message
jazzynico (jazzynico) wrote :

Fix committed revision 13042.

Changed in inkscape:
status: In Progress → Fix Committed
jazzynico (jazzynico)
Changed in inkscape:
status: Fix Committed → Fix Released
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.