Subject: another socket bug
From: [email-masked] (Tim Newsham)

19 Mar 1998 09:14:54 -0800
Message-ID: <[email-masked]>
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
To: [email-masked]

Hi,

    Found another socket bug.  If you do a sendto() on a file descriptor
that isn't opened (or probably one that is opened but isn't a socket)
the program receives an exception and dies.  To test:

    #include <sys/types.h>
    #include <sys/socket.h>
    #include <netinet/in.h>

    main()
    {
        struct sockaddr_in ad;
        int s = 3, res;

        memset(&ad, 0, sizeof(ad));
        ad.sin_family = AF_INET;
        ad.sin_port = htons(23);
        ad.sin_addr.s_addr = inet_addr("10.200.200.3");
        res = sendto(s, "hi", 2, 0, (struct sockaddr *)&ad, sizeof ad);
        printf("res %d\n", res);
    }

This was tested against stock b19 cygwinb19.dll as well as a
(non-stock) b18 cygwin.dll.  This doesn't break well behaved programs,
but it causes programs to core dump that shouldn't.

Also, has anyone looked into the select() on 50 sockets == core dump
problem yet?

                                         Tim N.

-
For help on using this list (especially unsubscribing), send a message to
"[email-masked]" with one line of text: "help".