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 05-Feb-2003, Geoffrey Keating <gkeating@apple.com> wrote:
> 
> This patch does two thing: 
> 
> 1. It establishes a system for host-specific callbacks.  The system is
>    way too elaborate for the trivial purpose in the patch, but I plan
>    do extend it later to add host-specific ways to detect that we
>    don't need to do a GC collection right now, and to perform
>    incremental GC.
> 2. It fixes an annoying UI issue with GCC on Darwin.  Darwin has the
>    default soft stack limit set to 512k, which can be easily tripped
>    over; in fact, some tests in the GCC testsuite hit it.  Before,
>    when this happened GCC would print 'Internal error: bus error',
>    which is an incredibly unhelpful error message; now it prints
>    'Out of stack memory.' and a message saying how to change the
>    limit.

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?

> Index: config/rs6000/host-darwin.c
...
> +/* On Darwin/powerpc, a stack fault can be detected as a SIGSEGV that
> +   faulted on an instruction that's either
> +   or
> +   stwux %r1,xxx,%r1
> +*/

There seems to be something missing in that comment: either *what* or stwux...?
Shouldn't the comment here match the code below?

> +  if ((faulting_insn & 0xFFFF8000) == 0x94218000  /* stwu %r1, -xxx(%r1) */
> +      || (faulting_insn & 0xFFFF03FF) == 0x7C21016E /* stwux %r1, xxx, %r1 */
> +      || (faulting_insn & 0xFC1F8000) == 0x90018000 /* stw xxx, -yyy(%r1) */
> +      || (faulting_insn & 0xFC1F8000) == 0xD8018000 /* stfd xxx, -yyy(%r1) */
> +      || (faulting_insn & 0xFC1F8000) == 0xBC018000 /* stmw xxx, -yyy(%r1) */)

-- 
Fergus Henderson <fjh@cs.mu.oz.au>  |  "I have always known that the pursuit
The University of Melbourne         |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.


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