• 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: [Disarmed] Re: NSNotificationQueue EXC_BAD_ACCESS problems
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [Disarmed] Re: NSNotificationQueue EXC_BAD_ACCESS problems


  • Subject: RE: [Disarmed] Re: NSNotificationQueue EXC_BAD_ACCESS problems
  • From: "Karan, Cem (Civ, ARL/CISD)" <email@hidden>
  • Date: Tue, 7 Oct 2008 11:07:33 -0400
  • Thread-topic: [Disarmed] Re: NSNotificationQueue EXC_BAD_ACCESS problems

That was it!  Thanks, I should have checked for that first.

Thanks,
Cem Karan

> -----Original Message-----
> From: Julien Jalon [mailto:email@hidden]
> Sent: Tuesday, October 07, 2008 10:39 AM
> To: Karan, Cem (Civ, ARL/CISD)
> Cc: email@hidden
> Subject: [Disarmed] Re: NSNotificationQueue EXC_BAD_ACCESS problems
>
> Try your code by enabling NSZombies (Add NSZombieEnabled=YES
> to the environment before launching your tool/app).
>
> This should show you what object is supposed to get messaged.
> I suspect some object observes your notification but is deallocated.
>
> --
> Julien
>
>
> On Tue, Oct 7, 2008 at 4:28 PM, Karan, Cem (Civ, ARL/CISD)
> <email@hidden> wrote:
>
>
> 	I'm having a great deal of trouble getting my
> notification queue to work correctly.  It always causes a
> EXC_BAD_ACCESS
> 	whenever I post using NSPostASAP or NSPostWhenIdle, but
> it works when I post using NSPostNow.  Here are the relevant
> lines of code:
>
> 	-(void) testMethod
> 	{
> 	   NSNotification *tempNotification = [NSNotification
> notificationWithName:@"DummyName" object:self userInfo:nil];
>
> 	   [[NSNotificationQueue defaultQueue]
> enqueueNotification:tempNotification postingStyle:NSPostNow
> 	       coalesceMask:(NSNotificationCoalescingOnName |
> NSNotificationCoalescingOnSender) forModes:nil];
> 	}
>
> 	If I change NSPostNow to NSPostASAP, then it
> immediately crashes.  In the last crash, the stack looked like this:
>
> 	#0      0x964e6688 in objc_msgSend
> 	#1      0x931731da in _nsnote_callback
> 	#2      0x90722aba in __CFXNotificationPost
> 	#3      0x90722d93 in _CFXNotificationPostNotification
> 	#4      0x931a071c in -[NSNotificationCenter postNotification:]
> 	#5      0x931d3121 in postQueueNotifications
> 	#6      0x9073f9c2 in __CFRunLoopDoObservers
> 	#7      0x90740d1c in CFRunLoopRunSpecific
> 	#8      0x90741cf8 in CFRunLoopRunInMode
> 	#9      0x94902480 in RunCurrentEventLoopInMode
> 	#10     0x949021d2 in ReceiveNextEventCommon
> 	#11     0x9490210d in BlockUntilNextEventMatchingListInMode
> 	#12     0x9580b3ed in _DPSNextEvent
> 	#13     0x9580aca0 in -[NSApplication
> nextEventMatchingMask:untilDate:inMode:dequeue:]
> 	#14     0x95803cdb in -[NSApplication run]
> 	#15     0x957d0f14 in NSApplicationMain
> 	#16     0x0000a7fe in main at main.mm:13
>
> 	The precise line I get the EXC_BAD_ACCESS is:
>
> 	0x964e6688  <+0024>  mov    0x20(íx),íi
>
> 	and this seems to happen at the end of the runloop.  I
> tried removing the coalesceMask arguments, but no luck.  Note
> that NSPostNow causes all the code to work completely
> correctly, its just the other two modes that it doesn't work.
>  Anyone have any clue what is going on?
>
> 	This is on a OS X 10.5.5 machine with MacFUSE 1.7
> installed.  The code is being compiled using Xcode
> MailScanner has detected a possible fraud attempt from
> "3.1.1" claiming to be 3.1.1. <http://3.1.1.>
>
> 	Thanks,
> 	Cem Karan
>
> 	_______________________________________________
>
> 	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
>
>
>
>
_______________________________________________

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

References: 
 >NSNotificationQueue EXC_BAD_ACCESS problems (From: "Karan, Cem (Civ, ARL/CISD)" <email@hidden>)
 >Re: NSNotificationQueue EXC_BAD_ACCESS problems (From: "Julien Jalon" <email@hidden>)

  • Prev by Date: Re: NSNotificationQueue EXC_BAD_ACCESS problems
  • Next by Date: defaultCenter's addObserver
  • Previous by thread: Re: NSNotificationQueue EXC_BAD_ACCESS problems
  • Next by thread: Re: Wasted Space and Kernighan
  • Index(es):
    • Date
    • Thread