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 6202469
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T04:44:26+00:00 2026-05-24T04:44:26+00:00

I’d like to use blocks, but it causes me a EXC_BAD_ACCESS after a few

  • 0

I’d like to use blocks, but it causes me a EXC_BAD_ACCESS after a few calls.

My code:

- (void) sendBasket {
    if (currentSendToBasketBlock != nil) {
    // there's already a webservice going... set the new one as waiting
    waitingSendToBasketBlock = ^ {
        WebServicesModel *webServicesModel = [[[WebServicesModel alloc] init] autorelease];
        webServicesModel.delegate = self;
        [webServicesModel sendBasketToServer:currentBasket];

        [self showBasketBackground];

    };
    [waitingSendToBasketBlock copy];
} else {
    currentSendToBasketBlock = ^ {
        WebServicesModel *webServicesModel = [[[WebServicesModel alloc] init] autorelease];
        webServicesModel.delegate = self;
        [webServicesModel sendBasketToServer:currentBasket];

        [self showBasketBackground];
    };

    [currentSendToBasketBlock copy];

    currentSendToBasketBlock();
}
}

When the webservice is finished, it calls a specific method on the same object:

- (void) specificMethod {
    if (waitingSendToBasketBlock != nil) {
        waitingSendToBasketBlock(); // here, the EXC_BAD_ACCESS happens
        waitingSendToBasketBlock = nil;
    }
}

What am I missing? Instruments doesn’t find a Zombie…

Thanks!

Edit: Crash Log

Thread 0 name:  Dispatch queue: com.apple.libdispatch-manager
Thread 0:
0   libsystem_kernel.dylib          0x35590fbc kevent + 24
1   libdispatch.dylib               0x3525bed4 _dispatch_mgr_invoke + 744
2   libdispatch.dylib               0x3525cf3a _dispatch_queue_invoke + 70
3   libdispatch.dylib               0x3525c4ec _dispatch_worker_thread2 + 228
4   libsystem_c.dylib               0x3566758a _pthread_wqthread + 258
5   libsystem_c.dylib               0x35667bbc start_wqthread + 0

Thread 1 name:  WebThread
Thread 1:
0   libsystem_kernel.dylib          0x3558dc00 mach_msg_trap + 20
1   libsystem_kernel.dylib          0x3558d758 mach_msg + 44
2   CoreFoundation                  0x309582b8 __CFRunLoopServiceMachPort + 88
3   CoreFoundation                  0x3095a562 __CFRunLoopRun + 350
4   CoreFoundation                  0x308eaebc CFRunLoopRunSpecific + 224
5   CoreFoundation                  0x308eadc4 CFRunLoopRunInMode + 52
6   WebCore                         0x35f5327e _ZL12RunWebThreadPv + 382
7   libsystem_c.dylib               0x3566630a _pthread_start + 242
8   libsystem_c.dylib               0x35667bb4 thread_start + 0

Thread 2:
0   libsystem_kernel.dylib          0x35591cb0 stat + 12
1   CFNetwork                       0x34cccf56 DiskCookieStorage::syncStorageLocked() + 422
2   CFNetwork                       0x34c3fa60 PrivateHTTPCookieStorage::syncStorage() + 20
3   CFNetwork                       0x34ccaa7e HTTPCookieStorage::syncStorage() + 6
4   CFNetwork                       0x34ccaa9c HTTPCookieStorage::_syncTimerFired(__CFRunLoopTimer*, void*) + 12
5   CoreFoundation                  0x30957a40 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 8
6   CoreFoundation                  0x30959ec4 __CFRunLoopDoTimer + 844
7   CoreFoundation                  0x3095a83e __CFRunLoopRun + 1082
8   CoreFoundation                  0x308eaebc CFRunLoopRunSpecific + 224
9   CoreFoundation                  0x308eadc4 CFRunLoopRunInMode + 52
10  Foundation                      0x341dd7f6 +[NSURLConnection(NSURLConnectionReallyInternal) _resourceLoadLoop:] + 206
11  Foundation                      0x341d0382 -[NSThread main] + 38
12  Foundation                      0x342425c6 __NSThread__main__ + 966
13  libsystem_c.dylib               0x3566630a _pthread_start + 242
14  libsystem_c.dylib               0x35667bb4 thread_start + 0

Thread 3 name:  com.apple.CFSocket.private
Thread 3:
0   libsystem_kernel.dylib          0x3558fc60 __select + 20
1   CoreFoundation                  0x3095d8f2 __CFSocketManager + 582
2   libsystem_c.dylib               0x3566630a _pthread_start + 242
3   libsystem_c.dylib               0x35667bb4 thread_start + 0

Thread 4:
0   libsystem_kernel.dylib          0x3558dc00 mach_msg_trap + 20
1   libsystem_kernel.dylib          0x3558d758 mach_msg + 44
2   CoreFoundation                  0x309582b8 __CFRunLoopServiceMachPort + 88
3   CoreFoundation                  0x3095a562 __CFRunLoopRun + 350
4   CoreFoundation                  0x308eaebc CFRunLoopRunSpecific + 224
5   CoreFoundation                  0x3092d6d2 CFRunLoopRun + 42
6   MyProject                       0x0011c41a +[ASIHTTPRequest runRequests] (ASIHTTPRequest.m:4773)
7   Foundation                      0x341d0382 -[NSThread main] + 38
8   Foundation                      0x342425c6 __NSThread__main__ + 966
9   libsystem_c.dylib               0x3566630a _pthread_start + 242
10  libsystem_c.dylib               0x35667bb4 thread_start + 0

Thread 5:
0   libsystem_kernel.dylib          0x355903ec __workq_kernreturn + 8
1   libsystem_c.dylib               0x356676d8 _pthread_wqthread + 592
2   libsystem_c.dylib               0x35667bbc start_wqthread + 0

Thread 6:
0   libsystem_kernel.dylib          0x355903ec __workq_kernreturn + 8
1   libsystem_c.dylib               0x356676d8 _pthread_wqthread + 592
2   libsystem_c.dylib               0x35667bbc start_wqthread + 0

Thread 7:
0   libsystem_kernel.dylib          0x355903ec __workq_kernreturn + 8
1   libsystem_c.dylib               0x356676d8 _pthread_wqthread + 592
2   libsystem_c.dylib               0x35667bbc start_wqthread + 0
  • 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-24T04:44:26+00:00Added an answer on May 24, 2026 at 4:44 am

    You are not doing anything with your copy, therefore you are still attempting to access the block that was stored on the stack. Try this in the place of your call to copy.

    waitingSendToBasketBlock = Block_copy(waitingSendToBasketBlock);
    //and
    currentSendToBasketBlock = Block_copy(currentSendToBasketBlock);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

For some reason, after submitting a string like this Jack’s Spindle from a text
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
I would like to count the length of a string with PHP. The string
I want to count how many characters a certain string has in PHP, but
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am trying to understand how to use SyndicationItem to display feed which is
I've got a string that has curly quotes in it. I'd like to replace
I would like to run a str_replace or preg_replace which looks for certain words
I am trying to render a haml file in a javascript response like so:

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.