• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Increasing your app's stack size
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Increasing your app's stack size


  • Subject: Re: Increasing your app's stack size
  • From: Mark Thomas <email@hidden>
  • Date: Wed, 19 Sep 2007 22:21:19 +0100

Hi Mike,
  I completely agree with your statement how-ever in this case I cannot do
much about this, as most of the stack is OS Frameworks, not my code :-(.

  But looking at this technote it should possible ? - but at the minute this
is a hunch, it there a way to tell from a crash log it's this issue.

Exception Type:  EXC_BAD_ACCESS (SIGBUS)
Exception Codes: KERN_PROTECTION_FAILURE at 0x0000000000000000
Crashed Thread:  0

Thread 0 Crashed:
0   com.apple.CoreFoundation          0x93235834 CFURLCopyAbsoluteURL + 80
..
...
175 com.bt.220v                       0x00007cb0 start + 56

Thanks
Mark.

> Hi,
>
> I don't know how you can increase stack size, but there are a couple
> ways to reduce stack usage:
>
> Look at all the functions that are in the stack at the time of the
> crash to see if any local variables are large.  Consider allocating
> them from the heap instead of the stack.
>
> If you don't want to do that, consider breaking up longer functions
> into several shorter ones, so that some of the new functions are
> called, use the stack but then immediately return.  This way the large
> variables don't have to be on the stack when the deep call chain is
> made.
>
> If you're using a recursive function, consider converting it to an
> iterative one that keeps its state in a stack structure that you
> allocate.  Sedgewick's Algorithms book, at least the first edition,
> gives an example of this.
>
> Mike
>
> On 9/19/07, Mark Thomas <email@hidden> wrote:
>> Hi All,
>>   Was wonder if somebody could help with this as I think I have some code
>> which is running out of stack space and is around 190 frames down and
>> crashes in CoreService framework API call, but using a different path with
>> using less stack frames seems to work. So has made me wonder if I'm running
>> out of stack stack here in 190 case.
>>
>>   So using info from
>>
>> http://developer.apple.com/qa/qa2005/qa1419.html
>>
>>   and then adding -stack_size 1000000, seems to cause a linker error of not
>> knowing "stack_size" has this changed ?
>>
>> Thanks
>> Mark.
>>
>>  _______________________________________________
>> Do not post admin requests to the list. They will be ignored.
>> Xcode-users mailing list      (email@hidden)
>> Help/Unsubscribe/Update your Subscription:
>>
>> This email sent to email@hidden
>>
>

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Increasing your app's stack size
      • From: Jack Repenning <email@hidden>
    • Re: Increasing your app's stack size
      • From: "Mark Wagner" <email@hidden>
References: 
 >Re: Increasing your app's stack size (From: "Michael Crawford" <email@hidden>)

  • Prev by Date: Re: guardmalloc with no frame pointers...
  • Next by Date: Re: Increasing your app's stack size
  • Previous by thread: Re: Increasing your app's stack size
  • Next by thread: Re: Increasing your app's stack size
  • Index(es):
    • Date
    • Thread