Summary: | Python plasmoid crashes on exit when calling "time.sleep(1)" on a secondary thread (QThread was also used) | ||
---|---|---|---|
Product: | [Unmaintained] bindings | Reporter: | Giacomo Lacava <g.lacava> |
Component: | general | Assignee: | kde-bindings |
Status: | RESOLVED WORKSFORME | ||
Severity: | crash | CC: | andresbajotierra, cfeck, dcmair, nik, thomas.mueller |
Priority: | NOR | Keywords: | triaged |
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Unlisted Binaries | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: |
Description
Giacomo Lacava
2009-12-05 20:49:08 UTC
Offtopic detail: KIO functions shouldn't be used with Threads... (as it can cause problems AFAIK). You should use the SIGNAL-SLOTS method. This could be a problem in bindings too. Regards I tried removing the KIO calls and I still got a crash. I'll try to reduce the scope further... The culprit was a call to time.sleep(1) in the secondary thread. Guess I just verified the old assumption that mixing QThreads and python threads is not a good idea. I have a very similar problem with my plasmoid : #5 0x00007f5d50dcdc3d in PySys_GetObject (name=0x7f5d50e3d377 "exitfunc") at ../Python/sysmodule.c:53 I can remove the applet from plasmoidviewer (or plasma-desktop) without a problem, but when plasmoidviewer or plasma-desktop exits I get the crash. If you have any hint/idea please help me - I already spent hours on that.. What I do in the code: 1. load a library via ctypes (pulseaudio library) 2. install a callback function (to get notified by state-changes of pulseaudio) 3. start an external thread that "runs inside the library" OnExit: I stop that external thread and do the required cleanup - When I call sys.exit(0) inside my code plasmoidviewer exits without a crash (bot I don't want plasma-desktop to exit when I remove the plasmoid). - When I do not set a callback function, I get no crash --- Is this a threading problem? Maybe ctypes starts a thread for the callback function? Whats the relation between PySys_GetObject("exitfunc") and threads? the plasmoid: http://www.kde-look.org/content/show.php/?content=116676 Could be related to this python-bug: http://bugs.python.org/issue6869 *** Bug 221049 has been marked as a duplicate of this bug. *** *** Bug 248412 has been marked as a duplicate of this bug. *** This crash report is at least 3 years old and there were no further comments or status updates since then. Therefore we believe that this crash is already fixed in recent KDE 4 versions or the backtrace is no longer applicable to the current KDE 4 sources. If the crash still happens with a recent KDE version (4.10.5 or 4.11), please add an updated backtrace or provide steps to reproduce. For more information, see http://techbase.kde.org/Development/Tutorials/Debugging/How_to_create_useful_crash_reports (To prevent automatic closing of this bug in the future, please set the bug status to ASSIGNED or CONFIRMED) Dear Bug Submitter, This bug has been in NEEDSINFO status with no change for at least 15 days. Please provide the requested information as soon as possible and set the bug status as REPORTED. Due to regular bug tracker maintenance, if the bug is still in NEEDSINFO status with no change in 30 days, the bug will be closed as RESOLVED > WORKSFORME due to lack of needed information. For more information about our bug triaging procedures please read the wiki located here: https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging If you have already provided the requested information, please set the bug status as REPORTED so that the KDE team knows that the bug is ready to be confirmed. Thank you for helping us make KDE software even better for everyone! Dear Bug Submitter, This bug has been in NEEDSINFO status with no change for at least 30 days. The bug is now closed as RESOLVED > WORKSFORME due to lack of needed information. For more information about our bug triaging procedures please read the wiki located here: https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging Thank you for helping us make KDE software even better for everyone! |