Skip site navigation (1)Skip section navigation (2)
Date:      06 Dec 2002 14:43:26 -0600
From:      Craig Boston <craig@meoqu.gank.org>
To:        freebsd-stable@freebsd.org
Subject:   SMP users: Please test (possible bug in select())
Message-ID:  <1039207405.306.15.camel@owen1492.it.oot>

next in thread | raw e-mail | index | archive | help
If anyone has an SMP system that they don't mind an ungraceful shutdown
for a good cause, please compile the following program:

#include <sys/types.h>
#include <sys/time.h>
#include <unistd.h>

int main (int argc, char *argv[])
{
        fd_set a, b;
        struct timeval tv;

        FD_ZERO(&a);
        FD_SET(0, &a);
        FD_SET(1, &a);
        FD_SET(2, &a);
        while(1)
        {
                bzero(&tv, sizeof(tv));
                b = a;
                select(3, &b, 0, 0, &tv);
        }
}

Start off by running one copy of this program PER CPU (i.e. run it twice
on a dual CPU box), and let it run for 5 minutes or so.  If your system
is still up and running, run two more copies and wait another 5
minutes.  Bonus points for running from within X.

I'm trying to track down the cause of my mysterious SMP-related freezes
that happen every 6-8 days, and by chance found out that the above
program causes it to wedge MUCH faster, usually within 30 seconds or
so.  I run it as a normal user, not root.

I strongly suspected hardware problems, until I found that I was able to
break into the debugger via serial console.  The results of that were
detailed in the "Help needed debugging hard lock" thread. 
Single-stepping gives clues of a deadlock, but I haven't been able to
figure out why.  I don't want to open a PR until I can verify whether or
not this happens on any other machine than mine.

Thank you,
Craig


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-stable" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1039207405.306.15.camel>