Solaris 7 Socket Problems VNC

Al Piszcz 'peesh' apiszcz "at" apiszcz.mnsinc.com
Sun, 20 Dec 1998 00:25:28 +0000


The server appears to build ok with Solaris7 (SPARC).
However the following error occurs:

apiszcz "at" apiszcz:/export/home/apiszcz/.vnc_67 % more apiszcz:11.log
_XSERVTransSocketCreateListener: failed to bind listener
_XSERVTransSocketUNIXCreateListener: ...SocketCreateListener() failed
_XSERVTransMakeAllCOTSServerListeners: failed to create listener for local

Fatal server error:
Failed to establish all listening sockets
xrdb: Interrupted system call
xrdb: Can't open display 'apiszcz:11'
xsetroot:  unable to open display 'apiszcz:11'
xterm Xt error: Can't open display: apiszcz:11

We plan to dig deeper but was wondering if anyone else has 
been here already?

Thanks.



---

More details here in a debug session:

##### VIEW 1
286                 CreateWellKnownSockets();
286                 CreateWellKnownSockets();
(gdb) s
CreateWellKnownSockets () at connection.c:281
281         FD_ZERO(&AllSockets);
(gdb) s
282         FD_ZERO(&AllClients);
(gdb) where
#0  CreateWellKnownSockets () at connection.c:282
#1  0x3020c in main (argc=1, argv=0xeffff574) at main.c:286
(gdb) s
283         FD_ZERO(&LastSelectMask);
(gdb) s
284         FD_ZERO(&ClientsWithInput);
(gdb) s
287         for (i=0; i<MAXSOCKS; i++) ConnectionTranslation[i] = 0;
(gdb) s
296         lastfdesc = sysconf(_SC_OPEN_MAX) - 1;
(gdb) s
308         if (lastfdesc > MAXSOCKS)
(gdb) n
315         FD_ZERO (&WellKnownConnections);
(gdb) n
317         sprintf (port, "%d", atoi (display));
(gdb) n
319         if (protNoListen)
(gdb) n
325         if ((_XSERVTransMakeAllCOTSServerListeners (port, &partial,
(gdb) n
_XSERVTransSocketINETCreateListener: ...SocketCreateListener() failed
_XSERVTransMakeAllCOTSServerListeners: server already running
352         if (!XFD_ANYSET (&WellKnownConnections))
(gdb) 

##### VIEW 2
$3 = 48 '0'
(gdb) n
325         if ((_XSERVTransMakeAllCOTSServerListeners (port, &partial,
(gdb) s
_XSERVTransMakeAllCOTSServerListeners (port=0xeffff460 "0", 
    partial=0xeffff47c, count_ret=0x26b4d4, ciptrs_ret=0x254714)
    at ../../../lib/xtrans/Xtrans.c:1101
1101        PRMSG (2,"MakeAllCOTSServerListeners(%s,%x)\n",
(gdb) n
1104        *count_ret = 0;
(gdb) s
1106        for (i = 0; i < NUMTRANS; i++)
(gdb) s
1108            Xtransport *trans = Xtransports[i].transport;
(gdb) s
1110            if (trans->flags&TRANS_ALIAS || trans->flags&TRANS_NOLISTEN)
(gdb) s
1113            sprintf(buffer,"%s/:%s", trans->TransName, port ? port : "");
(gdb) s
1115            PRMSG (5,"MakeAllCOTSServerListeners: opening %s\n",
(gdb) s
1118            if ((ciptr = TRANS(OpenCOTSServer(buffer))) == NULL)
(gdb) s
_XSERVTransOpenCOTSServer (address=0xeffff2e8 "tcp/:0")
    at ../../../lib/xtrans/Xtrans.c:594
594         PRMSG (2,"OpenCOTSServer(%s)\n", address, 0, 0);
(gdb) s
595         return TRANS(Open) (XTRANS_OPEN_COTS_SERVER, address);
(gdb) s
_XSERVTransOpen (type=2, address=0xeffff2e8 "tcp/:0")
    at ../../../lib/xtrans/Xtrans.c:401
401         char                *protocol = NULL, *host = NULL, *port = NULL;
(gdb) s
402         XtransConnInfo      ciptr = NULL;
(gdb) s
405         PRMSG (2,"Open(%d,%s)\n", type, address, 0);
(gdb) s
417         if (TRANS(ParseAddress) (address, &protocol, &host, &port) == 0)
(gdb) s
_XSERVTransParseAddress (address=0xeffff2e8 "tcp/:0", protocol=0xeffff1cc, 
    host=0xeffff1c8, port=0xeffff1c4) at ../../../lib/xtrans/Xtrans.c:228
228         PRMSG (3,"ParseAddress(%s)\n", address, 0, 0);
(gdb) s
232         tmpptr = mybuf = (char *) xalloc (strlen (address) + 1);
(gdb) s
Xalloc (amount=7) at utils.c:1143
1143        if ((long)amount <= 0) {
(gdb) n
1147        amount = (amount + (sizeof(long) - 1)) & ~(sizeof(long) - 1);
(gdb) n
1153        if (ptr = (pointer)malloc(amount)) {
(gdb) n
1154            return (unsigned long *)ptr;
(gdb) n
1159    }
(gdb) n
_XSERVTransParseAddress (address=0xeffff2e8 "tcp/:0", protocol=0xeffff1cc, 
    host=0xeffff1c8, port=0xeffff1c4) at ../../../lib/xtrans/Xtrans.c:233
233         strcpy (mybuf, address);
(gdb) s
239         _protocol = mybuf;
(gdb) p mybuf
$4 = 0x277e80 "tcp/:0"
(gdb) n
241         if ((mybuf = strpbrk (mybuf,"/:")) == NULL)
(gdb) n
251         if (*mybuf == ':')
(gdb) n
273             *mybuf ++= '\0'; /* put a null at the end of the protocol */
(gdb) n
275             if (strlen(_protocol) == 0)
(gdb) n
290         _host = mybuf;
(gdb) p mybuf
$5 = 0x277e84 ":0"
(gdb) n
292         if ((mybuf = strchr (mybuf,':')) == NULL)
(gdb) n
301         *mybuf ++= '\0';
(gdb) n
303         if (strlen(_host) == 0)
(gdb) n
305             TRANS(GetHostname) (hostnamebuf, sizeof (hostnamebuf));
(gdb) p hostnamebuf
$6 = "\000\000\000\020\000\000\000\020\000\000\000\a\024[\200\000&\000\000%8\000\000\000\000\001\000#\227UJ\233\220\230\000\003\001\000\000\000\000\000\000\000\002\000\000\003F\000\000\000\003\000\000\000\000X]Vh\000\000\000\000\000\000\000\000c;UJ\000\000\000\001~0c.\000\000\000\b{\017\bhd\000\000\000\000{\tP{\001H\000\000\000", '\000' <repeats 36 times>, "jr\f\237", '\000' <repeats 11 times>, "\001~0q\030\224\037\000\000\201{\017\bh\2072\000\000\000\000{\tP{\001H\000\000\003"...
(gdb) n
306             _host = hostnamebuf;
(gdb) p hostnamebuf
$7 = "apiszcz\000\000\000\000\a\024[\200\000&\000\000%8\000\000\000\000\001\000#\227UJ\233\220\230\000\003\001\000\000\000\000\000\000\000\002\000\000\003F\000\000\000\003\000\000\000\000X]Vh\000\000\000\000\000\000\000\000c;UJ\000\000\000\001~0c.\000\000\000\b{\017\bhd\000\000\000\000{\tP{\001H\000\000\000", '\000' <repeats 36 times>, "jr\f\237", '\000' <repeats 11 times>, "\001~0q\030\224\037\000\000\201{\017\bh\2072\000\000\000\000{\tP{\001H\000\000\003"...
(gdb) n
311         if (*mybuf == ':')
(gdb) n
315         }
(gdb) n
321         _port = mybuf;
(gdb) n
343         if ((*protocol = (char *) xalloc(strlen (_protocol) + 1)) == NULL)
(gdb) n
353             strcpy (*protocol, _protocol);
(gdb) n
355         if ((*host = (char *) xalloc (strlen (_host) + 1)) == NULL)
(gdb) n
n366            strcpy (*host, _host);
(gdb) n
368         if ((*port = (char *) xalloc (strlen (_port) + 1)) == NULL)
(gdb) n
380             strcpy (*port, _port);
(gdb) n
382         xfree (tmpptr);
(gdb) p *host
$8 = 0x277ea0 "apiszcz"
(gdb) n
384         return 1;
(gdb) n
385     }
(gdb) n
_XSERVTransOpen (type=2, address=0xeffff2e8 "tcp/:0")
    at ../../../lib/xtrans/Xtrans.c:425
425         if ((thistrans = TRANS(SelectTransport) (protocol)) == NULL)
(gdb) n
438         switch (type)
(gdb) n
447             ciptr = thistrans->OpenCOTSServer(thistrans, protocol, host, port);
(gdb) n
449             break;
(gdb) n
464         if (ciptr == NULL)
(gdb) n
475         ciptr->transptr = thistrans;
(gdb) n
476         ciptr->port = port;                 /* We need this for TRANS(Reopen) */
(gdb) n
478         xfree (protocol);
(gdb) n
479         xfree (host);
(gdb) n
481         return ciptr;
(gdb) n
482     }
(gdb) n
_XSERVTransOpenCOTSServer (address=0xeffff2e8 "tcp/:0")
    at ../../../lib/xtrans/Xtrans.c:596
596     }
(gdb) n
_XSERVTransMakeAllCOTSServerListeners (port=0xeffff460 "0", 
    partial=0xeffff47c, count_ret=0x26b4d4, ciptrs_ret=0x254714)
    at ../../../lib/xtrans/Xtrans.c:1129
1129            if ((status = TRANS(CreateListener (ciptr, port))) < 0)
(gdb) n
_XSERVTransSocketINETCreateListener: ...SocketCreateListener() failed
1131                if (status == TRANS_ADDR_IN_USE)
(gdb) backtrace
#0  _XSERVTransMakeAllCOTSServerListeners (port=0xeffff460 "0", 
    partial=0xeffff47c, count_ret=0x26b4d4, ciptrs_ret=0x254714)
    at ../../../lib/xtrans/Xtrans.c:1131
#1  0x80688 in CreateWellKnownSockets () at connection.c:325
#2  0x3020c in main (argc=1, argv=0xeffff58c) at main.c:286
(gdb) n
1139                    PRMSG (1,
(gdb) n
_XSERVTransMakeAllCOTSServerListeners: server already running
1141                      0, 0, 0);
(gdb) n
1143                    for (j = 0; j < *count_ret; j++)
(gdb) n
1146                    *count_ret = 0;
(gdb) n
1147                    *ciptrs_ret = NULL;
(gdb) n
1148                    *partial = 0;
(gdb) n
1149                    return -1;
(gdb) n
1192    }
(gdb) n
CreateWellKnownSockets () at connection.c:352
352         if (!XFD_ANYSET (&WellKnownConnections))
(gdb) n
353             FatalError ("Cannot establish any listening sockets - Make sure an X server isn't already running");



##### at one point 

(gdb) backtrace
#0  _XSERVTransParseAddress (address=0xeffff2e8 "tcp/:0", protocol=0xeffff1cc, 
    host=0xeffff1c8, port=0xeffff1c4) at ../../../lib/xtrans/Xtrans.c:232
#1  0x9019c in _XSERVTransOpen (type=2, address=0xeffff2e8 "tcp/:0")
    at ../../../lib/xtrans/Xtrans.c:417
#2  0x90548 in _XSERVTransOpenCOTSServer (address=0xeffff2e8 "tcp/:0")
    at ../../../lib/xtrans/Xtrans.c:595
#3  0x911f0 in _XSERVTransMakeAllCOTSServerListeners (port=0xeffff460 "0", 
    partial=0xeffff47c, count_ret=0x26b4d4, ciptrs_ret=0x254714)
    at ../../../lib/xtrans/Xtrans.c:1118
#4  0x80688 in CreateWellKnownSockets () at connection.c:325
#5  0x3020c in main (argc=1, argv=0xeffff58c) at main.c:286
                      ___________._______________________
                     < Al Piszcz | apiszcz "at" mnsinc.com > 

---------------------------------------------------------------------
The VNC mailing list     -   see http://www.orl.co.uk/vnc/intouch.html
---------------------------------------------------------------------