Hi!
> A tweak to improve recvfrom01.c and recvmsg01.c --
> there's a loop in the child server process which walks all available fds and
> attempts to read those where the relevant fd_set bit is set.
> Sadly, when there's more file descriptors available than bits in the fd_set,
> this loop will happily walk off the end of the fd_set, clearing bits along
> the way.
> This leads to intermittent segfaults and thus false positives in these two
> tests.
What arch is this? On my system both getfdsetsize() and FD_SETSIZE are
set to 1024?
> =====
> diff --git a/testcases/kernel/syscalls/recvfrom/recvfrom01.c
> b/testcases/kernel/syscalls/recvfrom/recvfrom01.c
> index b5ab4a0..5e68d98 100644
> --- a/testcases/kernel/syscalls/recvfrom/recvfrom01.c
> +++ b/testcases/kernel/syscalls/recvfrom/recvfrom01.c
> @@ -319,7 +319,7 @@ void do_child()
> /* send something back */
> (void)write(newfd, "hoser\n", 6);
> }
> - for (fd = 0; fd < nfds; ++fd)
> + for (fd = 0; fd < nfds && fd < FD_SETSIZE; ++fd)
> if (fd != sfd && FD_ISSET(fd, &rfds)) {
> cc = read(fd, buf, sizeof(buf));
> if (cc == 0 || (cc < 0 && errno != EINTR)) {
What about we set nfds to sfd + 1 and for each child we accept we set
nfds to max(nfds, newfd+1)?
--
Cyril Hrubis
[email protected]
------------------------------------------------------------------------------
"Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
Instantly run your Selenium tests across 300+ browser/OS combos. Get
unparalleled scalability from the best Selenium testing platform available.
Simple to use. Nothing to install. Get started now for free."
http://p.sf.net/sfu/SauceLabs
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list