Bug 52415 - KNode's GUI does not start when linking to pthreads
Summary: KNode's GUI does not start when linking to pthreads
Status: RESOLVED FIXED
Alias: None
Product: knode
Classification: Miscellaneous
Component: general (show other bugs)
Version: unspecified
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-12-30 14:59 UTC by Hamish Rodda
Modified: 2002-12-31 02:12 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Hamish Rodda 2002-12-30 14:59:09 UTC
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?
Comment 1 Christian Gebauer 2002-12-30 18:55:47 UTC
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
Comment 2 Hamish Rodda 2002-12-31 01:25:57 UTC
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. 
Comment 3 Christian Gebauer 2002-12-31 02:12:00 UTC
Yes, pthreads are evil, I hope we will get rid of them in KDE 3.2. 
I adjusted Makefile.am, thanks for your report.