exit on select return -1 but errno == 0?
running under gdb, server exits(1) after a bit Breakpoint 15, main (argc=2, argv=0xbfe26764) at radiusd.c:600 600 if (errno == EINTR) { (gdb) p errno $9 = 0 (gdb) p status $10 = -1 (gdb) Debian GNU/Linux dpkg -l libc6 Desired=Unknown/Install/Remove/Purge/Hold | Status=Not/Installed/Config-files/Unpacked/Failed-config/Half-installed |/ Err?=(none)/Hold/Reinst-required/X=both-problems (Status,Err: uppercase=bad) ||/ Name Version Description +++-=========================-=========================-================================================================== ii libc6 2.3.5-6 GNU C Library: Shared libraries and Timezone data
in radiusd.c:720 ----------------------------- for (listener = mainconfig.listen; listener != NULL; listener = listener->next) { int next; next = listener->update(listener, time_now); if (next > 0 && next < sleep_time) { sleep_time = next; } ------------------------------- I added the "next > 0 &&" because I was getting "sleeping for -1".... and then the server would exit.
Joe Maimon <jmaimon@ttec.com> wrote:
I added the "next > 0 &&" because I was getting "sleeping for -1".... and then the server would exit.
Yeah, that code is *bad*. I'm in the process of figuring out what it should do, as opposed to randomly changing the crap that's there. Alan DeKok.
Alan, With your fix for this issue, the server sometimes logs hundreds of sleeping(it means select) for 0 seconds messages (in a row). Should the server ever select for 0 seconds? Joe Joe Maimon wrote:
in radiusd.c:720
----------------------------- for (listener = mainconfig.listen; listener != NULL; listener = listener->next) { int next;
next = listener->update(listener, time_now); if (next > 0 && next < sleep_time) { sleep_time = next; }
-------------------------------
I added the "next > 0 &&" because I was getting "sleeping for -1".... and then the server would exit.
- List info/subscribe/unsubscribe? See http://www.freeradius.org/list/devel.html
Joe Maimon <jmaimon@ttec.com> wrote:
With your fix for this issue, the server sometimes logs hundreds of sleeping(it means select) for 0 seconds messages (in a row).
Should the server ever select for 0 seconds?
No. It's a bug. It's in 1.0.x, too, and I can't figure out what code path creates the problem. The solution is to go to a state-driven approach. I've done some analysis, but I'm not sure how best to implement it. Alan DeKok.
participants (2)
-
Alan DeKok -
Joe Maimon