• 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: Odd crash
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Odd crash


  • Subject: Re: Odd crash
  • From: Reza Farhad <email@hidden>
  • Date: Wed, 4 Mar 2009 15:36:37 +0000

Paul

I switched on Guard Malloc from the Run Menu in Xcode

It appears that I am getting the crash for a call that is trying to load an AppleScript.

NSDictionary *errors = [ NSDictionary dictionary ];
NSAppleScript *script = [[ NSAppleScript alloc ] initWithContentsOfURL:url error:&errors ];


I check the URL to make sure that it is valid.
Now if I dont use Guard Malloc the scripts load properly and I dont get any errors either.
So any ideas? Could I just by pass this in my exception handling?


Also is it a bad idea to leave MallocStackLogging, MallocStackLoggingNoCompact, MallocScribble in the release version.

Thanks
Reza

Does this make any sense to you. From that point the app goes into


On 3 Mar 2009, at 06:38, Paul Sanders wrote:

(Reza sent me the message below privately but I thought it might be useful
to copy the reply to the list. Excuse me if you have heard it all before).


So you would think this is happening in the Exception Handling code?

No, I don't think it's happening on the exception handler. I think that is
trapping it, rather than causing it. To help track the problem down, take a
look at this:


http://developer.apple.com/technotes/tn2004/tn2124.html

As a starting point, try running your program under GDB with Guard Malloc
enabled. This often traps memory allocation errors at source, although it
can slow things down a lot. If that is too slow, try setting
MallocScribble, MallocPreScribble, MallocGuardEdges and MallocStackLogging
in your environment as described in the article. You can set these
variables in XCode via Get Info - Arguements on your executable. Check out
also NSZombieEnabled, see http://www.cocoadev.com/index.pl?NSZombieEnabled .
When this is set in the environment, the runtime will trap any reference to
a freed object.


Hope this helps and thanks very much for sending me your code  - Paul.


_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Odd crash
      • From: "Sean McBride" <email@hidden>
References: 
 >Odd crash (From: Reza Farhad <email@hidden>)
 >Re: Odd crash (From: "Paul Sanders" <email@hidden>)
 >Re: Odd crash (From: Kyle Sluder <email@hidden>)
 >Re: Odd crash (From: "Paul Sanders" <email@hidden>)

  • Prev by Date: [Q] Responder Chain & makeFirstResponder
  • Next by Date: Re: Date parsing problem (when running on iphone only)
  • Previous by thread: Re: Odd crash
  • Next by thread: Re: Odd crash
  • Index(es):
    • Date
    • Thread