Segfault in syslogd <problem shown>

Richard B. Johnson (root@chaos.analogic.com)
Mon, 5 Apr 1999 15:19:58 -0400 (EDT)


To whomever maintains sysklogd:

In sysklogd-1.3-31/syslogd.c. line 1016, is the following construct,
rewritten here to show the problem:

#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <sys/select.h>

main()
{
int nfds;
fd_set unixm;

for (nfds = 0; nfds < FD_SETSIZE; nfds++)
{
fprintf(stderr, "%d\n", nfds);
if(FD_ISSET(nfds, &unixm))
printf(".");
}
return 0;
}

This will segfault after nfds > 576. On this system, FD_SETSIZE is
the default of 1024. I believe that the limit should have been
FD_SETSIZE/NFDBITS but I am not sure what the designer's intentions
were, like why this information was copied in the first place.

Cheers,
Dick Johnson
***** FILE SYSTEM WAS MODIFIED *****
Penguin : Linux version 2.2.5 on an i686 machine (400.59 BogoMips).
Warning : It's hard to remain at the trailing edge of technology.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/