Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4074542
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T17:11:04+00:00 2026-05-20T17:11:04+00:00

My app crashes sometimes at this point: NSMutableData* position = [NSMutableData dataWithLength: 3 *

  • 0

My app crashes sometimes at this point:

NSMutableData* position = [NSMutableData dataWithLength: 3 * sizeof(CGPoint)];

when NSMutableData calls the autorelease.

Here’s the crash log:

Exception Type:  EXC_BREAKPOINT (SIGTRAP)
Exception Codes: 0x00000001, 0xe7ffdefe
Crashed Thread:  0

Thread 0 name:
Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0   CoreFoundation            0x343dea60 _CFAutoreleasePoolAddObject + 136
1   CoreFoundation                0x343de9cc -[NSObject(NSObject) autorelease] + 8
2   Foundation                0x30c49166 +[NSMutableData(NSMutableData) dataWithLength:] + 34

Do you have any idea why?

UPDATE:
The variable “position” is returned and used this way:

    NSMutableData *positionData = [[SFinder sharedFinder] move:self.crId] ;
CGPoint *path = [positionData mutableBytes];
CGPoint location0 = path[0];

CGPoint location1 = path[1];

CGPoint location = path[2];

UPDATE 2:

I removed the code with NSMutableData, but the app keeps crashing randomly. On the debug console there is a message:

*** attempt to pop an unknown autorelease pool (0x5830000)

stack:

Thread 0 Crashed:
   Dispatch queue: com.apple.main-thread
0   CoreFoundation               0x01348b69 _CFAutoreleasePoolPop + 201
1   UIKit                        0x008a947c _wrapRunLoopWithAutoreleasePoolHandler + 68
2   CoreFoundation               0x013edfbb __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 27
3   CoreFoundation               0x013830e7 __CFRunLoopDoObservers + 295
4   CoreFoundation               0x0134bbd7 __CFRunLoopRun + 1575
5   CoreFoundation               0x0134b240 CFRunLoopRunSpecific + 208
6   CoreFoundation               0x0134b161 CFRunLoopRunInMode + 97
7   GraphicsServices             0x029b3268 GSEventRunModal + 217
8   GraphicsServices             0x029b332d GSEventRun + 115
9   UIKit         0x008a942e UIApplicationMain + 1160
10  MyApp                        0x000029f4 main + 100 (main.m:13)
11  MyApp                        0x00002985 start + 53
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T17:11:04+00:00Added an answer on May 20, 2026 at 5:11 pm

    Found the problem. There is an issue with NSMutableData. It occures when you init it with initWithLength, or dataWithLength and try to insert data trough mutableBytes. When you insert the last byte it makes some allocation somewhere else (even if that part of the memory is owned by an other object) causing EXC_BAD_ACCESS and other memory related errors. So initiating it with length+1 bytes solved the problem.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

my iphone app crashes unexpectedly and looking at the crash log I can't tell
my app crashes with this code.. it doesnt even start up.. any ideas guys
my app crashes often in this for-loop: for (int a = 0; a <=
When my app crashes, I get a crash report that takes 5 minutes to
I have app that sometimes crashes in navigating through Navigation bar and in console
I'm developing an app on Mac OS X which is suspected to crash sometimes
OK, so this code below sometimes crashes on the line below //bug!! The error
Would appreciate some insight isolating this, some semi-repeatable crashes in an iPhone app of
My app crashes in dealloc , but only sometimes. I create one array for
My app some times crashes at start-up. In stack-trace only messages from built-in frameworks.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.