lkml.org 
[lkml]   [1996]   [Nov]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Lynx spinning. Kernel problem?


On Sun, 24 Nov 1996, David Schwartz wrote:

> I've found that lynx sometimes spins out of control chewing
> massive system time. If I watch it spin with strace, I see the following:
> (IP address replaced with a.b.c.d).

[ugly strace snipped]

> So what I imagine is happening is lynx (2.3 BETA) calls 'connect'
> with a non-blocking socket, and connect returns immediately. Then lynx
> selects with a zero timeout, the select returns, and lynx calls connect
> again. But why would lynx do anything so stupid?
>
> Does anyone know if this is because lynx is confused by Linux's
> return value (EALREADY) or because lynx is really brain damaged or
> because of a bug in lynx, or what?

I'm guessing that lynx is reusing a struct timeval in the loop, which
starts with a sensible timeout in it. According to the select manpage,
linux will modify the timeval to reflect the amount of time not slept;
"most other implementations" do not do this. So if the select waits for the
entire time, the passed struct timeval is modified to 0, 0. Next time
round the loop, this value is used. I can't confirm this, because I
don't have the source to 2.3, however I'd suggest upgrading to 2.6, which
might fix the problem - at least, the source for 2.6 doesn't seem to have
this problem.

Of course, it could be a much less subtle bug.



\
 
 \ /
  Last update: 2005-03-22 13:37    [W:0.091 / U:2.452 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site