[Bug 215933] SCM_RIGHTS messages being lost, socket data being lost as well, with example code..

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Tue Jan 10 12:27:13 UTC 2017


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=215933

--- Comment #1 from ian at 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=0;
        if(socketpair(AF_UNIX,SOCK_STREAM,0,fds)==0){
                size_t sequence=0;
                int newpid=fork();
                if(newpid<0) exit(EX_OSERR);
                if(newpid==0){ close(fds[1]); run_consumer(fds[0]); }
                close(fds[0]);
                printf("Master ready..\n");
                for(size_t i=6000;i<8500;i++){
                        int tfd=open("/dev/null",O_WRONLY);
                        total+=send_test_message(fds[1],sequence++,i,-1);
                        total+=send_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 
8154 to 8192 when using a local stream socket buffer size of 8192 bytes.

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


More information about the freebsd-bugs mailing list