From: Craig Burley <burley@gnu.ai.mit.edu>
Subject: Re: (re)compiling gcc-2.7.2.1 under linux alpha: note && question
Date: Mon, 21 Oct 1996 14:09:00 -0400 [thread overview]
Message-ID: <199610211809.OAA03037@churchy.gnu.ai.mit.edu> (raw)
[Note that I'm on the axp-list, but not the linux-alpha list, at
the moment.]
>This is kind of a silly error to fall into, but I did-
>
>I was recompiling gcc-2.7.2.1 (with itself) and the rebuilt cc1 kept
>on core dumping on enquire.c.
>
>After scratching my head and trying a couple of things and (sadly)
>pestering Mr. R. Henderson, I finally realized that the problem
>was simply that 8MB stack ain't nearly enough (after all, it used
>to take 20+MB of stack to compiler mem_rop.c on a sparc, and that
>isn't nearly so memory consumptive as an alpha...).
>
>Because this was set as a hard limit, you have to be root to increase
>it, and now I'm happily moving along compiling away.
Whoa. Maybe this is what I ran into a couple of days ago.
Not only would the cc1 I was building core-dump doing _anything_ --
even being invoked with no arguments -- running gdb on it would core-
dump gdb! The closest I got to finding the problem was getting into
where init_lex() calls xmalloc(), and stepping into the call to
malloc() would core-dump. But, so would breaking on an _earlier_
xmalloc() call and running from there!
Here's what really threw me. I knew I had been happily building and
using new cc1's for months, and that I'd made only one change that
triggered building the new (buggy) cc1. That was adding more options
to the lang_options[] table in toplev.c (via g77's gcc/f/lang-options.h
file).
I don't understand, offhand, how increasing the size of a global table
(whose length seems not to be directly used by any code in toplev.c to
set the size of something allocated on the stack) could trigger a stack
overflow error.
But, I do know that when I commented out the new options, the rebuilt cc1
worked fine -- as did the cc1 I got when I commented them back in, but
commented out g77 options that were duplicates of gcc options anyway (and
thus didn't really need to be in g77's list). So, reducing the size of this
global table did indeed make the symptoms disappear. (Are these globals
allocated on the stack, a la systems like the Mac OS??)
I realize I don't, at this moment, know all of the issues, but I'd like
to _strongly_ suggest that if we're at the point of sometimes exceeding
the _default_ stack sizes everyone gets with Linux/AXP on something as
vanilla/smallish as cc1, we need to do one of two things ASAP:
- Find whatever bug or misdesign is resulting in too much stack being used
for cc1 (after all, g77's much larger f771 runs fine on my system). This
is unlikely to be cc1's fault per se, I mean maybe the compiler/assembler/
linker/loader used to build and run cc1 are doing something really wasteful.
- Increase the default stack size for Linux/AXP so hardly anybody ever needs
to change it.
Claiming that neither of the above need to be done because people can
simply change their stack size is, IMNSHO, ludicrous. Yes, they _can_,
but how are they going to know they're supposed to do it, when all they
see is a very obscure diagnostic that points to no documentation or
explanation, and even the _debugger_ doesn't work (or explain why it isn't
working)???
So, don't claim that...let's fix the problem, either by increasing the stack
(assuming it's too small) or fixing the toolchain problems resulting in the
stack being abused by things as ordinary as cc1.
Yes, I'm volunteering, if I can do anything to help out (investigate, etc.).
I'm running a really old Linux/AXP (part of why I didn't report the problem),
and have plenty of g77 work to do, but fixing this is very important IMO.
tq vm, (burley)
--
To unsubscribe: mail -s unsubscribe axp-list-request@redhat.com < /dev/null
next reply other threads:[~1996-10-21 18:09 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
1996-10-21 18:09 Craig Burley [this message]
1996-10-21 22:23 ` (re)compiling gcc-2.7.2.1 under linux alpha: note && question Andreas Johansson
-- strict thread matches above, loose matches on Subject: below --
1996-10-27 1:15 Matthew Jacob
1996-10-27 0:22 Matthew Jacob
1996-10-26 21:27 Craig Burley
1996-10-26 18:21 Matthew Jacob
1996-10-26 9:53 Craig Burley
1996-10-26 12:50 ` Richard Henderson
1996-10-22 2:21 Matthew Jacob
1996-10-21 23:47 David Mosberger
1996-10-22 12:55 ` Andreas Johansson
1996-10-21 16:02 Matthew Jacob
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox