Re: Need help debugging this

2011-07-18 Thread vincent habchi
Salut ! :)

 I'm having problems tracking down this bug:
 
 -[NSCFString string]: unrecognized selector sent to instance 0x7fff71192b70

Besides anything that was already mention, I may add that this kind of error is 
frequently caused by the object being freed and its memory reused by another 
object of a different kind. You may thus, in addition, use the Allocation 
instrument.

Vincent___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Need help debugging this

2011-07-18 Thread Andre Masse
Hi,

Still banging my head on this one. Here's what I've done:

1- Adding a breakpoint on objc_exception_throw: brings the debugger on 
NSApplicationMain...

2- I've enabled MallocStackLoggingNoCompact environment variable. After my app 
crashes, I've tried
   shell malloc_history 1480 0x7fff71192b70
and got:
no stack logs found for 0x7fff71192b70

with a list of Binary Images for a bunch of other addresses...

This is surprising since I always get the same error at the same address:

-[NSCFString string]: unrecognized selector sent to instance 0x7fff71192b70

Any other ideas?

Thanks to all for your help,

Andre Masse

PS: Salut Vincent :-)
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Need help debugging this

2011-07-18 Thread Vincent Habchi
Andre,

 Any other ideas?

Try to use the Zombies Instrument. If you're sending a message to a deallocated 
object (as this is certainly the case), it will pop up.

Bonne chance ! ;)
Vincent


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Need help debugging this

2011-07-18 Thread Roland King
err hmm - running out of ideas. That's a heck of an address by the way - you 
must be in 64 bit mode, I'm still not. 

I often put a try-catch block around the body of the code in main.m NSLog()ed 
the exception at that point and stuck in a breakpoint. I do that because I have 
had issues with unhandled KVOs (as in KVOs I'm adding and have misspelled etc.) 
which have caused apps to abort with no stack trace. You could try that to see 
if you get any better stack out of it. Not a high probability shot but at this 
point .. 

Have you tried breaking on NSApplicationMain and using the debugger to see 
what, if anything, is at that address when the program starts up you might be 
stomping on. 

Is it possible you have a corrupted NIB file, have you tried clean-building the 
thing? 

If you're using GDB can you put a watchpoint on that address (watch 
0x7fff...etc) that should break every time anything touches it, if you do that 
at the start of the program you might find something (watchpoints have upset 
XCode for me before now but I've often managed to keep going long enough to 
figure out what's going on). 

I'm now out of ideas .. bet it will be something really simple 

On 18-Jul-2011, at 8:48 PM, Andre Masse wrote:

 Hi,
 
 Still banging my head on this one. Here's what I've done:
 
 1- Adding a breakpoint on objc_exception_throw: brings the debugger on 
 NSApplicationMain...
 
 2- I've enabled MallocStackLoggingNoCompact environment variable. After my 
 app crashes, I've tried
   shell malloc_history 1480 0x7fff71192b70
   and got:
 no stack logs found for 0x7fff71192b70
 
 with a list of Binary Images for a bunch of other addresses...
 
 This is surprising since I always get the same error at the same address:
 
 -[NSCFString string]: unrecognized selector sent to instance 0x7fff71192b70
 
 Any other ideas?
 
 Thanks to all for your help,
 
 Andre Masse
 
 PS: Salut Vincent :-)
 ___
 
 Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
 
 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:
 http://lists.apple.com/mailman/options/cocoa-dev/rols%40rols.org
 
 This email sent to r...@rols.org

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Need help debugging this

2011-07-18 Thread Ken Thomases
On Jul 17, 2011, at 7:34 PM, Andre Masse wrote:

 -[NSCFString string]: unrecognized selector sent to instance 0x7fff71192b70
 
 Is there a way to know which instance is referred at that address? I tried 
 info symbol *0x7fff71192b70 in gdb and all i get is a blank line. The 
 address is consistent across runs and even after a machine reboot.

Since the address is always consistent, I suspect this is not a memory 
management bug.  I think you're incorrectly messaging a static object, like a 
string literal.

Things to try:

po 0x7fff71192b70

info sharedlibrary 0x7fff71192b70

info sym 0x7fff71192b70
(Note: no asterisk)

What is the exact stack trace when you break on the exception?  Are you sure 
you're looking at the thread which encountered the exception?  Check the other 
threads.  When does the exception occur (e.g. during application startup, while 
loading a NIB, when clicking a button, etc.)?

Regards,
Ken

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Need help debugging this

2011-07-18 Thread Kyle Sluder
On Mon, Jul 18, 2011 at 7:20 AM, Vincent Habchi vi...@macports.org wrote:
 Try to use the Zombies Instrument. If you're sending a message to a 
 deallocated object (as this is certainly the case), it will pop up.

Yes, this is the best idea. You can then follow the history of that
address and see what used to live there.

--Kyle Sluder
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Need help debugging this

2011-07-18 Thread Quincey Morris
On Jul 18, 2011, at 05:48, Andre Masse wrote:

 -[NSCFString string]: unrecognized selector sent to instance 0x7fff71192b70

I don't think anyone's pointed you in the direction of *reading* this error 
message. Note that it says -[NSCFString string], not +[NSCFString string]. 
Someone has sent a 'string' message to a NSString instance.

NSString instances don't respond to 'string' messages. NSString *classes* do. 
That leads me to suspect that you've written some code that accidentally sends 
the class message to an instance, and that your problem is nothing to do with 
memory management.

The important thing to find out is who is sending the message, not what it's 
being sent to.

 1- Adding a breakpoint on objc_exception_throw: brings the debugger on 
 NSApplicationMain...

Is this in Xcode 4? Make sure the level of detail slider at the bottom of the 
debugger view in the navigator pane is all the way to the right. If it's in its 
default middle position, it often collapses the call stack, misleading you to 
think the exception was in NSApplicationMain ().


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Need help debugging this

2011-07-18 Thread Scott Andrew
As was pointed out below the CString doesn't support instance method string:. 
Crashing this in a debugger should give you call stack so you can trace who is 
doing the calling. You should also have a crash log that can be symbolized. 

But, if this is your code run it in the debugger and have it crash. Use the 
call stack to see who is making this call. 

Scott

On Jul 18, 2011, at 11:13 AM, Quincey Morris wrote:

 On Jul 18, 2011, at 05:48, Andre Masse wrote:
 
 -[NSCFString string]: unrecognized selector sent to instance 0x7fff71192b70
 
 I don't think anyone's pointed you in the direction of *reading* this error 
 message. Note that it says -[NSCFString string], not +[NSCFString string]. 
 Someone has sent a 'string' message to a NSString instance.
 
 NSString instances don't respond to 'string' messages. NSString *classes* do. 
 That leads me to suspect that you've written some code that accidentally 
 sends the class message to an instance, and that your problem is nothing to 
 do with memory management.
 
 The important thing to find out is who is sending the message, not what it's 
 being sent to.
 
 1- Adding a breakpoint on objc_exception_throw: brings the debugger on 
 NSApplicationMain...
 
 Is this in Xcode 4? Make sure the level of detail slider at the bottom of 
 the debugger view in the navigator pane is all the way to the right. If it's 
 in its default middle position, it often collapses the call stack, misleading 
 you to think the exception was in NSApplicationMain ().
 
 
 ___
 
 Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
 
 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:
 http://lists.apple.com/mailman/options/cocoa-dev/scottandrew%40roadrunner.com
 
 This email sent to scottand...@roadrunner.com

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Need help debugging this

2011-07-18 Thread Andre Masse
Ah! Bullseye! 

On 18/07/2011, at 14:13 , Quincey Morris wrote:

 Is this in Xcode 4? Make sure the level of detail slider at the bottom of 
 the debugger view in the navigator pane is all the way to the right. If it's 
 in its default middle position, it often collapses the call stack, misleading 
 you to think the exception was in NSApplicationMain ().

Thanks a lot. Turned out the crash occurred in NSNumberFormatter. Removed it 
from the cell in the table view and the problem disappeared.

Thanks all for your help. I learned a lot while tracking down this bug.

Cheers,

Andre Masse
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Need help debugging this

2011-07-17 Thread Andre Masse
Hi,

I'm having problems tracking down this bug:

-[NSCFString string]: unrecognized selector sent to instance 0x7fff71192b70

Is there a way to know which instance is referred at that address? I tried 
info symbol *0x7fff71192b70 in gdb and all i get is a blank line. The address 
is consistent across runs and even after a machine reboot.

Any infos, pointer to doc etc. would be appreciated,

Thanks,

Andre Masse
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Need help debugging this

2011-07-17 Thread Kiel Gillard
Hi Andre,

To help you debug this problem, I suggest you set a breakpoint on the 
objc_exception_throw exception symbol. Using Xcode 4, this can be done by:

1) From the main menu bar choose View  Navigators  Breakpoint.
2) At the very bottom left of the project window, click the + button.
3) From the popup menu, choose Add Exception Breakpoint

Now that you have set your breakpoint on objc_exception_throw, build and run 
your debugging product and perform the steps to reproduce the problem. I would 
expect the debugger to break when the offending message is sent.

Kiel
PS: Instructions for Xcode 3 
http://blog.emmerinc.be/index.php/2009/03/19/break-on-exception-in-xcode/.

On 18/07/2011, at 10:34 AM, Andre Masse wrote:

 Hi,
 
 I'm having problems tracking down this bug:
 
 -[NSCFString string]: unrecognized selector sent to instance 0x7fff71192b70
 
 Is there a way to know which instance is referred at that address? I tried 
 info symbol *0x7fff71192b70 in gdb and all i get is a blank line. The 
 address is consistent across runs and even after a machine reboot.
 
 Any infos, pointer to doc etc. would be appreciated,
 
 Thanks,
 
 Andre Masse
 ___
 
 Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
 
 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:
 http://lists.apple.com/mailman/options/cocoa-dev/kiel.gillard%40gmail.com
 
 This email sent to kiel.gill...@gmail.com

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Need help debugging this

2011-07-17 Thread Kiel Gillard
Reference to documentation: 
http://developer.apple.com/library/mac/#recipes/xcode_help-breakpoint_navigator/articles/adding_an_exception_breakpoint.html%23//apple_ref/doc/uid/TP40010433-CH1-SW1

Kiel

On 18/07/2011, at 10:34 AM, Andre Masse wrote:

 Hi,
 
 I'm having problems tracking down this bug:
 
 -[NSCFString string]: unrecognized selector sent to instance 0x7fff71192b70
 
 Is there a way to know which instance is referred at that address? I tried 
 info symbol *0x7fff71192b70 in gdb and all i get is a blank line. The 
 address is consistent across runs and even after a machine reboot.
 
 Any infos, pointer to doc etc. would be appreciated,
 
 Thanks,
 
 Andre Masse
 ___
 
 Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
 
 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:
 http://lists.apple.com/mailman/options/cocoa-dev/kiel.gillard%40gmail.com
 
 This email sent to kiel.gill...@gmail.com

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com