From xemacs-m  Wed May 28 10:56:02 1997
Received: from berio.phx.mcd.mot.com ([144.191.25.196])
	by xemacs.org (8.8.5/8.8.5) with SMTP id KAA06643
	for <xemacs-beta@xemacs.org>; Wed, 28 May 1997 10:56:00 -0500 (CDT)
Received: by berio.phx.mcd.mot.com (AIX 4.1/UCB 5.64/4.03)
          id AA17480; Wed, 28 May 1997 08:54:38 -0700
Date: Wed, 28 May 1997 08:54:38 -0700
Message-Id: <9705281554.AA17480@berio.phx.mcd.mot.com>
From: "Lynn D. Newton" <lnewton@berio.phx.mcd.mot.com>
To: XEmacs Beta Bugs <xemacs-beta@xemacs.org>
Cc: Michael Sperber <sperber@informatik.uni-tuebingen.de>
Subject: XEmacs 20.2 core dumps when detached from net
X-Mailer: VM 6.22 under 19.15p4 XEmacs Lucid
Comments: Hyperbole mail buttons accepted, v04.023.
X-Face:  FVNLrR&aQu[q[N3kO<A5Au*4b"pWyOi13$\H%OVNM8&P{?7;KTRLXSU)c'&Gg3{7GD.p:05
 To5$NCN#r-;vs&Qi@jhk\a@l;bMgx77!GI>4+!:X-+LgxFf'("(:8&7z+:!,24n1@j?C25:p>hno)_
 hPa5S&WgH"E-!{{N^-Cx}MiI_O'dU0


----------------------------- my-system ------------------------------
Hardware:    Motorola PowerPC Desktop (604e @200MHz) and NCD X terminal
Editor:      XEmacs 20.2
Sys Config:  powerpc-ibm-aix4.1.4.0
OS Type:     aix
Window Sys:  X
----------------------------------------------------------------------

XEmacs 20.2 run as an X client core dumps immediately
when the host system is detached from the network. This
is a *VERY BAD* bug and is causing me a great deal of
personal grief!

o This happens also in 19.15 on AIX. I reported it to
  crashes.xemacs, but got no responses. It does *not*
  happen in 19.15 on the UNIX SVR4 operating system.

o It happens also when using the distributed binary kit
  for 19.15. (For IBM rs6000?)

o Yesterday I built version 20 for the first time at
  this site. The scenario is identical in all cases.
  Details follow.

The Scenario:
-------------

If DISPLAY is defined, executing xemacs -q
-no-site-file from a command line causes xemacs to core
dump immediately if the system is not attached to the
net. (Details below.) It does not fail in tty-mode
(using -nw).

The Lisp Backtrace:
-------------------

  make-device(x nil)
  # bind (display)
  make-x-device(nil)
  init-x-win()
  # bind (debugger debug-on-error command-line-args-left)
  command-line()
  # (unwind-protect ...)
  normal-top-level()
  # (condition-case ... . error)
  # (catch top-level ...)

The Stacktrace:
---------------

$ gdb /proj/gnu/xemacs/bin/xemacs20 core.20
GDB is free software and you are welcome to distribute copies of it
 under certain conditions; type "show copying" to see the conditions.
There is absolutely no warranty for GDB; type "show warranty" for details.
GDB 4.16 (powerpc-ibm-aix4.1.4.0), 
Copyright 1996 Free Software Foundation, Inc...

warning: core file may not match specified executable file.
Core was generated by `xemacs-20.2'.
Program terminated with signal 11, Segmentation fault.
#0  0x10000304 in fatal_error_signal ()
(gdb) where
#0  0x10000304 in fatal_error_signal ()
#1  <signal handler called>
#2  0xd01a0564 in statacl ()
#3  0x101c7284 in gethostbyname ()
#4  0x100ccf44 in get_internet_address ()
#5  0x100cd4c0 in canonicalize_host_name ()
#6  0x10453b74 in x_canonicalize_console_connection ()
#7  0x10453e28 in x_canonicalize_device_connection ()
#8  0x1004e040 in canonicalize_device_connection ()
#9  0x1004e26c in Ffind_device ()
#10 0x1004e548 in Fmake_device ()
#11 0x100139d0 in primitive_funcall ()
#12 0x10013c7c in funcall_subr ()
#13 0x10012f7c in funcall_recording_as ()
#14 0x100130bc in Ffuncall ()
#15 0x103f4c58 in Fbyte_code ()
#16 0x10014114 in funcall_lambda ()
#17 0x10013024 in funcall_recording_as ()
#18 0x100130bc in Ffuncall ()
#19 0x103f4c58 in Fbyte_code ()
#20 0x10014114 in funcall_lambda ()
#21 0x10013024 in funcall_recording_as ()
#22 0x100130bc in Ffuncall ()
#23 0x103f4c58 in Fbyte_code ()
#24 0x10014114 in funcall_lambda ()
#25 0x10013024 in funcall_recording_as ()
#26 0x100130bc in Ffuncall ()
#27 0x103f4c58 in Fbyte_code ()
#28 0x10014114 in funcall_lambda ()
#29 0x10013de0 in apply_lambda ()
#30 0x10012c38 in Feval ()
#31 0x1000fd20 in condition_case_1 ()
#32 0x1017e110 in top_level_1 ()
#33 0x1000f710 in internal_catch ()
#34 0x1017e2ec in initial_command_loop ()
#35 0x100018d4 in xemacs_20_2_ ()
#36 0x10002208 in main ()
#37 0x100001f8 in __start ()

Config Details:
---------------

$ configure \
  --prefix=/proj/gnu/xemacs20 \
  --cflags="-O2" \
  --dynamic=no \
  --const-is-losing=no \
  --with-gnu-make \
  --site-includes=/usr/tools/remote/include \
  --site-libraries=/usr/tools/remote/lib \
  --with-scrollbars=lucid \
  --with-menubars=lucid \
  --with-dialogs=motif \
  --with-xpm \
  --with-gif \
  --with-jpeg \
  --with-sound=nas \
  --with-database=dbm
- You did not tell me what kind of host system you want to configure.
- I will attempt to guess the kind of system this is.
- Looks like this is a powerpc-ibm-aix4.1.4.0
checking for ln -s
checking the configuration name
checking for gcc
checking how to run the C preprocessor
checking for a BSD compatible install
checking for bison
checking for AIX
checking for mach/mach.h
checking for sys/stropts.h
checking for sys/timeb.h
checking for sys/time.h
checking for unistd.h
checking for utime.h
checking for sys/wait.h
checking for libintl.h
checking for locale.h
checking for libgen.h
checking for linux/version.h
checking for kstat.h
checking for sys/pstat.h
checking for inttypes.h
checking for ANSI C header files
checking for whether time.h and sys/time.h may both be included
checking for sys_siglist declaration in signal.h or unistd.h
checking for struct utimbuf
checking for return type of signal handlers
checking for struct timeval
checking for struct tm in time.h
checking for tm_zone in struct tm
checking for tzname
checking for lack of working const
checking byte ordering
checking for long file names
checking for -xildoff compiler flag
checking for specified window system
  No window system specified.  Looking for X11.
checking for X include and library files with xmkmf
  Using X11.
examining the machine- and system-dependent files to find out
 - which libraries the lib-src programs will want, and
 - whether the GNU malloc routines are usable.
checking for -ldnet
checking for -lkstat
checking for -lintl
checking for -lXbsd
checking for -lpthreads
checking for XFree86
checking for -lX11
checking for -lXau
checking for -lDtSvc
checking for -lDnd
checking the version of X11 being used
checking for X11/Xlocale.h
checking for -lm
checking for -lXmu
checking for compface.h
checking for png.h
checking for pow
checking for -lz
checking for -lpng
checking for declaration of h_errno in netdb.h
checking for sigsetjmp
checking whether localtime caches TZ
checking whether cross-compiling
checking for whether gettimeofday can't accept two arguments
checking for whether inline functions are supported
checking for working alloca.h
checking for alloca
checking for pid_t in sys/types.h
checking for vfork.h
checking for working vfork
checking for strcoll
checking size of short
checking size of int
checking size of long
checking for acosh
checking for asinh
checking for atanh
checking for cbrt
checking for closedir
checking for dup2
checking for eaccess
checking for fmod
checking for fpathconf
checking for frexp
checking for ftime
checking for gethostname
checking for getpagesize
checking for gettimeofday
checking for getcwd
checking for getwd
checking for logb
checking for lrand48
checking for matherr
checking for mkdir
checking for mktime
checking for perror
checking for poll
checking for random
checking for realpath
checking for rename
checking for res_init
checking for rint
checking for rmdir
checking for select
checking for setitimer
checking for setpgid
checking for setlocale
checking for setsid
checking for sigblock
checking for sighold
checking for sigprocmask
checking for strcasecmp
checking for strerror
checking for tzset
checking for utimes
checking for waitpid
checking for mmap
checking for socket
checking for netinet/in.h
checking for arpa/inet.h
checking for sun_len member in struct sockaddr_un
checking for dirent.h
checking how to do terminal I/O
checking for termios.h
checking for nlist.h
checking for -lncurses
checking for -ldbm


Configured for `powerpc-ibm-aix4.1.4.0'.

  Where should the build process find the source code?    /proj/gnu/xemacs-20.2
  What installation prefix should install use?		  /proj/gnu/xemacs20
  What operating system and machine description files should XEmacs use?
        `s/aix4-1.h' and `m/ibmrs6000.h'
  What compiler should XEmacs be built with?              gcc -O2
  Should XEmacs use the GNU version of malloc?            yes
  Should XEmacs use the relocating allocator for buffers? yes
  What window system should XEmacs use?                   x11
  Additional header files:                                /usr/tools/remote/include
  Additional libraries:                                   /usr/tools/remote/lib
  Compiling in support for XPM.
  Compiling in support for GIF image conversion.
  Compiling in support for JPEG image conversion.
  Compiling in support for PNG image conversion.
  Compiling in network sound support.
  Compiling in support for DBM.
  Compiling in support for CDE.
  Compiling in support for ToolTalk.
  Using the Lucid menubar.
  Using the Lucid scrollbar.
  Using the Motif dialog boxes.

The above configure report is appended to "Installation" file.

creating config.status
creating Makefile
creating lib-src/Makefile.in
creating src/Makefile.in
creating lwlib/Makefile.in
creating dynodump/Makefile.in
creating src/config.h
src/config.h is unchanged
creating src/Makefile
creating lwlib/Makefile
creating lib-src/Makefile
creating dynodump/Makefile

Some Other Details:
-------------------

o I use a Motorola PowerPC desktop and an X terminal at
  home.
  This bug was discovered when, as the last step before
  packing up the system to take home, I detached it
  from the net to make sure everything still worked
  right. Everything does except XEmacs.

o To reproduce, turn off networking in whatever
  appropriate way. I shut down the nameserver, did
  stopsrc -g tcpip, and stopsrc -g nfs, which seems to
  be sufficient. One might also do rmdev -l en0, but
  this is unnecessary. Thereafter xemacs core dumps as
  described.

o I reproduced this bug on a generic newly installed
  test system, with only XEmacs and an ordinary user
  account. (Using a VGA monitor.)

A Hunch:
--------

It may be that the gethostbyname() library routine is
returning null. Under the bug conditions, there is no
/etc/resolv.conf, and DNS is not running. localhost,
the system host, and the X terminal host IP addresses
are in /etc/hosts. Just why gethostbyname() might
return null under these conditions I haven't a clue.
Nor what to do about it. We can't change
gethostbyname() because it's a library routine (and IBM
is unlikely to), but we can change XEmacs to work
around it.

HELP, HELP!!

==================================
Lynn D. Newton
Motorola Computer Group
Tempe, AZ
http://www.eecs.umich.edu/~lnewton
==================================

