Menu

#1672 TkMacOSXXPutPixel() / tkdvi

open
4
2006-06-18
2004-03-16
No

Submitted by Matthieu Quignard (quignard@loria.fr) as
requested by Daniel A. Steffen (das)

Context : building tkdvi (0.4) by Anselm Lingnau, on MacOS
X (10.2.8) with Tcl/Tk Aqua (8.4.6).

Configure :
set tcldir=/Library/Frameworks/Tcl.framework/Versions/
Current
set tclincdir=$tcldir/Headers
set tkdir=/Library/Frameworks/Tk.framework/Versions/
Current
set tkincdir=$tkdir/Headers
set kpathdir=/sw/lib
set kpathincdir=/sw/include/kpathsea
(kpathsea got from fink tetex-dev)

./configure --with-tcl=$tcldir
--with-tclinclude=$tclincdir --
with-tk=$tkdir --with-tkinclude=$tkincdir --with-
kpathsea=$kpathdir
--with-kpathseainclude=$kpathincdir --enable-debug --
disable-threads

Fix the Makefile in ./dvi :
* Add -DHAVE_PROTOTYPES=1 to compile with gcc 3.3 and
remove -DUSE_STUBS_TK=1 -DUSE_STUBS_TCL=1
* link with -L/Library/Frameworks/Tk.framework/Versions/
8.4 -L/Library/Frameworks/Tcl.framework/Versions/8.4 -
framework Tcl -framework Tk -lpthread -framework
CoreFoundation

Compiling and linking are succesfull.

Testing (tkdvi testdvi/mini) leads to Segmentation fault.

Here is the crash report :
Date/Time: 2004-03-16 10:12:24 +0100
OS Version: 10.2.8 (Build 6R73)
Host: vercors.loria.fr

Command: Wish Shell
PID: 2138

Exception: EXC_BAD_ACCESS (0x0001)
Codes: KERN_INVALID_ADDRESS (0x0001) at 0xffff0000

Thread 0 Crashed:
#0 0x91ad9754 in SetCPixel
#1 0x0b094518 in TkMacOSXXPutPixel
#2 0x01338fc0 in GlyphToImageShrink
#3 0x013391c4 in RenderGlyph
#4 0x013326fc in Dvi_DoInterpret
#5 0x01339a58 in DviImgDisplay
#6 0x0b03b044 in Tk_RedrawImage
#7 0x0b013bac in DisplayImage
#8 0x0b00ef5c in DisplayCanvas
#9 0x0a066f74 in TclServiceIdle
#10 0x0a056910 in Tcl_DoOneEvent
#11 0x0b033628 in MapFrame
#12 0x0a066f74 in TclServiceIdle
#13 0x0a056910 in Tcl_DoOneEvent
#14 0x0b02d2f8 in Tk_MainLoop
#15 0x0b04ab50 in Tk_MainEx
#16 0x00010180 in 0x10180
#17 0x0000ffa8 in 0xffa8
#18 0x0000fe28 in 0xfe28

Thread 1:
#0 0x9002568c in select
#1 0x0b08a658 in NotifierThreadProc
#2 0x90020c28 in _pthread_body

PPC Thread State:
srr0: 0x91ad9754 srr1: 0x0200f030 vrsave:
0x00000000
xer: 0x20000000 lr: 0x91ad9740 ctr: 0x902216d0 mq:
0x00000000
r0: 0x91ad9740 r1: 0xbfffef80 r2: 0x01436788 r3:
0x00000000
r4: 0x00000000 r5: 0xbffff048 r6: 0x69012501 r7:
0x0133c9d8
r8: 0x0128623c r9: 0xffff0000 r10: 0x0133c8d8 r11:
0xa1a50cd0
r12: 0x902216d0 r13: 0x00000000 r14: 0x00000000
r15: 0x00000000
r16: 0xbffff184 r17: 0xbffff180 r18: 0x0140ce08 r19:
0x00000005
r20: 0x00000000 r21: 0x01286234 r22: 0x00000000
r23: 0x00000008
r24: 0x00000039 r25: 0xbffff048 r26: 0x00000000 r27:
0x00000000
r28: 0x69012501 r29: 0x00000000 r30: 0x0129be08
r31: 0x01338d3c

Discussion

  • matthieu quignard

    • assigned_to: nobody --> das
     
  • Donal K. Fellows

    • labels: --> 66. Aqua Window Operations
     
  • matthieu quignard

    Logged In: YES
    user_id=999056

    I changed the last parameter in function XPutPixel (tkdvi/dvi/image.c),
    and set it to 0 : there is no SegFault anymore...

    Before :
    XPutPixel(glyphImage, x, y,
    colorContextPtr->pixelTable[theSample]->pixel);
    After :
    XPutPixel(glyphImage, x, y, 0);

    Perhaps we should look closer to ColorContext *colorContextPtr...

     
  • Donal K. Fellows

    • milestone: --> 377005
    • priority: 5 --> 8
     
  • matthieu quignard

    Logged In: YES
    user_id=999056

    ERRATUM. It IS actually a bug in XPutPixel, I took the wrong test file.
    XPutPixel(glyphImage, x, y, 0) does not work better as the former
    one. Sorry.
    MQ

     
  • matthieu quignard

    • milestone: 377005 -->
    • priority: 8 --> 5
     
  • Daniel A. Steffen

    Logged In: YES
    user_id=90580

    set a breakpoint in gdb on TkMacOSXXPutPixel() (tk/macosx/
    tkMacOSXXStubs.c) and check that
    - image->data is not NULL
    - image->data is a calid quickdraw port
    (via gdb function 'call (void) QDDebugPrintPortInfo(image-
    >data)')
    - x,y are valid coordinates in the image
    - cpix is a valid color value

     
  • matthieu quignard

    Logged In: YES
    user_id=999056

    Here is what I got :
    x = 0
    y = 0
    cPix : red = green = blue = 255
    image = (XImage *) 0xb30b88
    image->data = 0xb44408 ""

    BUT :
    (gdb) call (void) QDDebugPrintPortInfo(image->data)
    Program received signal EXC_BAD_ACCESS, Could not access
    memory.
    0xb97213f4 in GetPortHiliteColor ()

     
  • Daniel A. Steffen

    • priority: 5 --> 4
     
MongoDB Logo MongoDB