This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: 'stack overflow' message for Darwin; host hooks


On Friday, February 7, 2003, at 08:01  AM, Fergus Henderson wrote:

On 06-Feb-2003, Geoffrey Keating <geoffk@apple.com> wrote:
On Wednesday, February 5, 2003, at 11:32  PM, Fergus Henderson wrote:

On 05-Feb-2003, Geoffrey Keating <gkeating@apple.com> wrote:

Is there some important reason why you don't want this signal handler
to be the default handler for all applications on Darwin, not just for GCC?
Why not patch Darwin's libc rather than GCC?
That would be a decision for other applications.  Most applications,
don't use unbounded amounts of stack space the way that GCC can.
But the error message will only be printed if those applications do
run out of stack space.  If an application runs out of stack space,
why would it *ever* be better to issue the error message "Bus Error"
rather than "Stack Overflow"??
Right, but that's not this patch; that would require kernel changes to change the signal sent. If you look at where the 'bus error' message comes from, it's because the signal sent is (reported as) SIGBUS. To get a different message, you'd need to report some other signal. Then you get into issues about backwards binary compatibility...

Let me put this bluntly:

	The default treatment of stack overflow on Unix is ATROCIOUS.

	Issuing a reasonable error message is really not that difficult.
	Why not do it?

Is this just a case of keeping with the existing (atrocious behaviour
because that's the way it has always been done?

(It's worth pointing out that, as the comment says, this code will not
necessarily work for programs other than GCC.)
Sure, I saw the comment first time around, but the code could presumably
be fixed to handle AltiVec etc.

Even if the error message just says "This is _probably_ a stack overflow"
it would IMHO be a vast improvement on "Bus Error" in >99% of cases.
All this is interesting, but it's not really a GCC issue. Feel free to lobby the FreeBSD or Darwin folks for a SIGSTKOVERFLOW or whatever.

--
Geoff Keating <geoffk@apple.com>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]