Tk Source Code

View Ticket
Login
Ticket UUID: 3547229
Title: Tk crashes when drawing many dashed objects
Type: Bug Version: obsolete: 8.5.11
Submitter: exgerhardr Created on: 2012-07-22 11:32:50
Subsystem: 05. Canvas Items Assigned To: jan.nijtmans
Priority: 5 Medium Severity: Minor
Status: Closed Last Modified: 2017-11-20 21:22:45
Resolution: Duplicate Closed By: fvogel
    Closed on: 2017-11-20 21:22:45
Description:
When drawing many dashed lines (problably arcs, ...) wish crashes.
Problem found on Linux only.
Error messsage:
X Error of failed request:  BadValue (integer parameter out of range for operation)
  Major opcode of failed request:  55 (X_CreateGC)
  Value in failed request:  0x0
  Serial number of failed request:  1481
  Current serial number in output stream:  1485

Attached example:
Unpack (tar -xzvf view_dxf-8.5-0.3_bugrep.tgz)
  ./view_dxf-8.5-0.3.tk Scheibenkupplunhshaelfte1.dxf

wish crashes almost all time on Tk 8.5
wish crashes less often on Tk 8.6 (try reloading by double click icon "*" entry in the listbox if no crash)  
effect not found on Tk 8.4 or Windows
example requires BWidget.
User Comments: fvogel added on 2017-11-20 21:22:45:

After having been prompted in comp.lang.tcl, the OP reports the following in that usenet group:

I mixed different environments (3 PCs in my office).
I tested it with Debian 9 on TCL 8.6.2 and Debian 9.2 on TCL 8.6.6 with 
the same results (crash often).
8.6.7 version does NOT crash, at least not for ca. 100 restarts.
So, the bug seems to be fixed in 8.6.7

This is consistent with the date of the fix made for the duplicate ticket [f325020623] in Jan 2017: this fix was not in 8.6.6 (released 27/07/2016) but is part of 8.6.7 (released 09/08/2017).

So this is already fixed, let's close this ticket.


fvogel added on 2017-11-17 12:00:18:
Oh sorry, you must be right. I missed that I info.

jan.nijtmans added on 2017-11-17 11:48:27:
In Gerhardr's log:
  % info patchlevel
  8.6.2
  ...
  Tcl 8.6.6, Debian 9, 64-bit

So, it looks like this was really 8.6.2, in which this bug was indeed not fixed yet. Please re-try with 8.6.7, and if it still isn't fixed re-open this ticket.

fvogel added on 2017-11-17 11:02:28:

The OP states it's not fixed. See discussion in comp.lang.tcl here.


jan.nijtmans added on 2017-11-17 10:45:36:

Should be fixed already. Closing this as dup of [f325020623898d6afe8bb73276459a922003c077]


gerhardr (claiming to be Gerhard) added on 2017-11-16 17:27:02:
# test script crash_test.tcl
package require Tk

pack [canvas .c -width 1200 -height 800]
proc draw_rand_lines {} {
  for {set i 0} {$i < 100} {incr i} {
    lappend coords [expr {rand()*1000.0}]
  }
  set dashes {4 4 14 4 4 4 4 3 6 4 14 4 4 4 4 4 6 4 1 4}
  foreach {x1 y1 x2 y2} $coords {
    .c create line $x1 $x1 $x2 $y2 -fill "#ff0000" -dash $dashes
  }
}

draw_rand_lines
after 100 {destroy .}

--
This script is very similar to that one for ticket:
https://core.tcl.tk/tk/tktview/f325020623898d6afe8b
 
Recommended use is a shell script loop, here's an example:
while true ; do wish crash_test.tcl; echo "Exit code: $?"; sleep 1; done
Exit code: 0
Exit code: 0
Exit code: 0
Exit code: 0
X Error of failed request:  BadValue (integer parameter out of range for operation)
  Major opcode of failed request:  55 (X_CreateGC)
  Value in failed request:  0x0
  Serial number of failed request:  36
  Current serial number in output stream:  53
Exit code: 1
X Error of failed request:  BadValue (integer parameter out of range for operation)
  Major opcode of failed request:  55 (X_CreateGC)
  Value in failed request:  0x0
  Serial number of failed request:  40
  Current serial number in output stream:  61
Exit code: 1
Exit code: 0
X Error of failed request:  BadValue (integer parameter out of range for operation)
  Major opcode of failed request:  55 (X_CreateGC)
  Value in failed request:  0x0
  Serial number of failed request:  40
  Current serial number in output stream:  57
Exit code: 1
...
Test environment (Debian 9):
% info patchlevel
8.6.2
% puts $tcl_platform(os)
Linux
% puts $tcl_platform(machine)
x86_64
%

Tcl 8.6.6, Debian 9, 64-bit

exgerhardr added on 2012-07-22 18:32:51:

File Added - 449502: view_dxf-8.5-0.3_bugrep.tgz

Attachments: