• 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: Crash. Why?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Crash. Why?


  • Subject: Re: Crash. Why?
  • From: Lorenzo <email@hidden>
  • Date: Thu, 11 Dec 2003 08:49:17 +0100

Hi,
I deleted the first panel with all its objects (Cancel, OK and a
NSTextField) and I recreated it.
Then I deleted all the files and folders within the "build " folder, I
cleaned with Xcode and I recompile and run again.
The problem is still there. If I open the Window1 then the Window2 I get a
crash, if I open only the Window2 I don't get a crash.
Amazing, in one day long I didn't discover the bug yet. I can't believe.

And, this is crazy too, I created a new application, just with 3 windows,
and I call the 2 windows from the first one simulating my real application.
I don't get any crash... The strange thing is that I copied the source code
from my real application.

What could be?

Best Regards
--
Lorenzo
email: email@hidden

> From: Andrew Abernathy <email@hidden>
> Date: Wed, 10 Dec 2003 15:35:56 -0800
> To: Lorenzo <email@hidden>
> Subject: Re: Crash. Why?
>
> Ah. I don't know of any reason that Xcode would cause the problem (per
> se), but have you made sure that everything has been built clean? (I
> would manually delete all the object files rather than trusting a Build
> Clean, were I hitting any unexplained problems.) I can easily imagine
> some out-of-date symbols causing such a problem. I certainly don't know
> how to revert Xcode builds. (I have all my data on a separate partition
> - whenever I need to install a seed or revert, then I just do a clean
> install over my OS partition, and restore my account and a few
> symlinks. A more efficient way would be to archive off the OS partition
> before installing a seed, probably by using Disk Utility, then I could
> revert to that archive, but I never seem to actually do that.)
>
> -andrew
>
>
> On Wednesday, December 10, 2003, at 03:17 PM, Lorenzo wrote:
>
>> Hi, thank you for your detailed reply.
>> I have to say that for about one year I never had this problem with
>> this
>> software. It came right now with the last version I compiled with
>> XcodeUpdate_7K112. Also, I didn't touch that part of code. I suspect
>> that
>> the origin of the trouble is the new Xcode seed version
>> XcodeUpdate_7K112.
>> Do you this could be a cause?
>> I cannot write this to the Cocoa List because XcodeUpdate_7K112 is
>> under
>> NDA. But what do you think?
>> And if really the problem comes from there, how can I deinstall it and
>> use
>> the latest official Xcode?
>>
>> Thank you.
>>
>> Best Regards
>> --
>> Lorenzo
>> email: email@hidden
>>
>>> From: Andrew Abernathy <email@hidden>
>>> Date: Wed, 10 Dec 2003 13:48:48 -0800
>>> To: Lorenzo <email@hidden>
>>> Subject: Re: Crash. Why?
>>>
>>> Offhand, this sounds like it may be something getting released/freed
>>> but then the pointer is not set to nil and is used again. I'd suggest
>>> using zombies to see if that gives you some info - turn on
>>> NSZombieEnabled, and if you message a freed object you'll get an error
>>> message that you can break on (I forget the method to break on, but it
>>> will in fact tell you when you hit it, then you can set the breakpoint
>>> and restart). If that does show something messaged after it's been
>>> released, you can look at the released object to see what it was,
>>> which
>>> is often illuminating as to why perhaps it's getting released too
>>> often/early.
>>>
>>> The backtrace appears to be in menu code - perhaps it's trying to do
>>> menu validation on an object that has been released. (Maybe you have a
>>> target/action link in the nib from a menu to an object, and that
>>> object
>>> is getting released?) The exact symptoms you describe sound a bit like
>>> the text field has a delegate (or observer of some type) that has been
>>> released but the delegate outlet still points to the address, or maybe
>>> even (though much less likely) the first responder has been released
>>> or
>>> otherwise corrupted.
>>>
>>> You might also want to end editing _before_ stopModal (presumably any
>>> validation should occur before you allow the modal loop to end). And
>>> something else that could be informative is checking to see if you can
>>> do the modal loop on question1Window multiple times in a row without
>>> problem.
>>>
>>> Good luck.
>>>
>>> -andrew
>>>
>>>
>>> On Wednesday, December 10, 2003, at 08:29 AM, Lorenzo wrote:
>>>
>>>> I cannot found the origin of a bug. And I am getting crazy.
>>>> Can you help me please?
>>>>
>>>> The user click on the "button 1" and I call
>>>> --------------
>>>> [NSApp runModalForWindow:question1Window];
>>>> --------------
>>>> the user edits a simple NSTextField, presses OK, I get the string
>>>> from the NSTextField, then I send [NSApp stopModal]; then
>>>> --------------
>>>> [question1Window endEditingFor:nil];
>>>> [question1Window close];
>>>> --------------
>>>> everything works well.
>>>> Then the user click on a "button 2" and I call
>>>> --------------
>>>> [NSApp runModalForWindow:question2Window];
>>>> --------------
>>>> and on this window, after the user types 2 or 3 characters within a
>>>> second
>>>> NSTextField, my application crashes. The problem is that this happens
>>>> ONLY
>>>> if I earlier called the modal window question1Window, as described
>>>> here
>>>> above. If I don't call the first modal question1Window, my
>>>> application
>>>> never
>>>> crashes. So, which relationship between the two windows?
>>>> Even more strange, I call the first window, then I call the second
>>>> window
>>>> with the keyboard (not clicking on the button 2) and when I type in
>>>> the
>>>> second NSTextField I don't get the crash. I cannot understand why.
>>>> Amazing!
>>>> I include here the debug report. Please help...
>>>>
>>>>
>>>> #0 0x927d11c4 in HIObject::GetHIObjectFromRef(void*)
>>>> #1 0x927d1ba8 in _MenuElementGetDataAtIndex
>>>> #2 0x927dc088 in GetMenuItemSystemAttributes(MenuData*, unsigned
>>>> short,
>>>> unsigned long, unsigned long*)
>>>> #3 0x927e61c0 in _GetMenuItemAttributes(MenuData*, unsigned short,
>>>> unsigned long*)
>>>> #4 0x9284b774 in SearchCacheEntries(OpaqueCollection*, unsigned
>>>> long,
>>>> unsigned long, CheckMenuData*, MenuResult*, MenuData**, unsigned
>>>> long*)
>>>> #5 0x92811e0c in SearchCache(OpaqueCollection*, bool,
>>>> CheckMenuData*,
>>>> MenuResult*)
>>>> #6 0x92849f04 in CheckMenuKeyCache(MenuData*, CheckMenuData*)
>>>> #7 0x9280c730 in CheckMenusForKeyEvent(MenuData*, CheckMenuData*)
>>>> #8 0x928188ac in _IsMenuKeyEvent(MenuData*, OpaqueEventRef*,
>>>> unsigned
>>>> long, MenuData**, unsigned short*)
>>>> #9 0x92828ac8 in IsMenuKeyEvent
>>>> #10 0x92e71c38 in _NSGetMenuItemForCommandKeyEvent
>>>> #11 0x92e2ee2c in _NSHandleCarbonMenuEvent
>>>> #12 0x92dd2dd0 in _DPSNextEvent
>>>> #13 0x92de93fc in -[NSApplication
>>>> nextEventMatchingMask:untilDate:inMode:dequeue:]
>>>> #14 0x92eb070c in -[NSApplication _realDoModalLoop:peek:]
>>>> #15 0x92f5b3c4 in -[NSApplication runModalForWindow:]
>>>> #16 0x0003ad4c in -[LorenzoApp openQuestion2Window:]
>>>> <<<<<<<<<<<<<<<<
>>>> #17 0x92e779d0 in -[NSApplication sendAction:to:from:]
>>>> #18 0x92e7e754 in -[NSControl sendAction:to:]
>>>> #19 0x92f292fc in -[NSTableView _sendAction:to:row:column:]
>>>> #20 0x92e7e318 in -[NSTableView mouseDown:]
>>>> #21 0x92e02c78 in -[NSWindow sendEvent:]
>>>> #22 0x92df534c in -[NSApplication sendEvent:]
>>>> #23 0x92dfd754 in -[NSApplication run]
>>>> #24 0x92eb9a1c in NSApplicationMain
>>>> #25 0x0000ac04 in main
>>>> #26 0x0000a808 in _start at crt.c:267
>>>> #27 0x0000a67c in start
>>>>
>>>>
>>>> Best Regards
>>>> --
>>>> Lorenzo
>>>> email: email@hidden
>>>> _______________________________________________
>>>> cocoa-dev mailing list | email@hidden
>>>> Help/Unsubscribe/Archives:
>>>> http://www.lists.apple.com/mailman/listinfo/cocoa-dev
>>>> Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Prev by Date: Re: Problem with NSOutlineView::shouldSelectItem: and NSRunCriticalAlertPanel
  • Next by Date: Re: Polling Callback, Threads [Attn: Michael Thornburgh]
  • Previous by thread: Re: Crash. Why?
  • Next by thread: Re: Crash. Why?
  • Index(es):
    • Date
    • Thread