Subject: port-hpcmips/13789: gdb and emacs dump core
To: None <gnats-bugs@gnats.netbsd.org>
From: None <ben@wongs.net>
List: netbsd-bugs
Date: 08/27/2001 01:52:56
>Number:         13789
>Category:       port-hpcmips
>Synopsis:       Emacs dumps core under X; gdb dumps core when debugging emacs
>Confidential:   yes
>Severity:       critical
>Priority:       high
>Responsible:    port-hpcmips-maintainer
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Aug 26 22:54:00 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     
>Release:        NetBSD 1.5.1
>Organization:
	
>Environment:
	
System: NetBSD quince.wongs.net 1.5.1 NetBSD 1.5.1 (GENERIC) #38: Tue Jul 3 10:42:57 JST 2001 shin@touji:/u/obj/release/sys/arch/hpcmips/compile/GENERIC hpcmips


>Description:
	
Emacs 20.7, installed from pkgsrc, throws a signal 11 (segmentation
violation) when used with the X libraries that came with
NetBSD/hpcmips 1.5.1. 

Gdb, when run on emacs's corefile, also dumps core.

The problem occurs irregardless of what Xserver is used when running
emacs. ( I tried setting the DISPLAY to a NetBSD/i386 Xserver but
emacs still dumped core). However, emacs does work in a text-based
mode when given the -nw flag. The problem *may* be with libX11.so.

>How-To-Repeat:

# Install emacs and start X
  bash$ cd /usr/pkgsrc/editors/emacs; make update
  bash$ startx 

# Run emacs, it will dump core
  bash$ /usr/pkg/bin/emacs
  Fatal error (11).Segmentation fault (core dumped)

# Use gdb to debug emacs; it also dumps core (!)
  bash$ gdb /usr/pkg/bin/emacs emacs.core
  GNU gdb 4.17
  Copyright 1998 Free Software Foundation, Inc.
  GDB is free software, covered by the GNU General Public License, and you are
  welcome to change it and/or 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.
  This GDB was configured as "mipsel--netbsd"...Segmentation fault (core dumped)


# Use gdb to debug itself; not very helpful, but it doesn't dump core.
  bash$ gdb gdb gdb.core
  GNU gdb 4.17
  Copyright 1998 Free Software Foundation, Inc.
  GDB is free software, covered by the GNU General Public License, and you are
  welcome to change it and/or 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.
  This GDB was configured as "mipsel--netbsd"...(no debugging symbols found)...
  Core was generated by `gdb'.
  Program terminated with signal 11, Segmentation fault.
  Reading symbols from /usr/libexec/ld.elf_so...done.
  Reading symbols from /usr/lib/libedit.so.2...done.
  Reading symbols from /usr/lib/libkvm.so.5...done.
  Reading symbols from /usr/lib/libtermcap.so.0...done.
  Reading symbols from /usr/lib/libbfd.so.3...done.
  Reading symbols from /usr/lib/libc.so.12...done.
  #0  0x2028d164 in strlen ()
      at /u/src/release/src/lib/libc/arch/mips/string/strlen.S:1
  /u/src/release/src/lib/libc/arch/mips/string/strlen.S:1: No such file or directory.
  (gdb) bt
  #0  0x2028d164 in strlen ()
      at /u/src/release/src/lib/libc/arch/mips/string/strlen.S:1
  #1  0x44b4d4 in allocate_psymtab ()
  #2  0x44b810 in start_psymtab_common ()
  #3  0x4ee55c in ecoff_relocate_efi ()
  #4  0x2028b4ec in malloc ()
  #5  0x500be4 in mmalloc ()
  #6  0x500d84 in xmmalloc ()
  #7  0x500e98 in xmalloc ()
  #8  0x2011864c in _obstack_newchunk ()
  #9  0x4edbe8 in ecoff_relocate_efi ()
  warning: Hit beginning of text section without finding
  warning: enclosing function for address 0x10a70
  This warning occurs if you are debugging a function without any symbols
  (for example, in a stripped executable).  In that case, you may wish to
  increase the size of the search with the `set heuristic-fence-post' command.

  Otherwise, you told GDB there was a function where there isn't one, or
  (more likely) you have encountered a bug in GDB.
  Current language:  auto; currently asm


>Fix:

No known fix.

A workaround is to use 'emacs -nw', which forces a text-based
interface even when using X. 
>Release-Note:
>Audit-Trail:
>Unformatted: