Version: 0.7.2 (using KDE 3.1.9) Compiler: gcc version 2.95.4 20011002 (Debian prerelease) OS: Linux (i686) release 2.4.20-ck2 For about a month my self-compiled versions of KNode have been failing to display the GUI when starting. Launching KNode creates 4 threads, and stops. This seems similar to bug #36083 and a few other even older reports. Running KNode under Valgrind allows it to start, albeit slowly and with warnings about calls to valgrind's libpthreads being ignored. I tracked the main thread's execution to the KNNetAccess constructor, where the last call executed is nntpClient->start(); Execution does not return to the main thread after starting the nntpClient thread. I uncommented the calls to pthreads in KNProtocolClient::run(). No change. Then I removed the linking to pthreads in Makefile.am, and the problem has resolved - KNode appears to be operating normally again. If these calls aren't needed, perhaps they could be removed and thus the pthreads linking removed too?
Subject: Re: New: KNode's GUI does not start when linking to pthreads On Monday 30 December 2002 14:59, Hamish Rodda wrote: > For about a month my self-compiled versions of KNode have been failing to > display the GUI when starting. Launching KNode creates 4 threads, and > stops. This seems similar to bug #36083 and a few other even older > reports. > > Running KNode under Valgrind allows it to start, albeit slowly and with > warnings about calls to valgrind's libpthreads being ignored. > > I tracked the main thread's execution to the KNNetAccess constructor, where > the last call executed is nntpClient->start(); Execution does not return to > the main thread after starting the nntpClient thread. > > I uncommented the calls to pthreads in KNProtocolClient::run(). No change. > > Then I removed the linking to pthreads in Makefile.am, and the problem has > resolved - KNode appears to be operating normally again. > > If these calls aren't needed, perhaps they could be removed and thus the > pthreads linking removed too? The calls are needed for a proper shutdown of KNode, you will notice that you still have four knode processes after you exited KNode. The two calls could be avoided by changing the shutdown logic of KNode, but I would like to avoid this change. What happens if you just remove the pthread linking in Makefile.am (knode_LDADD) and reactivate the two pthread calls in KNProtocolClient? (KNode will still build, because libpthread is include via Qt) Greetings Christian
I see. Yes, it still works when I uncomment those lines, and now it closes all of the threads too :) Perfect. What a strange problem.
Yes, pthreads are evil, I hope we will get rid of them in KDE 3.2. I adjusted Makefile.am, thanks for your report.