I got a reply from Daniel that lftp compiled under Panther still works
under Tiger, and doesn't have the CPU usage problem.
I tested his Panther binary and I can confirm it indeed still works
without problems.

So thats solution 1.

For the real problem, I think I have found the culprit.
The native 'poll' function in Tiger is broken.

For more information the bug is documented at:
http://bugzilla.gnome.org/show_bug.cgi?id=302672

>From what I understand of the documented bug is that Tiger now has
native poll function and doesn't define _POLL_EMUL_H_ anymore like in
Panther.
But the poll function is actually broken in Tiger, or doesn't work
properly under certain circumstances.

The configure script of lftp doesn't know it is broken, but just sees
there is a native poll function available, so it wants to use that
instead of the emulated poll function.
But when you compile lftp with Tiger's native poll function it will
result in an infinite loop and keeps calling the poll function which
in turn causes the heavy CPU load. (i used ktrace to confirm it)

So for solution 2:
You need to force the configure script to use the emulated poll
function, I'm not sure if this is the easiest way but I used the
following commands to accomplish this:

$ tar -zxvf lftp-3.2.1.tar.gz
$ cd lftp-3.2.1
$ sed 's/poll_works=yes/poll_works=no/' configure > configure.good
$ mv configure.good configure
$ chmod +x configure
$ ./configure --with-openssl=/usr/include/openssl && make

When its done compiling you have a fresh build of lftp using the
emulated poll function and doesn't eat all your CPU cycles :)

I hope this helped.

Reply via email to