🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gdb.bug
Article #345

Strange System V/386 problem

#345
From: John R. Levine
Date: Wed, 24 Jan 1990 02:21
24 lines
1621 bytes
I'm running gdb 3.4 under 386/ix 2.0.2, which is a derivative of AT&T's
Sys V/386 3.2.

On some machines, gdb crashes when it's starting up while calling the
vendor's termio tgetent() routine.  It always works when run under
itself (actually, under 3.2, it's not an infinitely recursive bug.)
After some poking around, it appears that depending on the environment
size, or whether you're running YP, or the phase of the moon or something,
the stack is not always long-aligned when main() is called, and tgetent()
takes strong offense at that.  On some machines this bug never appears, but
on those where it does, it occurs quite reliably.

If you put this:

	(void)alloca(1);

before the first executable statement in main(), alloca will, being a good
citizen, long-align the stack before it returns, after which everything
works just fine.  Note that you should use the assembler alloca() in -lPW
or the equivalent, not the clever portable malloc-based version.
-- 
John R. Levine, Segue Software, POB 349, Cambridge MA 02238, +1 617 864 9650
johnl@esegue.segue.boston.ma.us, {ima|lotus|spdcc}!esegue!johnl
"Now, we are all jelly doughnuts."
Technical Details
Message-ID: <1990Jan24.022138.12102@esegue.segue.boston.ma.us>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!samsung!think!snorkelwacker!spdcc!esegue!johnl

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!samsung!think!snorkelwacker!spdcc!esegue!johnl
From: johnl@esegue.segue.boston.ma.us (John R. Levine)
Newsgroups: gnu.gdb.bug
Subject: Strange System V/386 problem
Message-ID: <1990Jan24.022138.12102@esegue.segue.boston.ma.us>
Date: 24 Jan 90 02:21:38 GMT
Reply-To: johnl@esegue.segue.boston.ma.us (John R. Levine)
Distribution: gnu
Organization: Segue Software, Cambridge MA
Lines: 24