delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1998/03/19/09:14:54

From: newsham AT lava DOT net (Tim Newsham)
Subject: another socket bug
19 Mar 1998 09:14:54 -0800 :
Message-ID: <m0yF6IC-00119cC.cygnus.gnu-win32@malasada.lava.net>
Mime-Version: 1.0
To: gnu-win32 AT cygnus DOT com

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
"gnu-win32-request AT cygnus DOT com" with one line of text: "help".

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019