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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T12:11:30+00:00 2026-05-12T12:11:30+00:00

This is pretty much the same problem i have, except with very different code:

  • 0

This is pretty much the same problem i have, except with very different code: http://www.cocoabuilder.com/archive/message/cocoa/2009/3/24/233015

I want to offload some processing to an NSOperation, passing a filename as a reference that the NSOperation loads and parses. The app crashes with EXEC_BAD_ACCESS when entering -(void)init.

Here’s how i’m launching the operations:

int n = [files count];
for (int i = 0; i < n; i++) {
    NSString *filename = [files objectAtIndex:i];
    FilterParseOperation *parser = [[FilterParseOperation alloc] initWithContentsOfFile:filename];
    [filterParseQueue addOperation:parser];
    [parser release], parser = nil;
}

After stripping out everything i have in my NSOperation i still end up with a crash. The following code crashes:

#import "FilterParseOperation.h"

@implementation FilterParseOperation

- (id)initWithContentsOfFile:(NSString *)aFilename {
    filename = aFilename;
    return self;
}

- (void)dealloc {
    [filename release], filename = nil;
    [super dealloc];
}

- (void)main {
    // do nothing!
}

@end

Here’s the assembler output for the crash (i’m not ninja enough to understand what it says). This happens straight after addOperation in __opLock

0x305ce610  <+0000>  push   ebp
0x305ce611  <+0001>  mov    ebp,esp
0x305ce613  <+0003>  push   ebx
0x305ce614  <+0004>  sub    esp,0x14
0x305ce617  <+0007>  call   0x305ce61c <__opLock+12>
0x305ce61c  <+0012>  pop    ebx
0x305ce61d  <+0013>  mov    eax,DWORD PTR [eax+0x4]
0x305ce620  <+0016>  mov    edx,DWORD PTR [eax+0x14] <- Crash happens here
0x305ce623  <+0019>  mov    eax,DWORD PTR [ebx+0xbfe94]
0x305ce629  <+0025>  mov    DWORD PTR [esp+0x4],eax
0x305ce62d  <+0029>  mov    DWORD PTR [esp],edx
0x305ce630  <+0032>  call   0x306af856 <dyld_stub_objc_msgSend>
0x305ce635  <+0037>  add    esp,0x14
0x305ce638  <+0040>  pop    ebx
0x305ce639  <+0041>  leave  
0x305ce63a  <+0042>  ret    
0x305ce63b  <+0043>  nop    DWORD PTR [eax+eax+0x0]

Any ideas? 🙂

  • 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-12T12:11:30+00:00Added an answer on May 12, 2026 at 12:11 pm

    You should be calling [super init]; in -initWithContentsOfFile:. NSOperation likely does some setup there that is required for it to work.

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

Sidebar

Ask A Question

Stats

  • Questions 183k
  • Answers 183k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer No, I don't think regex is the right tool here.… May 12, 2026 at 4:41 pm
  • Editorial Team
    Editorial Team added an answer Instead of CGFLOAT_MAX for the max height of your text… May 12, 2026 at 4:41 pm
  • Editorial Team
    Editorial Team added an answer what about inline pop-ups? You can write your own code… May 12, 2026 at 4:41 pm

Related Questions

I export my settings in Visual Studio and if I ever move to a
I've recently come across this rant . I don't quite understand a few of
I am looking for an alternative to the visitor pattern. Let me just focus
In my cocoa app I am displaying a NSPanel as a modal 'window' of

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.