From: SourceForge.net <no...@so...> - 2008-06-22 12:57:40
|
Bugs item #1995663, was opened at 2008-06-17 04:04 Message generated for change (Comment added) made by das You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=112997&aid=1995663&group_id=12997 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: 41. Photo Images Group: current: 8.5.2 Status: Closed Resolution: Duplicate Priority: 8 Private: No Submitted By: Jeff Godfrey (jgodfrey) Assigned to: Joe English (jenglish) Summary: Fatal Error in Wish Initial Comment: The following code will produce a fatal error in Wish (Windows XP, Tcl/Tk 8.52, Tile 0.8.2), when the window is resized. Details below the code... package require tile package require tkpng image create photo add -data { iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAAB l0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAJvSURBVDjLpZPrS5NhGIf9 W7YvBYOkhlkoqCklWChv2WyKik7blnNris72bi6dus0DLZ0TDxW1odtopDs4D8MDZuLU0k Xq61CijSIIasOvv94VTUfLiB74fXngup7nvrnvJABJ/5PfLnTTdcwOj4RsdYmo5glBWP6i OtzwvIKSWstI0Wgx80SBblpKtE9KQs/We7EaWoT/8wbWP61gMmCH0lMDvokT4j25TiQU/I TFkek9Ow6+7WH2gwsmahCPdwyw75uw9HEO2gUZSkfyI9zBPCJOoJ2SMmg46N61YO/rNoa3 9Xi41oFuXysMfh36/Fp0b7bAfWAH6RGi0HglWNCbzYgJaFjRv6zGuy+b9It96N3SQvNKiV 9HvSaDfFEIxXItnPs23BzJQd6DDEVM0OKsoVwBG/1VMzpXVWhbkUM2K4oJBDYuGmbKIJ0q xsAbHfRLzbjcnUbFBIpx/qH3vQv9b3U03IQ/HfFkERTzfFj8w8jSpR7GBE123uFEYAzaDR IqX/2JAtJbDat/COkd7CNBva2cMvq0MGxp0PRSCPF8BXjWG3FgNHc9XPT71Ojy3sMFdfJR CeKxEsVtKwFHwALZfCUk3tIfNR8XiJwc1LmL4dg141JPKtj3WUdNFJqLGFVPC4OkR4Bxaj TWsChY64wmCnMxsWPCHcutKBxMVp5mxA1S+aMComToaqTRUQknLTH62kHOVEE+VQnjahsc NCy0cMBWsSI0TCQcZc5ALkEYckL5A5noWSBhfm2AecMAjbcRWV0pUTh0HE64TNf0mczcnn Qyu/MilaFJCae1nw2fbz1DnVOxyGTlKeZft/Ff8x1BRssfACjTwQAAAABJRU5ErkJggg== } foreach btn {.a .b .c .d .e .f .g .h} { ttk::button $btn -image add pack $btn -side left } The code will create a horizontal set of ttk buttons in a toplevel window. Grab the right edge of the window and drag it narrower. Once the right-most button's entire image is obscured, wish crashes with the following error dialog: --------------------------- Fatal Error in Wish --------------------------- unable to alloc 4294967232 bytes --------------------------- OK --------------------------- Interestingly, changing the image to non-PNG-based data does not appear to cause the crash. Also, it occurs whether using tkpng or img::png. Jeff ---------------------------------------------------------------------- >Comment By: Daniel A. Steffen (das) Date: 2008-06-22 14:57 Message: Logged In: YES user_id=90580 Originator: NO just re-verified that I get no crash when running your exact script with the tk HEAD tktest built by the 'Debug' configuration of Wish.xcodeproj and with tkimg r150 from SVN built against tcl/tk HEAD, so this would appear to be specific to the ActiveTcl components involved. (maybe teapot Img is built against 8.4 headers/stubs and that causes a problem somehow?) the backtrace containing longjmp looks bogus, likely due to stack corruption, stepping through the code might be needed to figure out where it crashes, e.g. starting at CommonReadPNG() in tkimg/png/png.c. ---------------------------------------------------------------------- Comment By: Donal K. Fellows (dkf) Date: 2008-06-22 12:28 Message: Logged In: YES user_id=79902 Originator: NO Here's exactly what I've used to reproduce the crash. $ wish8.5 % package require ActiveTcl 8.5.2.0.284846 % set s { iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAAB l0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAJvSURBVDjLpZPrS5NhGIf9 W7YvBYOkhlkoqCklWChv2W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IKSWstI0Wgx80SBblpKtE9KQs/We7EaWoT/8wbWP61gMmCH0lMDvokT4j25TiQU/I TFkek9Ow6+7WH2gwsmahCPdwyw75uw9HEO2gUZSkfyI9zBPCJOoJ2SMmg46N61YO/rNoa3 9Xi41oFuXysMfh36/Fp0b7bAfWAH6RGi0HglWNCbzYgJaFjRv6zGuy+b9It96N3SQvNKiV 9HvSaDfFEIxXItnPs23BzJQd6DDEVM0OKsoVwBG/1VMzpXVWhbkUM2K4oJBDYuGmbKIJ0q xsAbHfRLzbjcnUbFBIpx/qH3vQv9b3U03IQ/HfFkERTzfFj8w8jSpR7GBE123uFEYAzaDR IqX/2JAtJbDat/COkd7CNBva2cMvq0MGxp0PRSCPF8BXjWG3FgNHc9XPT71Ojy3sMFdfJR CeKxEsVtKwFHwALZfCUk3tIfNR8XiJwc1LmL4dg141JPKtj3WUdNFJqLGFVPC4OkR4Bxaj TWsChY64wmCnMxsWPCHcutKBxMVp5mxA1S+aMComToaqTRUQknLTH62kHOVEE+VQnjahsc NCy0cMBWsSI0TCQcZc5ALkEYckL5A5noWSBhfm2AecMAjbcRWV0pUTh0HE64TNf0mczcnn Qyu/MilaFJCae1nw2fbz1DnVOxyGTlKeZft/Ff8x1BRssfACjTwQAAAABJRU5ErkJggg== % package require img::png 1.3 % image create photo add -data $s /usr/local/bin/wish8.5: line 2: 35980 Segmentation fault "$(dirname $0)/../../../Library/Frameworks/Tk.framework/Versions/8.5/Resources/Wish.app/Contents/MacOS/Wish" "$@" Whatever is going wrong, I can't figure it out. When I run gdb on the program it gives this (skipping unremarkable stuff): cspool38:~ dkf$ gdb /Library/Frameworks/Tk.framework/Versions/8.5/Resources/Wish.app/Contents/MacOS/Wish [...] % image create photo add -data $s Program received signal EXC_BAD_ACCESS, Could not access memory. Reason: 13 at address: 0x00000000 0x958642d9 in _longjmp () (gdb) bt #0 0x958642d9 in _longjmp () Cannot access memory at address 0x0 (gdb) quit I don't think I'm doing anything wrong. I'm definitely not using any part of Tile. I'm definitely not having an overwritten "add" command either. As far as I'm aware, it's the current version of img::png in the teapot ('teapot update' didn't download any updates for that package). Whatever is wrong (build of img::png? I don't think Tk itself uses longjmp) it's a critical error that should never have been exposed to user code. Also, the crash happens just the same when loading the same image from a file (after base64-decoding when creating the file). The file itself does not appear to be corrupt; the OSX Preview app handles it just fine. ---------------------------------------------------------------------- Comment By: Daniel A. Steffen (das) Date: 2008-06-20 22:41 Message: Logged In: YES user_id=90580 Originator: NO strange, r150 is the Img revision that works for me... (self-built universal Img, built against Tk HEAD) ---------------------------------------------------------------------- Comment By: Andreas Kupries (andreas_kupries) Date: 2008-06-20 19:09 Message: Logged In: YES user_id=75003 Originator: NO The current Img in teapot (2008, June 20) is based on svn revision 150. ---------------------------------------------------------------------- Comment By: Daniel A. Steffen (das) Date: 2008-06-20 16:54 Message: Logged In: YES user_id=90580 Originator: NO the macosx/GNUMakefile is just a wrapper around the normal unix configure/make buildsystem, so once built, just do a 'make shell ' in the build directory, which by default is in ../../build/tk/Development (starting at tk/macosx). You can configure the build location via the BUILD_DIR env/make var. The Tcl.xcodeproj may need Xcode 3.1 now, which I think you can only get as part of the iPhone SDK at the moment (there should be a standalone release soon) FWIW, I usually debug with the tktest target in Xcode, which is essentially equivalent to a completely static tcl/tk unix build (with --enable-aqua)... ---------------------------------------------------------------------- Comment By: Donal K. Fellows (dkf) Date: 2008-06-20 16:39 Message: Logged In: YES user_id=79902 Originator: NO I wanted to do a 'make shell', which is what I'd do with a normal unix build. cspool38:macosx dkf$ make shell make: *** No rule to make target `shell'. Stop. (Also, I'm having problems with running stuff inside Xcode; might need to do an update there.) I don't want the straight unix build on OSX. ---------------------------------------------------------------------- Comment By: Daniel A. Steffen (das) Date: 2008-06-20 16:31 Message: Logged In: YES user_id=90580 Originator: NO I cannot reproduce either of those crashes on OSX (donal's img crash or the original ttk crash) using tk HEAD and tkimg HEAD from svn. Possibly the teapot Img is based on older sources? Donal, can you elaborate which parts of the OSX build get in your way? e.g. framework building is a completely optional (and non-default) configure option... ---------------------------------------------------------------------- Comment By: Jeff Godfrey (jgodfrey) Date: 2008-06-19 19:56 Message: Logged In: YES user_id=113550 Originator: YES > Since you are using Tk 8.5, can you remove the tile 0.8.2 and retest? Removing the [package require tile] results in the same crash. It seems that ttk widgets cause the crash while Tk widgets do not. ttk::button - crash ttk::label - crash button - no crash label - no crash Jeff Godfrey ---------------------------------------------------------------------- Comment By: Donal K. Fellows (dkf) Date: 2008-06-19 11:42 Message: Logged In: YES user_id=79902 Originator: NO I could believe that is a different bug too. I can't chase it though; the extra stuff das has added to the OSX build for Tk (framework building, etc.) gets in the way. ---------------------------------------------------------------------- Comment By: Joe English (jenglish) Date: 2008-06-19 06:17 Message: Logged In: YES user_id=68433 Originator: NO Duplicate of #1967576 (fixed in CVS 2008-05-23). This report: > Crashes at image creation for me on OSX with ActiveTcl 8.5.2.0.284846 and > img::png 1.3 out of the teapot. sounds like a different bug. ---------------------------------------------------------------------- Comment By: Jeffrey Hobbs (hobbs) Date: 2008-06-18 19:52 Message: Logged In: YES user_id=72656 Originator: NO Since you are using Tk 8.5, can you remove the tile 0.8.2 and retest? If only ttk::button is causing it, I suspect that there may be some request for an invalid height image. ---------------------------------------------------------------------- Comment By: Jeff Godfrey (jgodfrey) Date: 2008-06-18 18:23 Message: Logged In: YES user_id=113550 Originator: YES As I'm getting the same crash using many different images, I assume the image data is not the culprit. Also, using the sample code provided in this ticket, I don't get the crash if I use a standard Tk button as opposed to a ttk::button. Jeff Godfrey ---------------------------------------------------------------------- Comment By: Donal K. Fellows (dkf) Date: 2008-06-17 12:20 Message: Logged In: YES user_id=79902 Originator: NO Crashes at image creation for me on OSX with ActiveTcl 8.5.2.0.284846 and img::png 1.3 out of the teapot. No Tile, no widget creation. Suspect that there's either a bug in PNG loaders or the image is bad. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=112997&aid=1995663&group_id=12997 |