I've investigated this also, and my conclusion is that -pthread and no -lc_r
parameter is correct. The test is to try 'nm .lib/ntop' to see if libc or
libc_r is used.. I've noticed that sometimes both are listed as a
dependencies and that is a real problem..
But still after tampering with this it still crashes hard.. When using the
never version of gd/gdchart I limited the crashes to multiple simultanous
reloads of the webpages (hold down the reload button).
The problem is most likely in the FreeBSD socket code, but even when putting
mutexes around the tcp code it still crashes, but it's much harder to
provoke.
Another thing I noticed is that 'strtok()' is used in pbuf.. Could that be a
problem.. All other places the reentrant function is used.
Just a side note. How about gdchart-0.10.0.1 ? Will you check it in to the
cvs tree (or not?) ?
Regards,
Nicolai Petri
----- Original Message -----
From: "Luca Deri" <[EMAIL PROTECTED]>
To: "ntop Mailing List" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Cc: "Luigi Rizzo" <[EMAIL PROTECTED]>
Sent: Wednesday, November 15, 2000 11:46 AM
Subject: ntop on FreeBSD
> Hi all,
> I'm currently investigating a FreeBSD-only problem. Basically ntop MT on
> FreeBSD uses all the available CPU. I've noticed that if I create ntop
> ST and link it with libc_r (the reeentrant version of libc) it does uses
> all the available CPU too, but it I use libc then it uses very little
> CPU. I have experienced the same behaviour if I use -pthread link flag
> instead.
>
> As I'm not a FreeBSD expert, can someone tell me how multithreaded
> programs under FreebSD must be built?
>
> Thanks, Luca
>
> --
> Luca Deri Finsiel S.p.A.
> Via Matteucci 34/B 56124 Pisa, Italy.
> Ph. +39/050/968.639 Fax. +39/050/968.626
> Email: [EMAIL PROTECTED] WWW: http://www.tlcpi.finsiel.it/~deri/
> ICQ: 68183632
> Software is about stuff, about getting hands dirty - Jim Coplien
>