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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T08:49:51+00:00 2026-06-08T08:49:51+00:00

In order to replicate a crash I was having in my application, I had

  • 0

In order to replicate a crash I was having in my application, I had to create a sample with a slightly exaggerated repeat rate that might not be practical, but one that demonstrates exactly what was happening in my app. When drawing an NSString on a background thread using NSOperations, there is sometimes a crash with the last call on the stack trace before the crash being WebCore::FontFallbackList::~FontFallBackList().

- (void)viewDidLoad
{
    queue = [[NSOperationQueue alloc] init];
    [NSTimer scheduledTimerWithTimeInterval:0.0001 target:self selector:@selector(timerDidFire:) userInfo:nil repeats:YES];
}

-(void)timerDidFire:(NSTimer*)timer
{
    NSBlockOperation *op = [NSBlockOperation blockOperationWithBlock:^{
        CGRect rect = CGRectMake(0, 0, 50, 50);
        UIGraphicsBeginImageContextWithOptions(CGSizeMake(rect.size.width, rect.size.height), YES, 0.0);
        NSString *string = @"Sd";
        [string drawInRect:rect withFont:[UIFont boldSystemFontOfSize:12] lineBreakMode:UILineBreakModeTailTruncation]; 
        UIGraphicsEndImageContext();     
    }];
    [queue addOperation:op];
}

You can easily replicate this crash with the code above. Anyone have any insight as to the nature of this crash, and why it might be happening?
(the solution to this problem is setting [queue setMaxConcurrentOperations:1];)

  • 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-06-08T08:49:53+00:00Added an answer on June 8, 2026 at 8:49 am

    This appears to be a regression in iOS 5.x: It happens on the 5.0 and 5.1 simulators and on a 5.1 device, but not on the 4.3 simulator or a 4.3.2 device.

    It’s also specifically the string drawing that seems to be broken — if all you do is string-drawing (avoiding the overhead of creating/destroying contexts), the crash happens nearly instantly:

    -(void)threadFunc:(UIFont *)font {
      @autoreleasepool {
        NSString *string = @" ";
        CGRect r = {{0,0},{50,50}};
        UIGraphicsBeginImageContextWithOptions(r.size, YES, 0);
        for(;;) {
          @autoreleasepool {
            [string drawAtPoint:r.origin withFont:font];
          }
        }
        UIGraphicsEndImageContext();
      }
    }
    
    -(void)startThreads
    {
      UIFont * font = [UIFont systemFontOfSize:12];
      for (int i = 2; i--;)
      {
        [NSThread detachNewThreadSelector:@selector(threadFunc:) toTarget:self withObject:font];
      }
    }
    

    EDIT: It is “nearly instant” only in multi-core environments (i.e. a dual-core device or the simulator, assuming a multi-core Mac). Otherwise, it takes on the order of 10-20 minutes to crash. I don’t have a dual-core iOS 4.x device (the only possibility appears to be the iPad 2), but the single-core devices haven’t crashed after over an hour.

    I’ve raised a bug with Apple, and encourage you to do the same if it affects you.

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

Sidebar

Related Questions

I'm having strange behaviour, that can not replicate on local machine and it is
I have a new Winforms application that is replacing an existing Access order processing
Order by descending is not working on LINQ to Entity In the following Query
Can CouchDB's filtered replication be set to replicate not only the most recent version
I need to replicate a T-SQL statement that has an inner select, using LINQ:
We are trying to emulate a POS keyboard in order to integrate an application
I'm working on an AJAX application that pulls data from a live website, I
I have some SQL that does an order by case statement. It works fine.
I have a application that stores passwords in a ms sql database, I wish
I have a suite of database unit tests that were created. In order to

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.