Updated 2014-09-04 18:37:37 by AMG

I have been experiencing strange crashes running Tk on Linux (OpenSuse 13.1) on my i5-2500K. In some respect this must be a video driver problem, since if I replace the intel driver with the (very slow) framebuffer driver, the crash does not occur.

However, there is a dependence on what you are doing in Tk. Drawing lines on a canvas causes a crash of X iff _all_ of the following conditions are met:
 1. lines extend outside visible area of canvas
 2. lines are smoothed
 3. lines are dashed
 4. lines are 1 pixel wide

There's a litle test program below. I'd be interested if it crashes for anyone else's i5-2500K, or if something is peculiar about mine.

As it stands, this program does not crash. If I edit the canvas dimensions to 400x400 it does. If I change the comments to enable one of the alternative canvas create statements it does not crash, even on the smaller canvas.

Does anyone understand what's really going on?

APN The Wiki is really not a good place for reporting bugs/crashes. You will likely get better response by filing a ticket at http://core.tcl.tk/tk/reportlist Also, please state the Tcl/Tk version.

IDG Well, it's not clear where to file a bug report. Could be a bug in Intel driver, a bug in Tk, both of the above or a problem with my hardware. I was hoping for some discussion/enlightenment before filing a bug. Crash happens with a full 8.6.1(64 bit) installation, and also with a 8.5.9(32 bit) tclkit.

AMG: To enter a ticket, log in. You can be anonymous. The login URL is http://core.tcl.tk/tk/login. Then you can enter a ticket. The new ticket URL is http://core.tcl.tk/tk/tktnew.
----------------------------- cut here -------------------------------
 #! /usr/bin/env tclsh

 # WARNING THIS WILL DESTROY ANY FILE NAMED crash_count

 package require Tk

 set pts {512 88 473 49 346 112 229 229 112 346 49 473\
         88 512 127 551 254 488 371 371 488 254 551 127}

 proc main {} {
   canvas .c -width 600 -height 600 -bg white
   pack .c -fill both -expand 1
   
   file delete crash_count
   set c 0
   for {set i 0} {$i < 1000} {incr i} {
      set cc [format "#%03x" [expr {$c % 4096}]]
     .c create line $::pts -fill $cc -smooth raw -splinesteps 99 -dash {3 3}
 #     .c create line $::pts -fill $cc -width 2 -smooth raw -splinesteps 99 -dash {3 3}
 #     .c create line $::pts -fill $cc -smooth raw -splinesteps 99
 #     .c create line $::pts -fill $cc -dash {3 3}

      update idletasks
      incr c
      set f [open crash_count w]
      puts $f $c
      close $f
   }
   puts done
 }

 main