Bug #1003

Updated by tuxillo over 3 years ago

Qt 4.4 integrates QT Concurrent [1] template library which provides
high-level and very easy to use API for writing multi-threaded programs.

The problem is that all these programs crash (segfault) rather "reliably"
with libthread_xu while there is no single problem with libc_r. I even
managed to deadlock whole machine with one example program, but can not
repeat it for now (I have single desktop at the moment I need to work
with ;).

I made static binaries from trivial example program you can download
here - http://leaf.dragonflybsd.org/~hasso/qt44-threaded-tests.tar.bz2.

runfunction-lr is compiled with libc_r, runfunction-xu with libthread_xu.
runfunction-xu crashing backtrace is always the same:

#0 __pthread_mutex_trylock (m=0x0)
at /home/hasso/dragonfly-src/lib/libthread_xu/thread/thr_mutex.c:292
292 if (__predict_false(*m == NULL)) {
(gdb) bt
#0 __pthread_mutex_trylock (m=0x0)
at /home/hasso/dragonfly-src/lib/libthread_xu/thread/thr_mutex.c:292
#1 0x0814157e in g_mutex_trylock_posix_impl ()
#2 0x0815186f in g_slice_alloc ()
#3 0x0815ca7a in g_ptr_array_sized_new ()
#4 0x0815cab5 in g_ptr_array_new ()
#5 0x0814b5ec in g_main_context_new ()
#6 0x080fd298 in QEventDispatcherGlibPrivate (this=0x281fb400,
at kernel/qeventdispatcher_glib.cpp:241
#7 0x080fd4e7 in QEventDispatcherGlib (this=0x281f9260, parent=0x0) at
#8 0x08057e1a in QThreadPrivate::createEventDispatcher (data=0x281fa740)
at thread/qthread_unix.cpp:161
#9 0x08057f0c in QThreadPrivate::start (arg=0x281f91c0) at
#10 0x08145017 in thread_start (arg=0x281f6200)
at /home/hasso/dragonfly-src/lib/libthread_xu/thread/thr_create.c:239
#11 0x00000000 in ?? ()

[1] - http://labs.trolltech.com/blogs/category/labs/threads/qt-concurrent/