Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 10 Jan 2017 12:27:13 +0000
From:      bugzilla-noreply@freebsd.org
To:        freebsd-bugs@FreeBSD.org
Subject:   [Bug 215933] SCM_RIGHTS messages being lost, socket data being lost as well, with example code..
Message-ID:  <bug-215933-8-VI8ipAg6wL@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-215933-8@https.bugs.freebsd.org/bugzilla/>
References:  <bug-215933-8@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D215933

--- Comment #1 from ian@niw.com.au ---
By adding a small delay to the example code the problem becomes
far more consistently repeatable.

int
main(int argc, char *argv[]){
        int fds[2];
        size_t total=3D0;
        if(socketpair(AF_UNIX,SOCK_STREAM,0,fds)=3D=3D0){
                size_t sequence=3D0;
                int newpid=3Dfork();
                if(newpid<0) exit(EX_OSERR);
                if(newpid=3D=3D0){ close(fds[1]); run_consumer(fds[0]); }
                close(fds[0]);
                printf("Master ready..\n");
                for(size_t i=3D6000;i<8500;i++){
                        int tfd=3Dopen("/dev/null",O_WRONLY);
                        total+=3Dsend_test_message(fds[1],sequence++,i,-1);
                        total+=3Dsend_test_message(fds[1],sequence++,0,tfd);
                        close(tfd);
 ----->                 usleep(100);
                }
        }
        printf("Master sent a total of %zd bytes\n",total);
        usleep(50000);
        exit(0);
}

With this change I have 100% consistent loss of data for large frame sizes =
of=20
8154 to 8192 when using a local stream socket buffer size of 8192 bytes.

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-215933-8-VI8ipAg6wL>