brettpoole / growl

Automatically exported from code.google.com/p/growl
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

NSRangeException in +[GrowlApplication Bridge _growlIsReachableUpdateCache:] #456

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?

One of my customers reports that my app displays this exception at launch.

What is the expected output?

Clean launch, with no exceptions.

What do you see instead?

Stack traces like this:

NSRangeException - *** -[__NSArrayI objectAtIndex:]: index 0 beyond bounds for 
empty array
Stack Trace: 1 NSExceptionHandlerExceptionRaiser (in ExceptionHandling) + 200
objc_exception_throw (in libobjc.A.dylib) + 155
-[__NSArrayI objectAtIndex:] (in CoreFoundation) + 235
+[GrowlApplicationBridge _growlIsReachableUpdateCache:] (in Growl) + 162
+[GrowlApplicationBridge _growlIsReady:] (in Growl) + 89
__-[NSDistributedNotificationCenter 
addObserver:selector:name:object:suspensionBehavior:]_block_invoke_1 (in 
Foundation) + 49
____CFXNotificationPostToken_block_invoke_1 (in CoreFoundation) + 352

What version of the product are you using? On what operating system?

EagleFiler 1.5.9, Growl SDK 1.3.1, Mac OS X 10.7.3.

Please provide any additional information below.

I'm guessing that the problem is with this line:

NSString *runningPath = [[[[NSRunningApplication 
runningApplicationsWithBundleIdentifier:GROWL_HELPERAPP_BUNDLE_IDENTIFIER] 
objectAtIndex:0] bundleURL] absoluteString];

I guess there is a mismatch between the process list from GetNextProcess (as 
called by Growl_HelperAppIsRunning) and NSRunningApplication.

Original issue reported on code.google.com by m...@c-command.com on 22 Feb 2012 at 7:21

GoogleCodeExporter commented 8 years ago
The user says he's using version 1.2 of Growl.

Original comment by m...@c-command.com on 22 Feb 2012 at 8:16

GoogleCodeExporter commented 8 years ago
So weird, Growl_HelperAppIsRunning doesn't use GetNextProcess in the 1.3+ SDK, 
it uses NSRunningApplication.  The only thing I can think of causing this would 
be if Growl died in the brief moment between using Growl_HelperAppIsRunning and 
this call.  GetNextProcess is only used by the weird/ugly legacy support 
registration system (Which, admittedly, he would be using with 1.2).  

Please have them try upgrading to Growl 1.2.2, as it has numerous bug fixes.

Regardless, we will see what we can do to protect against this in 1.4 SDK

Original comment by dan...@growl.info on 22 Feb 2012 at 9:02

GoogleCodeExporter commented 8 years ago
I just did an "hg clone https://code.google.com/p/growl/" today; that's where I 
saw the call to GetNextProcess. Is there some other place where I should be 
getting the latest source?

I'll suggest updating to 1.2.2.

Original comment by m...@c-command.com on 22 Feb 2012 at 9:11

GoogleCodeExporter commented 8 years ago
Make sure that you're using the correct 1.3.3 tag. Feel free to swing by #growl 
on freenode if you'd like to chat with us. :)

Original comment by ch...@growl.info on 22 Feb 2012 at 10:47

GoogleCodeExporter commented 8 years ago
The user says the exceptions occurred when he was using 1.2.2f1.

Original comment by m...@c-command.com on 23 Feb 2012 at 12:56

GoogleCodeExporter commented 8 years ago
Ask the user try try 1.2.2 and not the fork.

Original comment by ch...@growl.info on 23 Feb 2012 at 12:59

GoogleCodeExporter commented 8 years ago
range exception has been addressed in [7a51c42e78e9], regardless of whether or 
not Growl is running it shouldn't cause an exception because the code in 
question is in fact assuming that NSRunningApplication is going to return an 
array with at least 1 entry in it, and it may very well not.

Original comment by r...@growl.info on 23 Feb 2012 at 2:27