Bug 191122

Summary: KLocale::translate*() functions are not thread-safe
Product: [Unmaintained] kdelibs Reporter: Mario Minners <mario.minners>
Component: klocaleAssignee: Chusslove Illich <caslav.ilic>
Status: RESOLVED FIXED    
Severity: crash CC: alter.pub, andresbajotierra, crissi99, cronopios, eagles051387, finex, hujuice, kdelibs-bugs, klaus.layer+kde, rasasi78, usaywot, zayed.alsaidi, zdenek.zikan, zmogas
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Ubuntu   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: xsession errors excerpt

Description Mario Minners 2009-04-30 09:56:39 UTC
Version:            (using KDE 4.2.2)
OS:                Linux
Installed from:    Ubuntu Packages

Plasma crashed randomly.

Hardware:
Acer Travelmate 5720 with intel graphics

Setup:
dual-monitor
Desktop-Effects active

Anwendung: Plasma-Arbeitsfläche (plasma), Signal SIGABRT
__lll_lock_wait_private ()
    at ../nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S:91
	in ../nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
Current language:  auto; currently asm
[Current thread is 0 (LWP 6109)]

Thread 7 (Thread 0x7fa8ee572950 (LWP 6110)):
#0  pthread_cond_wait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:261
#1  0x00007fa908c93939 in QWaitCondition::wait (this=0x2271c80, mutex=0x2271c78, time=18446744073709551615) at thread/qwaitcondition_unix.cpp:87
#2  0x00007fa90c44f4cc in QHostInfoAgent::run (this=0x2271c60) at kernel/qhostinfo.cpp:260
#3  0x00007fa908c92952 in QThreadPrivate::start (arg=0x2271c60) at thread/qthread_unix.cpp:189
#4  0x00007fa9055e73ba in start_thread (arg=<value optimized out>) at pthread_create.c:297
#5  0x00007fa9081effcd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
#6  0x0000000000000000 in ?? ()

Thread 6 (Thread 0x7fa8ed871950 (LWP 6113)):
[KCrash Handler]
#5  0x00007fa90813cfb5 in *__GI_raise (sig=<value optimized out>) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
#6  0x00007fa90813ebc3 in *__GI_abort () at abort.c:88
#7  0x00007fa90817c228 in __libc_message (do_abort=2, fmt=0x7fa908246488 "*** glibc detected *** %s: %s: 0x%s ***\n") at ../sysdeps/unix/sysv/linux/libc_fatal.c:170
#8  0x00007fa908181cb8 in malloc_printerr (action=2, str=0x7fa9082465b8 "malloc(): memory corruption (fast)", ptr=<value optimized out>) at malloc.c:5994
#9  0x00007fa908185351 in _int_malloc (av=0x7fa908477a00, bytes=42) at malloc.c:4172
#10 0x00007fa908186828 in *__GI___libc_malloc (bytes=42) at malloc.c:3551
#11 0x00007fa908cd49b4 in QString::fromLatin1_helper (str=0x2387968 "en_GB", size=5) at tools/qstring.cpp:3452
#12 0x00007fa90b67e79c in KCatalog::language (this=<value optimized out>) at /usr/include/qt4/QtCore/qstring.h:416
#13 0x00007fa90b692784 in KLocalePrivate::translate_priv (this=0x1db7b40, msgctxt=0x7fa908e09dc0 "QProcess", msgid=0x7fa908e09d3c "Error writing to process", msgid_plural=0x0, n=0, 
    language=0x7fa8ed86cf10, translation=0x7fa8ed86cf20) at /build/buildd/kde4libs-4.2.2/kdecore/localization/klocale.cpp:756
#14 0x00007fa90b693345 in KLocale::translateQt (this=0x1dd1030, context=0x7fa908e09dc0 "QProcess", sourceText=0x7fa908e09d3c "Error writing to process", comment=0x0)
    at /build/buildd/kde4libs-4.2.2/kdecore/localization/klocale.cpp:853
#15 0x00007fa90bb8238d in KDETranslator::translate (this=<value optimized out>, context=0x7fa908e09dc0 "QProcess", sourceText=0x7fa908e09d3c "Error writing to process", message=0x0)
    at /build/buildd/kde4libs-4.2.2/kdeui/kernel/kapplication.cpp:462
#16 0x00007fa908d986a9 in QTranslator::translate (this=0x17e1, context=0x6 <Address 0x6 out of bounds>, sourceText=0xffffffffffffffff <Address 0xffffffffffffffff out of bounds>, 
    disambiguation=0x7fa90823c8a0 "0123456789abcdefghijklmnopqrstuvwxyz", n=2118) at kernel/qtranslator.cpp:804
#17 0x00007fa908d7efa9 in QCoreApplication::translate (context=0x7fa908e09dc0 "QProcess", sourceText=0x7fa908e09d3c "Error writing to process", disambiguation=0x0, 
    encoding=QCoreApplication::CodecForTr, n=-1) at kernel/qcoreapplication.cpp:1633
#18 0x00007fa908d7f38f in QCoreApplication::translate (context=0x17e1 <Address 0x17e1 out of bounds>, sourceText=0x6 <Address 0x6 out of bounds>, 
    disambiguation=0xffffffffffffffff <Address 0xffffffffffffffff out of bounds>, encoding=136562848) at kernel/qcoreapplication.cpp:1548
#19 0x00007fa908d81f10 in QMetaObject::tr (this=<value optimized out>, s=0x6 <Address 0x6 out of bounds>, c=0xffffffffffffffff <Address 0xffffffffffffffff out of bounds>)
    at kernel/qmetaobject.cpp:314
#20 0x00007fa908d1e392 in QProcessPrivate::_q_canWrite (this=0x280c3b0) at io/qprocess.h:68
#21 0x00007fa908d5c498 in QProcessPrivate::waitForFinished (this=0x280c3b0, msecs=5000) at io/qprocess_unix.cpp:1184
#22 0x00007fa908d1be3c in QProcess::waitForFinished (this=0x7fa8ed86d310, msecs=5000) at io/qprocess.cpp:1318
#23 0x00007fa8ef2b442f in Update_Thread::runCommand () from /usr/lib/kde4/plasma_applet_cwp.so
#24 0x00007fa8ef2bd43b in Update_Thread::collectAndParseData () from /usr/lib/kde4/plasma_applet_cwp.so
#25 0x00007fa8ef2c001c in Update_Thread::run () from /usr/lib/kde4/plasma_applet_cwp.so
#26 0x00007fa908c92952 in QThreadPrivate::start (arg=0x2509ca0) at thread/qthread_unix.cpp:189
#27 0x00007fa9055e73ba in start_thread (arg=<value optimized out>) at pthread_create.c:297
#28 0x00007fa9081effcd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
#29 0x0000000000000000 in ?? ()

Thread 5 (Thread 0x7fa8ed070950 (LWP 6114)):
#0  pthread_cond_wait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:261
#1  0x00007fa908c93939 in QWaitCondition::wait (this=0x20ede30, mutex=0x20ede28, time=18446744073709551615) at thread/qwaitcondition_unix.cpp:87
#2  0x00007fa8ef975d4e in RenderThread::run (this=0x20ede18) at /build/buildd/kdebase-workspace-4.2.2/plasma/wallpapers/image/renderthread.cpp:91
#3  0x00007fa908c92952 in QThreadPrivate::start (arg=0x20ede18) at thread/qthread_unix.cpp:189
#4  0x00007fa9055e73ba in start_thread (arg=<value optimized out>) at pthread_create.c:297
#5  0x00007fa9081effcd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
#6  0x0000000000000000 in ?? ()
Current language:  auto; currently c

Thread 4 (Thread 0x7fa8e797e950 (LWP 6115)):
#0  pthread_cond_wait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:261
#1  0x00007fa908c93939 in QWaitCondition::wait (this=0x20f5430, mutex=0x20f5428, time=18446744073709551615) at thread/qwaitcondition_unix.cpp:87
#2  0x00007fa8ef975d4e in RenderThread::run (this=0x20f5418) at /build/buildd/kdebase-workspace-4.2.2/plasma/wallpapers/image/renderthread.cpp:91
#3  0x00007fa908c92952 in QThreadPrivate::start (arg=0x20f5418) at thread/qthread_unix.cpp:189
#4  0x00007fa9055e73ba in start_thread (arg=<value optimized out>) at pthread_create.c:297
#5  0x00007fa9081effcd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
#6  0x0000000000000000 in ?? ()
Current language:  auto; currently asm

Thread 3 (Thread 0x7fa8e697c950 (LWP 6139)):
#0  0x00007fa9081e8742 in select () from /lib/libc.so.6
#1  0x00007fa908d59f06 in QProcessManager::run (this=0x1d40760) at io/qprocess_unix.cpp:305
#2  0x00007fa908c92952 in QThreadPrivate::start (arg=0x1d40760) at thread/qthread_unix.cpp:189
#3  0x00007fa9055e73ba in start_thread (arg=<value optimized out>) at pthread_create.c:297
#4  0x00007fa9081effcd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
#5  0x0000000000000000 in ?? ()

Thread 2 (Thread 0x7fa8e717d950 (LWP 11886)):
#0  pthread_cond_timedwait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S:217
#1  0x00007fa908c93917 in QWaitCondition::wait (this=0x27feae8, mutex=0x27feae0, time=30000) at thread/qwaitcondition_unix.cpp:85
#2  0x00007fa908c89409 in QThreadPoolThread::run (this=0x1fb3d40) at concurrent/qthreadpool.cpp:140
#3  0x00007fa908c92952 in QThreadPrivate::start (arg=0x1fb3d40) at thread/qthread_unix.cpp:189
#4  0x00007fa9055e73ba in start_thread (arg=<value optimized out>) at pthread_create.c:297
#5  0x00007fa9081effcd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
#6  0x0000000000000000 in ?? ()
Current language:  auto; currently c

Thread 1 (Thread 0x7fa90d905760 (LWP 6109)):
#0  __lll_lock_wait_private () at ../nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S:91
#1  0x00007fa908188025 in _L_lock_4783 () from /lib/libc.so.6
#2  0x00007fa90818426b in *__GI___libc_free (mem=0x7fa908477a00) at malloc.c:3623
#3  0x00007fa908c94c32 in QByteArray::operator= (this=0x23e98e8, other=@0x80) at tools/qbytearray.cpp:851
#4  0x00007fa90b67ef04 in KCatalogPrivate::setupGettextEnv (this=0x23e98d0) at /build/buildd/kde4libs-4.2.2/kdecore/localization/kcatalog.cpp:165
#5  0x00007fa90b67f23a in KCatalog::translateStrict (this=0x80, msgid=0x0) at /build/buildd/kde4libs-4.2.2/kdecore/localization/kcatalog.cpp:233
#6  0x00007fa90b692e3c in KLocalePrivate::translate_priv (this=0x1db7b40, msgctxt=0x0, msgid=0x270eb18 "Europe/Berlin", msgid_plural=0x0, n=0, language=0x7fff1593e1d0, translation=0x7fff1593e1c0)
    at /build/buildd/kde4libs-4.2.2/kdecore/localization/klocale.cpp:767
#7  0x00007fa90b6933ce in KLocale::translateRaw (this=<value optimized out>, msg=<value optimized out>, lang=<value optimized out>, trans=<value optimized out>)
    at /build/buildd/kde4libs-4.2.2/kdecore/localization/klocale.cpp:783
#8  0x00007fa90b69e124 in KLocalizedStringPrivate::toString (this=0x2830850, locale=0x1dd1030) at /build/buildd/kde4libs-4.2.2/kdecore/localization/klocalizedstring.cpp:245
#9  0x00007fa90b69efe7 in KLocalizedString::toString (this=0x7fff1593e390) at /build/buildd/kde4libs-4.2.2/kdecore/localization/klocalizedstring.cpp:205
#10 0x00007fa8ed96327b in TimeEngine::updateSourceEvent (this=0x23e7fe0, tz=@0x7fff1593e530) at /usr/include/klocalizedstring.h:568
#11 0x00007fa90d16d496 in ?? () from /usr/lib/libplasma.so.3
#12 0x00007fa90d16f659 in Plasma::DataEngine::qt_metacall () from /usr/lib/libplasma.so.3
#13 0x00007fa908d911f2 in QMetaObject::activate (sender=0x23ddf30, from_signal_index=<value optimized out>, to_signal_index=6, argv=0xffffffffffffffff) at kernel/qobject.cpp:3069
#14 0x00007fa90d16b3f2 in Plasma::DataContainer::updateRequested () from /usr/lib/libplasma.so.3
#15 0x00007fa90d1934cf in ?? () from /usr/lib/libplasma.so.3
#16 0x00007fa908d8b4d3 in QObject::event (this=0x24adf20, e=0x80) at kernel/qobject.cpp:1082
#17 0x00007fa9094c083d in QApplicationPrivate::notify_helper (this=0x1d41a70, receiver=0x24adf20, e=0x7fff1593ed90) at kernel/qapplication.cpp:4084
#18 0x00007fa9094c8a2a in QApplication::notify (this=0x1d3b010, receiver=0x24adf20, e=0x7fff1593ed90) at kernel/qapplication.cpp:4049
#19 0x00007fa90bb7d26b in KApplication::notify (this=0x1d3b010, receiver=0x24adf20, event=0x7fff1593ed90) at /build/buildd/kde4libs-4.2.2/kdeui/kernel/kapplication.cpp:307
#20 0x00007fa908d7b75c in QCoreApplication::notifyInternal (this=0x1d3b010, receiver=0x24adf20, event=0x7fff1593ed90) at kernel/qcoreapplication.cpp:602
#21 0x00007fa908da87f6 in QTimerInfoList::activateTimers (this=0x1d45120) at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:213
#22 0x00007fa908da4f0d in timerSourceDispatch (source=<value optimized out>) at kernel/qeventdispatcher_glib.cpp:164
#23 0x00007fa9039b720a in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
#24 0x00007fa9039ba8e0 in ?? () from /usr/lib/libglib-2.0.so.0
#25 0x00007fa9039baa7c in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0
#26 0x00007fa908da4e6f in QEventDispatcherGlib::processEvents (this=0x1cfcea0, flags=<value optimized out>) at kernel/qeventdispatcher_glib.cpp:323
#27 0x00007fa909558c9f in QGuiEventDispatcherGlib::processEvents (this=0x7fa908477a00, flags=<value optimized out>) at kernel/qguieventdispatcher_glib.cpp:202
#28 0x00007fa908d7a002 in QEventLoop::processEvents (this=<value optimized out>, flags={i = 362016768}) at kernel/qeventloop.cpp:149
#29 0x00007fa908d7a3cd in QEventLoop::exec (this=0x7fff1593f040, flags={i = 362016848}) at kernel/qeventloop.cpp:200
#30 0x00007fa908d7c694 in QCoreApplication::exec () at kernel/qcoreapplication.cpp:880
#31 0x00007fa90d4dc9bb in kdemain (argc=1, argv=0x7fff1593f348) at /build/buildd/kdebase-workspace-4.2.2/plasma/shells/desktop/main.cpp:54
#32 0x00007fa9081285a6 in __libc_start_main (main=0x400890 <main>, argc=1, ubp_av=0x7fff1593f348, init=0x4008c0 <__libc_csu_init>, fini=<value optimized out>, rtld_fini=<value optimized out>, 
    stack_end=0x7fff1593f338) at libc-start.c:220
#33 0x00000000004007c9 in _start () at ../sysdeps/x86_64/elf/start.S:113
Current language:  auto; currently asm
91	in ../nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
Comment 1 FiNeX 2009-04-30 13:54:09 UTC
I've had some random sporadic crashes of plasma too since I'm using a dual monitor setup. I'll try to provide a backtrace. (I'm running trunk).

@Mario: did you experienced this crash even without dual monitor?
Comment 2 Dario Andres 2009-04-30 14:27:28 UTC
Mh: "malloc(): memory corruption (fast)" in internal Qt functions...
I also see "<Address 0x6 out of bounds>"

What is your Qt version ?
Comment 3 Mario Minners 2009-04-30 22:08:39 UTC
It's Kubuntu Jaunty
Qt is 4.5.0

Without external VGA plasma isn't crashing.
I can test only with the internal LVDS in single-head setup at the moment.

I have expierenced that plasma crashed often when I'm moving a maximized firefox window with flashmovies from one screen to another. But its also randomly. Can't test it with konqueror at the moment.

sorry, bad english
Comment 4 FiNeX 2009-04-30 22:40:51 UTC
Thanks Mario, your english is good enough :-)
Comment 5 Raúl 2009-05-05 22:16:46 UTC
Hello:

I'm experiencing this as well on sid KDE4.2.2, Qt 4.5.1. I have had same backtrace on kontact and konqueror, so maybe it's not a plasma issue.

I'm attaching a .xsession-errors excerpt where memory corruption is shown. This was for kontact.

Feel free to ask me for the kontact and konqueror full backtraces.

Regardsm
Comment 6 Raúl 2009-05-05 22:18:57 UTC
Created attachment 33379 [details]
xsession errors excerpt
Comment 7 David Faure 2009-05-18 23:17:35 UTC
SVN commit 969775 by dfaure:

* Add a mutex around the KCatalog code, that is playing with env vars (setting+resetting), as needed by gettext().
BUG: 191122

* Fix isApplicationTranslatedInto() being false wrongly in apps that use setMainCatalog()
 (e.g. in korgac it would say "nope, because no korgac.po" even though it's using korganizer.po)


 M  +20 -0     kcatalog.cpp  
 M  +17 -21    klocale.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=969775
Comment 8 Pino Toscano 2009-05-18 23:36:56 UTC
*** Bug 192035 has been marked as a duplicate of this bug. ***
Comment 9 Chusslove Illich 2009-05-19 13:17:10 UTC
*** Bug 193218 has been marked as a duplicate of this bug. ***
Comment 10 Chusslove Illich 2009-05-19 13:17:29 UTC
*** Bug 193219 has been marked as a duplicate of this bug. ***
Comment 11 Chusslove Illich 2009-05-19 13:17:46 UTC
*** Bug 193223 has been marked as a duplicate of this bug. ***
Comment 12 Nick Shaforostoff 2009-05-19 16:54:22 UTC
*** Bug 193231 has been marked as a duplicate of this bug. ***
Comment 13 Nick Shaforostoff 2009-05-19 16:56:40 UTC
*** Bug 191048 has been marked as a duplicate of this bug. ***
Comment 14 Nick Shaforostoff 2009-05-19 16:58:07 UTC
*** Bug 191395 has been marked as a duplicate of this bug. ***
Comment 15 Nick Shaforostoff 2009-05-19 16:59:55 UTC
*** Bug 191155 has been marked as a duplicate of this bug. ***
Comment 16 Nick Shaforostoff 2009-05-19 17:01:18 UTC
*** Bug 191151 has been marked as a duplicate of this bug. ***
Comment 17 Chusslove Illich 2009-05-24 21:22:29 UTC
*** Bug 184867 has been marked as a duplicate of this bug. ***
Comment 18 Jonathan Thomas 2009-06-02 23:28:35 UTC
*** Bug 195028 has been marked as a duplicate of this bug. ***
Comment 19 Pino Toscano 2009-06-03 10:16:01 UTC
*** Bug 195063 has been marked as a duplicate of this bug. ***
Comment 20 Chusslove Illich 2009-06-04 10:02:04 UTC
*** Bug 195176 has been marked as a duplicate of this bug. ***
Comment 21 Pino Toscano 2009-06-18 17:10:16 UTC
*** Bug 197029 has been marked as a duplicate of this bug. ***
Comment 22 Dario Andres 2009-08-13 14:24:56 UTC
*** Bug 203267 has been marked as a duplicate of this bug. ***