Subject: Re: [ vncserver ] - Getting interface configuration (4): Device not
To: Joel CARNAT <joel@carnat.net>
From: Eduardo Horvath <eeh@NetBSD.org>
List: port-sparc64
Date: 07/12/2006 17:07:00
This is probably due to code that is not LP64 clean.

On Wed, 12 Jul 2006, Joel CARNAT wrote:

> I'm trying to set VNC access from Windows to NetBSD/sparc64 (Ultra 10)
> using the tightvnc client/server tools. When starting "vncserver" on
> the U10, I get the following messages:
> ###############################################
> Getting interface configuration (4): Device not configured
> 12/07/06 14:33:17 Xvnc version 3.3.tight1.2.9
> ###############################################
> then it cores.
> 
> Using ktrace/kdump I got more details but don't understand them :)
> ###############################################
>    805      1 Xvnc     CALL  bind(1,0xffffffffffffc120,0x13)
>    805      1 Xvnc     NAMI  "/tmp/.X11-unix/X4"
>    805      1 Xvnc     RET   bind 0, -16096/0xffffffffffffc120
>    805      1 Xvnc     CALL  listen(1,0x80)
>    805      1 Xvnc     RET   listen 0, 128/0x80
>    805      1 Xvnc     CALL  umask(0x12)
>    805      1 Xvnc     RET   umask 0, 3563776/0x366100
>    805      1 Xvnc     CALL
> ioctl(0,_IOWR('i',0x24,0x10),0xffffffffffffbc20)

The program is doing a SIOCGIFCONF ioctl on FD 0, which is usually stdin.  
What's probably happened is that the file descriptor number has been 
stored in a 64-bit variable, but its address is passed to some routine as 
a reference to a 32-bit variable.  On big-endan machines when you do this
you always get zero, instead of the value you really want.

>    805      1 Xvnc     GIO   fd 0 wrote 16 bytes
>        "\0\0\b\0\0\0\0\"\M^?\M^?\M^?\M^?\M^?\M^?\M-<0"
>    805      1 Xvnc     RET   ioctl -1 errno 6 Device not configured
>    805      1 Xvnc     CALL  issetugid
>    805      1 Xvnc     RET   issetugid 0, 47/0x2f
>    805      1 Xvnc     CALL  issetugid
>    805      1 Xvnc     RET   issetugid 0, 465/0x1d1
>    805      1 Xvnc     CALL  open(0xffffffffffffa320,0,0)
>    805      1 Xvnc     NAMI  "/usr/share/nls/nls.alias.db"
>    805      1 Xvnc     RET   open -1 errno 2 No such file or directory
>    805      1 Xvnc     CALL  open(0x40cf0858,0,0)
>    805      1 Xvnc     NAMI  "/usr/share/nls/nls.alias"
>    805      1 Xvnc     RET   open 3
>    805      1 Xvnc     CALL  fcntl(3,2,1)
>    805      1 Xvnc     RET   fcntl 0, 2
>    805      1 Xvnc     CALL  __fstat30(3,0xffffffffffffa5e0)
>    805      1 Xvnc     RET   __fstat30 0, -23072/0xffffffffffffa5e0
>    805      1 Xvnc     CALL  mmap(0,0x5f0,1,2,3,0,0)
>    805      1 Xvnc     RET   mmap 1077166080/0x40344000
>    805      1 Xvnc     CALL  close(3)
>    805      1 Xvnc     RET   close 0, 1520/0x5f0
>    805      1 Xvnc     CALL  munmap(0x40344000,0x5f0)
>    805      1 Xvnc     RET   munmap 0, 1520/0x5f0
>    805      1 Xvnc     CALL
> open(0xffffffffffffad90,0,0xffffffffffffa8c0)
>    805      1 Xvnc     NAMI  "/usr/share/nls/C/libc.cat"
>    805      1 Xvnc     RET   open 3
>    805      1 Xvnc     CALL  __fstat30(3,0xffffffffffffa840)
>    805      1 Xvnc     RET   __fstat30 0, -22464/0xffffffffffffa840
>    805      1 Xvnc     CALL  mmap(0,0x10b7,1,1,3,0,0)
>    805      1 Xvnc     RET   mmap 1077166080/0x40344000
>    805      1 Xvnc     CALL  close(3)
>    805      1 Xvnc     RET   close 0, 4279/0x10b7
>    805      1 Xvnc     CALL  munmap(0x40344000,0x10b7)
>    805      1 Xvnc     RET   munmap 0, 4279/0x10b7
>    805      1 Xvnc     CALL  write(2,0xffffffffffffa6d0,0x3b)
>    805      1 Xvnc     GIO   fd 2 wrote 59 bytes
>        "Getting interface configuration (4): Device not configured
>        "
> ###############################################
> 
> I tried doing the same on my i386 where it worked...
> Both running 3.99.21 (gcc 3.3.6).
> 
> The only thing not looking the same is /tmp/.X11-unix/ content.
> On i386 (working), I can see "X1=" files but on the sparc64 (faulty) I
> can see "X1" (no '=' in the filename). The rights are the same though
> and both are "socket" according to `file`.
> 
> On the U10, I can have a running (local) xdm.
> I mean I tested configuring xdm (local and remote) and it works.
> 
> any clue ?
> TIA,
> 	Jo
> 
>