Tk Source Code

Ticket Change Details
Login
Overview

Artifact ID: f354bb5989648ccc844956a21f173a8126407969
Ticket: 9f283c0b904dd7ea372b97af4ce76bc1a3662555
Revised [text]: textIndex-19.14 fails on Linux
User & Date: fvogel 2017-07-09 15:12:58
Changes

  1. icomment:
    tkUnixRFont.c is not used it seems. tkUnixFont.c is instead (I will try to check whether the test still fails with --enable-xft, which I guess should make use of tkUnixRFont.c).
    
    Debugging this a bit, just by running <code>font actual {{DejaVu Sans}}</code>, everything looks OK until:
    <verbatim>
    (gdb) bt
    #0  ListFonts (display=0x6804e0, faceName=0x73a8f0 "DejaVu Sans", numNamesPtr=0x7fffffffd71c) at /home/francois/Documents/tcltk/fossil/tk/unix/../unix/tkUnixFont.c:2914
    #1  0x00007ffff7b549f5 in ListFontOrAlias (display=0x6804e0, faceName=0x73a8f0 "DejaVu Sans", numNamesPtr=0x7fffffffd71c) at /home/francois/Documents/tcltk/fossil/tk/unix/../unix/tkUnixFont.c:2927
    #2  0x00007ffff7b523fb in CreateClosestFont (tkwin=0x667880, faPtr=0x7fffffffd830, xaPtr=0x7fffffffd7d0) at /home/francois/Documents/tcltk/fossil/tk/unix/../unix/tkUnixFont.c:1493
    #3  0x00007ffff7b512a2 in TkpGetFontFromAttributes (tkFontPtr=0x0, tkwin=0x667880, faPtr=0x7fffffffd830) at /home/francois/Documents/tcltk/fossil/tk/unix/../unix/tkUnixFont.c:782
    #4  0x00007ffff7a017ae in Tk_AllocFontFromObj (interp=0x618ca0, tkwin=0x667880, objPtr=0x65c7e0) at /home/francois/Documents/tcltk/fossil/tk/unix/../generic/tkFont.c:1182
    #5  0x00007ffff7a0027e in Tk_FontObjCmd (clientData=0x667880, interp=0x618ca0, objc=3, objv=0x61cd50) at /home/francois/Documents/tcltk/fossil/tk/unix/../generic/tkFont.c:584
    #6  0x00007ffff75bdd45 in Dispatch (data=0x65f5d8, interp=0x618ca0, result=0) at /home/francois/Documents/tcltk/fossil/tcl/generic/tclBasic.c:4365
    #7  0x00007ffff75bddce in TclNRRunCallbacks (interp=0x618ca0, result=0, rootPtr=0x0) at /home/francois/Documents/tcltk/fossil/tcl/generic/tclBasic.c:4398
    #8  0x00007ffff75c0919 in TclEvalObjEx (interp=0x618ca0, objPtr=0x0, flags=131072, invoker=0x0, word=0) at /home/francois/Documents/tcltk/fossil/tcl/generic/tclBasic.c:5963
    #9  0x00007ffff75c08af in Tcl_EvalObjEx (interp=0x618ca0, objPtr=0xffffffff, flags=131072) at /home/francois/Documents/tcltk/fossil/tcl/generic/tclBasic.c:5944
    #10 0x00007ffff76ae972 in Tcl_RecordAndEvalObj (interp=0x618ca0, cmdPtr=0x661bb0, flags=131072) at /home/francois/Documents/tcltk/fossil/tcl/generic/tclHistory.c:190
    #11 0x00007ffff76ae637 in Tcl_RecordAndEval (interp=0x618ca0, cmd=0x7fffffffdec0 "font actual {{DejaVu Sans}}\n", flags=131072) at /home/francois/Documents/tcltk/fossil/tcl/generic/tclHistory.c:75
    #12 0x00007ffff7a17f78 in StdinProc (clientData=0x7fffffffdea0, mask=2) at /home/francois/Documents/tcltk/fossil/tk/unix/../generic/tkMain.c:456
    #13 0x00007ffff76c1dff in Tcl_NotifyChannel (channel=0x6eae00, mask=2) at /home/francois/Documents/tcltk/fossil/tcl/generic/tclIO.c:8360
    #14 0x00007ffff773971a in FileHandlerEventProc (evPtr=0x7048e0, flags=-3) at /home/francois/Documents/tcltk/fossil/tcl/unix/tclUnixNotfy.c:805
    #15 0x00007ffff76e669f in Tcl_ServiceEvent (flags=-3) at /home/francois/Documents/tcltk/fossil/tcl/generic/tclNotify.c:670
    #16 0x00007ffff76e6adb in Tcl_DoOneEvent (flags=-3) at /home/francois/Documents/tcltk/fossil/tcl/generic/tclNotify.c:967
    #17 0x00007ffff79fe7f2 in Tk_MainLoop () at /home/francois/Documents/tcltk/fossil/tk/unix/../generic/tkEvent.c:2148
    #18 0x00007ffff7a17d42 in Tk_MainEx (argc=-1, argv=0x7fffffffe1e0, appInitProc=0x400aeb <Tcl_AppInit>, interp=0x618ca0) at /home/francois/Documents/tcltk/fossil/tk/unix/../generic/tkMain.c:390
    #19 0x0000000000400ae4 in main (argc=1, argv=0x7fffffffe1d8) at /home/francois/Documents/tcltk/fossil/tk/unix/../unix/tkAppInit.c:78
    </verbatim>
    
    ListFonts simply is:
    <verbatim>
        sprintf(buf, "-*-%.80s-*-*-*-*-*-*-*-*-*-*-*-*", faceName);
        return XListFonts(display, buf, 10000, numNamesPtr);
    </verbatim>
    
    At this point we have:
    <verbatim>
    (gdb) p faceName
    $39 = 0x73a8f0 "DejaVu Sans"
    (gdb) p buf
    $40 = "-*-DejaVu Sans-*-*-*-*-*-*-*-*-*-*-*-*\000\000@2`\000\000\000\000\000`\302a", '\000' <repeats 13 times>, "\260\325\377\377\377\177\000\000\213\252\\\367\377\177\000\000\310[k\000\000\000\000\000\300[k\000*\000\000\000 \326\377\377\377\177\000\000 \255\205\000\000\000\000\000\360\325\377\377\377\177\000\000\034\343j\367\377\177\000\000\364m\271\367\377\177\000\000\070\ag\000\000\000\000\000 \255\205\000\000\000\000\000\037\331j\367\n\000\000\000\364m\271\367\377\177\000\000\320\341\377\377\n\000\000\000P\326\377\377\377\177\000\000\224\333j\367\377\177\000\000\060\350s\000\025\000\000\000"...
    </verbatim>
    
    The X11 library XListFonts() does not return any font with this (numNamesPtr is zero).
    
  2. login: "fvogel"
  3. mimetype: "text/x-fossil-wiki"