From: SourceForge.net <no...@so...> - 2006-08-01 20:53:48
|
Bugs item #1532273, was opened at 2006-08-01 02:49 Message generated for change (Comment added) made by georgeps You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=112997&aid=1532273&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: 46. Unix Fonts Group: current: 8.4.13 Status: Open Resolution: None Priority: 9 Submitted By: Matthias Kraft (matzek) Assigned to: Jeffrey Hobbs (hobbs) Summary: core dump on HP-UX using [font measure] Initial Comment: Hi *, all Tcl/Tk versions from 8.4.0 up to and including 8.4.13 dump core on HP-UX 11.11 (11i v1) and 11.23 (11i v2) PARISC, when doing: % set fixed -adobe-courier-medium-r-normal--12-120-75-75-m-*-iso8859-1 -adobe-courier-medium-r-normal--12-120-75-75-m-*-iso8859-1 % font measure $fixed \u4e4e Bus error(coredump) In case that looks somewhat familiar to you, that is what happens in tk8.4/tests/entry.test between entry-2.5 and entry-3.1. Thus a "make test" for Tk always dumps core. Tcl and Tk where build from plain sources using CC="aCC -Ae +DAportable". The used aCC versions were HP-UX 11.11: HP ANSI C++ B3910B A.03.45 HP-UX 11.23: HP ANSI C++ B3910B A.03.60 The core (from 8.4.12 wish) itself stays here: #0 0x181fe8 in Tcl_UtfToUniChar (str=0x7f7f1b1c "\344\260\200\004", chPtr=0x7f7f1b1f) at [...]/tcl8.4/unix/../generic/tclUtf.c:339 339 *chPtr = (Tcl_UniChar) (((byte & 0x0F) << 12) #1 0x128470 in UtfToUcs2beProc (clientData=0x0, src=0x7f7f1b1c "\344\260\200\004", srcLen=3, flags=7, statePtr=0x7f7f1bb4, dst=0x7f7f1b1f "\004", dstLen=14, srcReadPtr=0x7f7f1bb8, dstWrotePtr=0x7f7f1bbc, dstCharsPtr=0x7f7f1bc0) at [...]/tk8.4/unix/tkUnixFont.c:616 #2 0x143ff4 in Tcl_UtfToExternal (interp=0x0, encoding=0x4005baf8, src=0x7f7f1b1c "\344\260\200\004", srcLen=3, flags=7, statePtr=0x7f7f1bb4, dst=0x7f7f1b1f "\004", dstLen=14, srcReadPtr=0x7f7f1bb8, dstWrotePtr=0x7f7f1bbc, dstCharsPtr=0x7f7f1bc0) at [...]/tcl8.4/unix/../generic/tclEncoding.c:1179 #3 0x12af90 in FontMapLoadPage (subFontPtr=0x7f7f1a28, row=19) at [...]/tk8.4/unix/tkUnixFont.c:2095 #4 0x12ac58 in FontMapLookup (subFontPtr=0x7f7f1a28, ch=20046) at [...]/tk8.4/unix/tkUnixFont.c:1985 #5 0x12b8c0 in CanUseFallback (fontPtr=0x40086510, faceName=0x40077468 "courier", ch=20046, fixSubFontPtrPtr=0x7f7f15cc) at [...]/tk8.4/unix/tkUnixFont.c:2429 #6 0x12a8a4 in FindSubFontForChar (fontPtr=0x40086510, ch=20046, fixSubFontPtrPtr=0x7f7f15cc) at [...]/tk8.4/unix/tkUnixFont.c:1858 #7 0x128cc8 in Tk_MeasureChars (tkfont=0x40086510, source=0x40075c70 "\344\271\216", numBytes=3, maxLength=-1, flags=0, lengthPtr=0x7f7f1550) at [...]/tk8.4/unix/tkUnixFont.c:992 #8 0x4c610 in Tk_TextWidth (tkfont=0x40086510, string=0x40075c70 "\344\271\216", numBytes=3) at [...]/tk8.4/unix/../generic/tkFont.c:1722 #9 0x4a86c in Tk_FontObjCmd (clientData=0x40059238, interp=0x4003ff70, objc=4, objv=0x40040c24) at [...]/tk8.4/unix/../generic/tkFont.c:681 #10 0x13b1f0 in TclEvalObjvInternal (interp=0x4003ff70, objc=4, objv=0x40040c24, command=0x0, length=0, flags=0) at [...]/tcl8.4/unix/../generic/tclBasic.c:3085 #11 0x1dde90 in TclExecuteByteCode (interp=0x4003ff70, codePtr=0x40077278) at [...]/tcl8.4/unix/../generic/tclExecute.c:1419 #12 0x1dc920 in TclCompEvalObj (interp=0x4003ff70, objPtr=0x400406f8) at [...]/tcl8.4/unix/../generic/tclExecute.c:981 #13 0x13cbe8 in Tcl_EvalObjEx (interp=0x4003ff70, objPtr=0x400406f8, flags=131072) at [...]/tcl8.4/unix/../generic/tclBasic.c:4049 #14 0x150078 in Tcl_RecordAndEvalObj (interp=0x4003ff70, cmdPtr=0x400406f8, flags=131072) at [...]/tcl8.4/unix/../generic/tclHistory.c:142 #15 0x14fe9c in Tcl_RecordAndEval (interp=0x4003ff70, cmd=0x40046868 "font measure $fixed \\u4e4e\n", flags=131072) at [...]/tcl8.4/unix/../generic/tclHistory.c:62 #16 0x33e18 in StdinProc (clientData=0x40066b10, mask=2) at [...]/tk8.4/unix/../generic/tkMain.c:368 #17 0x15eb30 in Tcl_NotifyChannel (channel=0x40066b10, mask=2) at [...]/tcl8.4/unix/../generic/tclIO.c:6904 #18 0x19515c in FileHandlerEventProc (evPtr=0x40060298, flags=-3) at [...]/tcl8.4/unix/tclUnixNotfy.c:633 #19 0x1706d4 in Tcl_ServiceEvent (flags=-3) at [...]/tcl8.4/unix/../generic/tclNotify.c:640 #20 0x170d54 in Tcl_DoOneEvent (flags=-3) at [...]/tcl8.4/unix/../generic/tclNotify.c:945 #21 0x48890 in Tk_MainLoop () at [...]/tk8.4/unix/../generic/tkEvent.c:1501 #22 0x33c5c in Tk_MainEx (argc=-1, argv=0x7f7f07a8, appInitProc=0x400383da <Tcl_AppInit>, interp=0x4003ff70) at [...]/tk8.4/unix/../generic/tkMain.c:297 #23 0x33568 in main (argc=1, argv=0x7f7f07a4) at [...]/tk8.4/unix/tkAppInit.c:68 I'll happily provide more information, do testing etc. - just let me know. kind regards -- Matthias Kraft ---------------------------------------------------------------------- >Comment By: George Peter Staplin (georgeps) Date: 2006-08-01 14:53 Message: Logged In: YES user_id=585068 sorry, that should be sizeof(casttype) :) ---------------------------------------------------------------------- Comment By: George Peter Staplin (georgeps) Date: 2006-08-01 14:40 Message: Logged In: YES user_id=585068 This is a serious problem, and I know why it occurs now. I have increased the priority to 9. Consider this code from UtfToUcs2beProc: char *dst Tcl_UniChar *wDst, *wDstStart, *wDstEnd; wDst = (Tcl_UniChar *) dst; wDstStart = (Tcl_UniChar *) dst; wDstEnd = (Tcl_UniChar *) (dst + dstLen - sizeof(Tcl_UniChar)); Ucs2beToUtfProc has similar problems. This should be failing on nearly any big-endian system. I guess it's just happened that dst has been aligned on other big-endian systems, or perhaps they aren't as sensitive to bad code and bus errors. Note to developers: You MUST NOT CAST pointer types, unless you are certain the pointer is aligned to sizeof (casttype *) bytes, and even then it's iffy. ---------------------------------------------------------------------- Comment By: Matthias Kraft (matzek) Date: 2006-08-01 14:20 Message: Logged In: YES user_id=330806 That's odd indeed. But if you take a closer look something stands out: statePtr=0x7f7f1bb4 srcReadPtr=0x7f7f1bb8 -> statePtr + 4 dstWrotePtr=0x7f7f1bbc -> statePtr + 8 dstCharsPtr=0x7f7f1bc0 -> statePtr + 12 -- Matthias ---------------------------------------------------------------------- Comment By: Don Porter (dgp) Date: 2006-08-01 08:41 Message: Logged In: YES user_id=80530 Something is wrong at #2 in the stack trace. Looking at line 2095 of Revision 1.18.2.4 of tkUnixFont.c, the last three arguments to Tcl_UtfToExternal() are all NULL, but in the stack trace have non-NULL values. Also, sizeof(buf) ought to be 16, but shows up in the stack trace as 14. The statePtr argument also should be NULL, but isn't. Weird. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=112997&aid=1532273&group_id=12997 |