Re: Crash drawing image
I've uploaded a simple test case here: http://dl.getdropbox.com/u/550950/gc-crash.zip On Sat, Oct 24, 2009 at 11:18 PM, Ken Ferry kenfe...@gmail.com wrote: 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, slasktrattena...@gmail.com slasktrattena...@gmail.com 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 0x2acd in +[NSImage(Reflection) appendReflectionToImage:fraction:] (self=0xa03195c0, _cmd=0x9324, sourceImage=0x1251440, fraction=0.5) at /Users/fabian/Lounge/Lounge/NSImage+Reflection.m:29 #14 0x47b0 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 0x2108 in main (argc=0x1, argv=0xb7d4) at /Users/fabian/Lounge/Lounge/main.m:13 On Sat, Oct 24, 2009 at 7:36 PM, slasktrattena...@gmail.com slasktrattena...@gmail.com wrote: Thanks for your reply. On Sat, Oct 24, 2009 at 6:03 PM, Jens Alfke j...@mooseyard.com 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 (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/kenferry%40gmail.com This email sent to kenfe...@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
Re: Crash drawing image
Hm, nothing obviously wrong. Could you please file a bug at bugreporter.apple.com and send me the number? Thanks. -Ken Cocoa Frameworks On Sun, Oct 25, 2009 at 2:34 AM, slasktrattena...@gmail.com slasktrattena...@gmail.com wrote: I've uploaded a simple test case here: http://dl.getdropbox.com/u/550950/gc-crash.zip On Sat, Oct 24, 2009 at 11:18 PM, Ken Ferry kenfe...@gmail.com wrote: 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, slasktrattena...@gmail.com slasktrattena...@gmail.com 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 0x2acd in +[NSImage(Reflection) appendReflectionToImage:fraction:] (self=0xa03195c0, _cmd=0x9324, sourceImage=0x1251440, fraction=0.5) at /Users/fabian/Lounge/Lounge/NSImage+Reflection.m:29 #14 0x47b0 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 0x2108 in main (argc=0x1, argv=0xb7d4) at /Users/fabian/Lounge/Lounge/main.m:13 On Sat, Oct 24, 2009 at 7:36 PM, slasktrattena...@gmail.com slasktrattena...@gmail.com wrote: Thanks for your reply. On Sat, Oct 24, 2009 at 6:03 PM, Jens Alfke j...@mooseyard.com 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 (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/kenferry%40gmail.com This email sent to kenfe...@gmail.com
Re: Crash drawing image
Done. Bug ID# 7334881. On Sun, Oct 25, 2009 at 8:41 PM, Ken Ferry kenfe...@gmail.com wrote: Hm, nothing obviously wrong. Could you please file a bug at bugreporter.apple.com and send me the number? Thanks. -Ken Cocoa Frameworks On Sun, Oct 25, 2009 at 2:34 AM, slasktrattena...@gmail.com slasktrattena...@gmail.com wrote: I've uploaded a simple test case here: http://dl.getdropbox.com/u/550950/gc-crash.zip On Sat, Oct 24, 2009 at 11:18 PM, Ken Ferry kenfe...@gmail.com wrote: 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, slasktrattena...@gmail.com slasktrattena...@gmail.com 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 0x2acd in +[NSImage(Reflection) appendReflectionToImage:fraction:] (self=0xa03195c0, _cmd=0x9324, sourceImage=0x1251440, fraction=0.5) at /Users/fabian/Lounge/Lounge/NSImage+Reflection.m:29 #14 0x47b0 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 0x2108 in main (argc=0x1, argv=0xb7d4) at /Users/fabian/Lounge/Lounge/main.m:13 On Sat, Oct 24, 2009 at 7:36 PM, slasktrattena...@gmail.com slasktrattena...@gmail.com wrote: Thanks for your reply. On Sat, Oct 24, 2009 at 6:03 PM, Jens Alfke j...@mooseyard.com 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 (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:
Crash drawing image
Hello! I'm getting a random “EXC_BAD_ACCESS” on this line: [sourceImage compositeToPoint:NSMakePoint(0, height) operation:NSCompositeCopy]; sourceImage is an iTunes artwork, or a generic artwork icon if the current track has none. The crash ONLY happens with this generic icon (and only at random). The (retained) image is valid at the time of the crash and looks like this: NSImage 0x2003c7140 Size={600, 600} Reps=( NSBitmapImageRep 0x2004295c0 Size={600, 600} ColorSpace=iMac colorspace BPS=8 BPP=24 Pixels=600x600 Alpha=NO Planar=NO Format=0 CurrentBacking=CGImageRef: 0x2003c4f60 CGImageSource=0x2000af320 ) Here's my full code: + (NSImage *)appendReflectionToImage:(NSImage *)sourceImage fraction:(float)fraction { NSSize size = [sourceImage size]; float width = size.width; float height = size.height * fraction; NSImage *reflection = [[NSImage alloc] initWithSize:NSMakeSize(width, height)]; [reflection setFlipped:YES]; [reflection lockFocus]; [sourceImage drawAtPoint:NSZeroPoint fromRect:NSZeroRect operation:NSCompositeSourceOver fraction:1.0]; NSGradient *gradient = [[NSGradient alloc] initWithStartingColor:[NSColor colorWithDeviceWhite:0.0 alpha:0.5] endingColor:[NSColor colorWithDeviceWhite:0.0 alpha:1.0]]; [gradient drawInRect:NSMakeRect(0, 0, width, height) angle:90]; [reflection unlockFocus]; NSImage *destinationImage = [[NSImage alloc] initWithSize:NSMakeSize(width, size.height + height)]; [destinationImage lockFocus]; [reflection compositeToPoint:NSZeroPoint operation:NSCompositeCopy]; [sourceImage compositeToPoint:NSMakePoint(0, height) operation:NSCompositeCopy]; // CRASHES HERE, ALWAYS SAME IMAGE [destinationImage unlockFocus]; [destinationImage setScalesWhenResized:YES]; return destinationImage; } The project is a (GC enabled) screen saver, which makes it kind of hard to debug. I'm running it attached to the Screen Saver Engine. When the crash happens, I get the spinning beach ball until I terminate the process, so I cannot investigate it any further (I think?). Anyway, this is what I get from the debugger: Program received signal: “EXC_BAD_ACCESS”. Error while running hook_stop: Error while running hook_stop: Invalid type combination in ordering comparison. Error while running hook_stop: Invalid type combination in ordering comparison. Error while running hook_stop: Error while running hook_stop: Error while running hook_stop: Error while running hook_stop: Error while running hook_stop: Error while running hook_stop: Error while running hook_stop: Unable to disassemble ripc_RemoveEntry. Any ideas what the problem might be? I never had this crash before enabling GC (but have also altered the code above since then so this might not mean anything). Thank you. F. ___ 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: Crash drawing image
On Oct 24, 2009, at 6:51 AM, slasktrattena...@gmail.com wrote: When the crash happens, I get the spinning beach ball until I terminate the process, so I cannot investigate it any further (I think?). Anyway, this is what I get from the debugger: Program received signal: “EXC_BAD_ACCESS”. Error while running hook_stop: Error while running hook_stop: It would be really good to get a backtrace. Are you launching the process with gdb, or at least attaching before the crash? And after the crash, gdb is confused and can't get info about the process? Hm. 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)? 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.) —Jens___ 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: Crash drawing image
Thanks for your reply. On Sat, Oct 24, 2009 at 6:03 PM, Jens Alfke j...@mooseyard.com 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 (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: Crash drawing image
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 0x2acd in +[NSImage(Reflection) appendReflectionToImage:fraction:] (self=0xa03195c0, _cmd=0x9324, sourceImage=0x1251440, fraction=0.5) at /Users/fabian/Lounge/Lounge/NSImage+Reflection.m:29 #14 0x47b0 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 0x2108 in main (argc=0x1, argv=0xb7d4) at /Users/fabian/Lounge/Lounge/main.m:13 On Sat, Oct 24, 2009 at 7:36 PM, slasktrattena...@gmail.com slasktrattena...@gmail.com wrote: Thanks for your reply. On Sat, Oct 24, 2009 at 6:03 PM, Jens Alfke j...@mooseyard.com 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 (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: Crash drawing image
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, slasktrattena...@gmail.com slasktrattena...@gmail.com 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 0x2acd in +[NSImage(Reflection) appendReflectionToImage:fraction:] (self=0xa03195c0, _cmd=0x9324, sourceImage=0x1251440, fraction=0.5) at /Users/fabian/Lounge/Lounge/NSImage+Reflection.m:29 #14 0x47b0 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 0x2108 in main (argc=0x1, argv=0xb7d4) at /Users/fabian/Lounge/Lounge/main.m:13 On Sat, Oct 24, 2009 at 7:36 PM, slasktrattena...@gmail.com slasktrattena...@gmail.com wrote: Thanks for your reply. On Sat, Oct 24, 2009 at 6:03 PM, Jens Alfke j...@mooseyard.com 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 (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/kenferry%40gmail.com This email sent to kenfe...@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: Crash drawing image
On 24 Oct 2009, at 10:36, slasktrattena...@gmail.com wrote: 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. Try SSHing in from another machine and attaching to the process that way? ___ 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: Crash drawing image
On Sat, Oct 24, 2009 at 3:41 PM, Andrew Farmer andf...@gmail.com wrote: Try SSHing in from another machine and attaching to the process that way? If you want to do this from within Xcode: http://lists.apple.com/archives/xcode-users/2008/May/msg00226.html --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
drawing image
I have a custom NSButtonCell named MyButtonCell with a drawing method: - (void)drawInteriorWithFrame:(NSRect)cellFrame inView:(NSView *)controlView { cellFrame = [self imageRectForBounds:cellFrame]; [[self image] drawInRect:cellFrame fromRect:NSZeroRect operation:NSCompositeCopy fraction:1.0]; } The image is well drawn... but upside down. Can you tell why? Thanks in advance, regards, livio. ___ 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: drawing image
On May 4, 2009, at 1:25 PM, Livio Isaia wrote: [[self image] drawInRect:cellFrame fromRect:NSZeroRect operation:NSCompositeCopy fraction:1.0]; } The image is well drawn... but upside down. Can you tell why? For some historical reason (you can probably find out more by searching the archives), this drawing method won't compensate for a flipped view. The only workaround is to use NSAffineTransform to flip the context back around before drawing. Nick Zitzmann http://www.chronosnet.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: drawing image
It's inverted because of differences in coordinate systems between the image and the view it's being draw into. Before you draw the image, invert it: [[self image] setInverted:YES] ; On May 4, 2009, at 12:25 PM, Livio Isaia wrote: I have a custom NSButtonCell named MyButtonCell with a drawing method: - (void)drawInteriorWithFrame:(NSRect)cellFrame inView:(NSView *)controlView { cellFrame = [self imageRectForBounds:cellFrame]; [[self image] drawInRect:cellFrame fromRect:NSZeroRect operation:NSCompositeCopy fraction:1.0]; } The image is well drawn... but upside down. Can you tell why? Thanks in advance, regards, livio. ___ 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/mike%40instantvoodoomagic.com This email sent to m...@instantvoodoomagic.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: drawing image
On May 4, 2009, at 6:45 PM, Mike Manzano wrote: It's inverted because of differences in coordinate systems between the image and the view it's being draw into. Before you draw the image, invert it: [[self image] setInverted:YES] ; Before doing that, you should first ask the cell's view if it's flipped (see isFlipped). Cells can be contained by views in which isFlipped will return different results. ___ Ricky A. Sharp mailto:rsh...@instantinteractive.com Instant Interactive(tm) http://www.instantinteractive.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