Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Canvas create line still crashes on long dash list

126 views
Skip to first unread message

Gerhard Reithofer

unread,
Nov 11, 2017, 7:53:54 PM11/11/17
to
Hi developers,
a question regarding bug report:
f325020623898d6afe8bb73276459a922003c077 (Tk crashes when drawing many
dashed objects - rereport)

Due to the bug report state the problem should be resolved but I have it
now repeatable on Debian 9.2, amd64, Tcl 8.6.6.
"Should be fixed now on core-8-5-branch, core-8-6-branch and trunk."

Whereas it crashed earlier with a probability of 50% it crashes now
always. I used exactly the code from the old bug report for testing it
again:

### BEG
pack [canvas .c -bg white -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 x1 x2 y2} $coords {
.c create line $x1 $x1 $x2 $y2 -fill "#ff0000" -dash $dashes
}
}

draw_rand_lines
puts "OK!"
### END

Can anyone confirm this?

TIA,
Gerhard

--
Gerhard Reithofer - Techn. EDV Reithofer - http://www.tech-edv.co.at

jda...@gmail.com

unread,
Nov 12, 2017, 9:38:12 AM11/12/17
to
Modified script to use x1 y1 ... instead of x1 x1.
Crashes with Slackware on Intel x86_64.

Does not crash after changing canvas background to black.
No clue why.

Dave B

Gerhard Reithofer

unread,
Nov 12, 2017, 11:08:07 AM11/12/17
to
Hi Dave,
you are right, should be x1 y1 but doesn't matter. Also changing -bg to
black doesn't help here.
Only short dash patterns work, like the 1st eight numbers.

Thanks for testing,

Christian Gollwitzer

unread,
Nov 12, 2017, 1:24:04 PM11/12/17
to
Am 12.11.17 um 16:27 schrieb Gerhard Reithofer:
> Hi Dave,
>
> On Sun, 12 Nov 2017, jda...@gmail.com wrote:
>
>> Modified script to use x1 y1 ... instead of x1 x1.
>> Crashes with Slackware on Intel x86_64.
>>
>> Does not crash after changing canvas background to black.
>> No clue why.
>>
>> Dave B
>
> you are right, should be x1 y1 but doesn't matter. Also changing -bg to
> black doesn't help here.
> Only short dash patterns work, like the 1st eight numbers.

Run it on valgrind. You need to recompile it with -DPURIFY and symbols
enabled (--enable-symbols, IIRC), and then run "valgrind tclsh
your_code.tcl". That should print out the first memory error.

Christian

Gerhard Reithofer

unread,
Nov 13, 2017, 8:08:08 AM11/13/17
to
Hi Christian,

On Sun, 12 Nov 2017, Christian Gollwitzer wrote:
> Am 12.11.17 um 16:27 schrieb Gerhard Reithofer:
> > Hi Dave,
> >
> > On Sun, 12 Nov 2017, jda...@gmail.com wrote:
> >
> > > Modified script to use x1 y1 ... instead of x1 x1.

...

> > > No clue why.
> > >
> > > Dave B
> >
> > you are right, should be x1 y1 but doesn't matter. Also changing -bg to
> > black doesn't help here.
> > Only short dash patterns work, like the 1st eight numbers.
>
> Run it on valgrind. You need to recompile it with -DPURIFY and symbols enabled
> (--enable-symbols, IIRC), and then run "valgrind tclsh your_code.tcl". That
> should print out the first memory error.

I only ran into this problem again by analyzing a problem in tkPath for
a friend. This extension also fails or crashes by accessing the
dash-structure.

Unfortunatelly I cannot currently analyze it in more depth due to
missing time, but maybe later.
I will post here if I have more information.

BTW: Should write a bugreport again?

THX,

Francois Vogel

unread,
Nov 15, 2017, 4:17:04 PM11/15/17
to
Gerhard Reithofer a écrit le 13/11/2017 à 13:09 :
> BTW: Should write a bugreport again?

Suggest you put your latest findings in the currently open ticket:

    https://core.tcl.tk/tk/tktview?name=3547229fff

Having a short reproducible script, as you have now, is way better
than the "view_dxf_whatnot.tgz" example requiring BWidget that is
currently there. To be honest I didn't look at this ticket because it
required BWidget and I had lower hanging fruits to analyze than those
needing installation of yet another package for the sake of
reproducibility.

Please also cross-link the two tickets.

Thanks,
Francois

Gerhard Reithofer

unread,
Nov 16, 2017, 12:36:51 PM11/16/17
to
Hi Francois,

On Wed, 15 Nov 2017, Francois Vogel wrote:

> Gerhard Reithofer a écrit le 13/11/2017 à 13:09 :
> > BTW: Should write a bugreport again?
>
> Suggest you put your latest findings in the currently open ticket:
>
>     https://core.tcl.tk/tk/tktview?name=3547229fff
>
> Having a short reproducible script, as you have now, is way better than the
> "view_dxf_whatnot.tgz" example requiring BWidget that is currently there. To

of course :-)

I've added a modified test script which should make it reproduceable in
short time - more or less :-( This time it happened again "often" but
not always. Seems to depend on random situations (probably memory layout
or similar circumstances).

Thank you,

Francois Vogel

unread,
Nov 19, 2017, 4:00:10 PM11/19/17
to Gerhard Reithofer
Gerhard Reithofer a écrit le 16/11/2017 à 18:36 :
>> Suggest you put your latest findings in the currently open ticket:
>>
>>     https://core.tcl.tk/tk/tktview?name=3547229fff
> I've added ...

Gerhard, could you have a look at the ticket please?

We are unsure on which version you see the problem. Indeed in your
comment in that ticket you write:

Test environment (Debian 9):
% info patchlevel
8.6.2

and a few lines after you state:

"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.

But it is also true that you manually write 8.6.6.

This is confusing, which version is the one you see the bug on?

Please re-try with 8.6.7 and confirm (preferably directly in the ticket).

Thanks,
Francois

Gerhard Reithofer

unread,
Nov 20, 2017, 9:33:57 AM11/20/17
to
Hi Francois,

On Sun, 19 Nov 2017, Francois Vogel wrote:
> Gerhard Reithofer a ?crit le 16/11/2017 ? 18:36 :
> > > Suggest you put your latest findings in the currently open ticket:
> > >
> > >     https://core.tcl.tk/tk/tktview?name=3547229fff
> > I've added ...
>
> Gerhard, could you have a look at the ticket please?
>
> We are unsure on which version you see the problem. Indeed in your comment in
> that ticket you write:
>
> Test environment (Debian 9):
> % info patchlevel
> 8.6.2
>
> and a few lines after you state:
>
> "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.
>
> But it is also true that you manually write 8.6.6.
>
> This is confusing, which version is the one you see the bug on?

You are right, 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).

> Please re-try with 8.6.7 and confirm (preferably directly in the ticket).

I could only find a binary version from Thomas Perschak for Ubuntu and I
made tests on Debian 9.2 with the binary version:
https://bitbucket.org/tombert/tcltk/downloads/tcltk86-8.6.7-0.tcl86.xenial.x86_64.deb

This version does NOT crash, at least not for ca. 100 restarts.
So, the bug seems to be fixed in 8.6.7? :-)

while true ; do /home/tcltk86/bin/wish crash_test.tcl; echo "Exit code:
$?"; sleep 1; done
Exit code: 0
Exit code: 0
Exit code: 0
...

It has other package dependencies compared to Debian 9.2 and TCL 8.6.6
and I had to install in addition: chrpath, libfftw3-3, libpq5. I'm
rather sure that they are not related to the canvas bug.

Bye,

Francois Vogel

unread,
Nov 20, 2017, 4:24:39 PM11/20/17
to Gerhard Reithofer
Gerhard Reithofer a écrit le 20/11/2017 à 15:33 :
> 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).
>
>> Please re-try with 8.6.7 and confirm (preferably directly in the ticket).
> This version does NOT crash, at least not for ca. 100 restarts.
> So, the bug seems to be fixed in 8.6.7? :-)

What you explain here confirms this is already fixed. See details in
the ticket.
The fix in in 8.6.7.

F.

Gerhard Reithofer

unread,
Nov 21, 2017, 11:08:08 AM11/21/17
to
Hi Francois,

On Mon, 20 Nov 2017, Francois Vogel wrote:
> Gerhard Reithofer a ?crit le 20/11/2017 ? 15:33 :

...

> > This version does NOT crash, at least not for ca. 100 restarts.
> > So, the bug seems to be fixed in 8.6.7? :-)
>
> What you explain here confirms this is already fixed. See details in the
> ticket.
> The fix in in 8.6.7.

_____ _ ___ __ __
|_ _| | | \ \/ / _ \ \
| | | |_| |\ / (_) _____ | |
| | | _ |/ \ _ |_____| | |
|_| |_| |_/_/\_\ (_) | |
/_/
0 new messages