From xemacs-m  Fri Dec  6 12:36:01 1996
Received: from altair.xemacs.org (steve@xemacs.miranova.com [206.190.83.19]) by xemacs.cs.uiuc.edu (8.8.3/8.8.3) with ESMTP id MAA10947 for <xemacs-beta@xemacs.org>; Fri, 6 Dec 1996 12:35:59 -0600 (CST)
Received: (from steve@localhost)
          by altair.xemacs.org (8.8.4/8.8.4)
	  id KAA20873; Fri, 6 Dec 1996 10:45:16 -0800
Sender: steve@xemacs.org
To: xemacs-beta@xemacs.org
Subject: [Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>] Re: libc.5.4.15-16 lead to coredump for emacs
X-Url: http://www.miranova.com/%7Esteve/
Mail-Copies-To: never
X-Face: #!T9!#9s-3o8)*uHlX{Ug[xW7E7Wr!*L46-OxqMu\xz23v|R9q}lH?cRS{rCNe^'[`^sr5"
 f8*@r4ipO6Jl!:Ccq<xoV[Qz2u8<8-+Vwf2gzJ44lf_/y9OaQ`@#Q65{U4/TC)i2`~/M&QI$X>p:9I
 OSS'2{-)-4wBnVeg0S\O4Al@)uC[pD|+
X-Attribution: sb
From: Steven L Baur <steve@miranova.com>
Mime-Version: 1.0 (generated by tm-edit 7.95)
Content-Type: multipart/mixed;
 boundary="Multipart_Fri_Dec__6_10:45:16_1996-1"
Content-Transfer-Encoding: 7bit
Date: 06 Dec 1996 10:45:16 -0800
Message-ID: <m2ohg7ms03.fsf@altair.xemacs.org>
Lines: 76
X-Mailer: Red Gnus v0.72/XEmacs 19.15

--Multipart_Fri_Dec__6_10:45:16_1996-1
Content-Type: text/plain; charset=US-ASCII

What are the implications of fixing this?  It looks written in stone
that getwd shall be used.

-- 
steve@miranova.com baur
Unsolicited commercial e-mail will be billed at $250/message.
"Bill Clinton is a bore.  He doesn't have a creative bone in his
body."  -- David Brinkley

--Multipart_Fri_Dec__6_10:45:16_1996-1
Content-Type: message/rfc822

X-From-Line: owner-linux-gcc-outgoing@vger.rutgers.edu  Fri Dec  6 02:05:18 1996
Return-Path: <owner-linux-gcc-outgoing@vger.rutgers.edu>
Received: from nic.funet.fi (nic.funet.fi [128.214.248.6])
          by deanna.miranova.com (8.8.4/8.8.4) with ESMTP
	  id CAA27670 for <steve@miranova.com>; Fri, 6 Dec 1996 02:05:16 -0800
Received: from vger.rutgers.edu ([128.6.190.2]) by nic.funet.fi with ESMTP id <75030-4909>; Fri, 6 Dec 1996 12:01:13 +0200
Received: by vger.rutgers.edu id <213698-252>; Fri, 6 Dec 1996 04:59:46 -0500
From: Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
Date: 	Fri, 6 Dec 96 10:59:22 +0100
Message-Id: <9612060959.AA11485@issan.informatik.uni-dortmund.de>
To: Fritz Heinrichmeyer <jfh@jfh00.fernuni-hagen.de>
Cc: hjl@innovix.com, linux-gcc@vger.rutgers.edu
In-Reply-To: Fritz Heinrichmeyer's message of 	Thu, 5 Dec 1996 11:16:53 +0100
Subject: Re: libc.5.4.15-16 lead to coredump for emacs
X-Yow: Hmmm..  A hash-singer and a cross-eyed guy were SLEEPING on a deserted 
 island, when...
References: <199612051016.LAA01495@jfh00.fernuni-hagen.de>
Sender: owner-linux-gcc@vger.rutgers.edu
Precedence: bulk
Lines: 37
Xref: altair.xemacs.org linux-gcc:2116


Fritz Heinrichmeyer <jfh@jfh00.fernuni-hagen.de> writes:

|> This is what happened with linux-2.1.14 and the mentioned libc's
|> (everything else works, with the new kernels there is also alwas an
|> excepion raised on startup, it was the emacs from readhat btw.)

|> Reading symbols from /usr/X11R6/lib/libX11.so.6...
|> (no debugging symbols found)...done.
|> Reading symbols from /usr/lib/libncurses.so.3.0...
|> (no debugging symbols found)...done.
|> Reading symbols from /lib/libm.so.5.0.6...done.
|> Reading symbols from /lib/libc.so.5.4.16...done.
|> Reading symbols from /lib/ld-linux.so.1...done.
|> ---Type <return> to continue, or q <return> to quit---
|> #0  0x4021e489 in __libc_kill ()
|> (gdb) where
|> #0  0x4021e489 in __libc_kill ()
|> #1  0x807953b in XMapRaised ()
|> #2  0xbffff464 in ?? ()
|> #3  0x402317cd in getwd (buf=3D0x40005fd8 "@=DB\004\bPB\034@h=F0#@l\237\0=
                     ^^^^^
|> 16\b")
|> #4  0x8079de4 in XMapRaised ()
|> #5  0x804db9b in XMapRaised ()
|> (gdb)     =20


getwd() is the culprit.  Since PATH_MAX has changed (from 1024 to 4095) a
getwd compiled against linux 2.1 will now write beyond array bounds if the
program is compiled against linux 2.0 or earlier.  The only correct fix
is: NEVER USE getwd(), it is as evil as gets()!  Emacs should be changed.

-- 
Andreas Schwab                                      "And now for something
schwab@issan.informatik.uni-dortmund.de              completely different"


--Multipart_Fri_Dec__6_10:45:16_1996-1--

