🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.epoch.misc
Article #113

Re: FIX for immediate Epoch-4.0p0 "memcpy(0) crash" when using GCC 2.1

#113
From: Simon Marshall
Date: Wed, 15 Apr 1992 12:53
37 lines
2257 bytes
	This sounds remarkably like the problem I had; I think you may have
    jumped on the wrong reason.

| * Config:       "s-bsd4-2.h", "m-sun3.h", and the extra "config.h" lines
| 
|         #define START_FILES crt0.o /lib/Mcrt1.o
|         #define LIB_GCC "/usr/gnu/lib/gcc-lib/sun3-sunos3/2.1/libgcc.a" -lc
|         #define LIBS_DEBUG
| 
|                 but should apply to any system/configuration where it
|                 is unsafe to reference nonexisting arguments of
|                 function calls.

| * Solution:     An investigation of message() reveals that it is
|                 declared with four arguments yet is not passed more
|                 than two in this case (!).  The following fix uses the
|                 GCC <stdarg.h> include file to retrieve the correct
|                 number of arguments when GCC is used.

	Aha!  I think maybe that -lc which you added is pulling in a
    definition for _doprnt(), which is what message() calls to do the actual
    printing.  Epoch intends it to be its own _doprnt(), but instead you
    link in the _doprnt() in libc.a and epoch uses this.  This version takes
    different args.  To check, see if _doprnt() is in libc.a.

	My solution was to take the code I needed from libc.a (there's not
    much, just a few files) and build my own libc.a to link in.  No hacking
    of epoch code needed.

	Maybe the real answer would be to use a unique name for the function
    supplied with epoch...?

	Simon. 
_______________________________________________________________________________
Simon Marshall, Dept. of Computer Science, University of Hull, Hull HU6 7RX, UK
  "Football isn't about life and death.  It's more important than that." Bill
Email: S.Marshall@Hull.ac.uk    Phone: +44 482 465181    Fax: 466666   Shankley
Technical Details
Message-ID: <9204151156.AA12335@a.cs.uiuc.edu>
Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!sequent.cc.HUll.ac.UK!S.Marshall

Show Full Headers
Complete Article Headers
Newsgroups: gnu.epoch.misc
Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!sequent.cc.HUll.ac.UK!S.Marshall
From: S.Marshall@sequent.cc.HUll.ac.UK (Simon Marshall)
Subject: Re: FIX for immediate Epoch-4.0p0 "memcpy(0) crash" when using GCC 2.1
Message-ID: <9204151156.AA12335@a.cs.uiuc.edu>
Sender: daemon@cis.ohio-state.edu
Organization: GNUs Not Usenet
Distribution: gnu
Date: Wed, 15 Apr 1992 12:53:25 GMT
Lines: 37