Re: Crash drawing image
Re: Crash drawing image
- Subject: Re: Crash drawing image
- From: Ken Ferry <email@hidden>
- Date: Sat, 24 Oct 2009 15:18:51 -0700
If you have extracted this to a test project, does that mean you now
have a reproducing case whose source you can share? If so, why don't
you put it up somewhere.
You could also try doing a Build and Analyze in Xcode. It is possible
to make memory management mistakes in gc, and the analyzer will catch
a large class of them.
On Saturday, October 24, 2009, email@hidden
<email@hidden> wrote:
> Weird... It seems that sourceImage (the generic one only) is being
> garbage collected in the middle of the drawing. If I disable GC just
> before doing the drawing, and enable it again afterwards, the process
> stops crashing.
>
> I verified this by making a new project, where I placed the
> screensaver view in a normal window. With GC disabled, there were no
> crashes. As soon as I enabled GC, it started crashing. Backtrace says:
>
> #0 0x91c008c5 in ripc_RemoveEntry ()
> #1 0x91bdd7b0 in ripc_AcquireImage ()
> #2 0x91bdb3be in ripc_DrawImage ()
> #3 0x937eab60 in CGContextDrawImage ()
> #4 0x92c4d3c7 in __-[NSImageRep
> drawInRect:fromRect:operation:fraction:respectFlipped:hints:]_block_invoke_1
> ()
> #5 0x92c4ca4d in -[NSImageRep
> drawInRect:fromRect:operation:fraction:respectFlipped:hints:] ()
> #6 0x92c4b586 in __-[NSImage
> drawInRect:fromRect:operation:fraction:respectFlipped:hints:]_block_invoke_1
> ()
> #7 0x92c48e1b in -[NSImage
> _usingBestRepresentationForRect:context:hints:body:] ()
> #8 0x92c48950 in -[NSImage
> drawInRect:fromRect:operation:fraction:respectFlipped:hints:] ()
> #9 0x92d06d9b in -[NSImage drawInRect:fromRect:operation:fraction:] ()
> #10 0x92d335de in -[NSImage _composite:delta:fromRect:toPoint:] ()
> #11 0x92d32af5 in -[NSImage compositeToPoint:fromRect:operation:] ()
> #12 0x92d32a8d in -[NSImage compositeToPoint:operation:] ()
> #13 0x00002acd in +[NSImage(Reflection)
> appendReflectionToImage:fraction:] (self=0xa03195c0, _cmd=0x9324,
> sourceImage=0x1251440, fraction=0.5) at
> /Users/fabian/Lounge/Lounge/NSImage+Reflection.m:29
> #14 0x000047b0 in -[MainController updateTrackInfo:] (self=0x1026cc0,
> _cmd=0x908a, dict=0x123a260) at
> /Users/fabian/Lounge/Lounge/MainController.m:379
> #15 0x94b41b65 in __NSFireDelayedPerform ()
> #16 0x93fcbeee in __CFRunLoopRun ()
> #17 0x93fc9d34 in CFRunLoopRunSpecific ()
> #18 0x93fc9b61 in CFRunLoopRunInMode ()
> #19 0x94dbafec in RunCurrentEventLoopInMode ()
> #20 0x94dbada3 in ReceiveNextEventCommon ()
> #21 0x94dbac28 in BlockUntilNextEventMatchingListInMode ()
> #22 0x92c10b99 in _DPSNextEvent ()
> #23 0x92c1040e in -[NSApplication
> nextEventMatchingMask:untilDate:inMode:dequeue:] ()
> #24 0x92bd25fb in -[NSApplication run] ()
> #25 0x92bca695 in NSApplicationMain ()
> #26 0x00002108 in main (argc=0x1, argv=0xbffff7d4) at
> /Users/fabian/Lounge/Lounge/main.m:13
>
> On Sat, Oct 24, 2009 at 7:36 PM, email@hidden
> <email@hidden> wrote:
>> Thanks for your reply.
>>
>> On Sat, Oct 24, 2009 at 6:03 PM, Jens Alfke <email@hidden> wrote:
>>>
>>> It would be really good to get a backtrace. Are you launching the process
>>> with gdb, or at least attaching before the crash?
>>
>> Yes. I'm launching with gdb and pass the "debug" argument to Screen
>> Saver Engine. This way the screen saver is running on the desktop
>> window level.
>>
>>> And after the crash, gdb
>>> is confused and can't get info about the process?
>>
>> Sort of. I think the problem is no app can have keyboard focus as long
>> as the screensaver is running/frontmost. So Xcode is not responding to
>> keyboard events until I terminate the process.
>>
>>> If you run without gdb, do you get a regular "unexpectedly quit" alert with
>>> the option to send a crash report (which includes a backtrace)?
>>
>> No. The process just hangs and I have to force a reboot.
>>
>>> Have you tried running with malloc in scribbling/heap-checking mode, to see
>>> if anything funky's going on with the heap? ('man malloc' for details on the
>>> environment variables to set for this.)
>>
>> I'm not sure what to expect, but I did try just now to enable most of
>> these settings and they didn't return anything that looked helpful in
>> gdb.
>>
> _______________________________________________
>
> 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