Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 699364 - dev-tcltk/blt-2.4z-r13: shipped demos segfault with tcl/tk 8.6
Summary: dev-tcltk/blt-2.4z-r13: shipped demos segfault with tcl/tk 8.6
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: TCL/TK Project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-11-05 10:17 UTC by Fabio Rossi
Modified: 2021-04-25 14:03 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Fabio Rossi 2019-11-05 10:17:59 UTC
The demos shipped with the blt package seem to fail when running against tcl/tk 8.6

For instance:

$ bltwish barchart1.tcl 
Segmentation fault

$ gdb bltwish
GNU gdb (Gentoo 8.3 vanilla) 8.3
Copyright (C) 2019 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-pc-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://bugs.gentoo.org/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from bltwish...
Reading symbols from /usr/lib/debug//usr/bin/bltwish.debug...
(gdb) run barchart1.tcl
Starting program: /usr/bin/bltwish barchart1.tcl
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
[New Thread 0x7fffe972e700 (LWP 2363)]

Thread 1 "bltwish" received signal SIGSEGV, Segmentation fault.
DisplayText (clientData=0x5555557a66c0) at bltHtext.c:3368
3368		    offset = htPtr->lineArr[i].offset;
(gdb) bt
#0  DisplayText (clientData=0x5555557a66c0) at bltHtext.c:3368
#1  0x00007ffff7964ee6 in TclServiceIdle ()
    at /var/tmp/portage/dev-lang/tcl-8.6.8/work/tcl8.6.8/generic/tclTimer.c:751
#2  0x00007ffff794414c in Tcl_DoOneEvent (flags=-3)
    at /var/tmp/portage/dev-lang/tcl-8.6.8/work/tcl8.6.8/generic/tclNotify.c:980
#3  0x00007ffff7c3ace2 in Tk_MainLoop ()
    at /var/tmp/portage/dev-lang/tk-8.6.8/work/tk8.6.8/unix-abi_x86_64.amd64/../generic/tkEvent.c:2148
#4  0x00007ffff7c497fb in Tk_MainEx (argc=<optimized out>, argv=0x7fffffffd1b8, 
    appInitProc=0x555555586d6a <Tcl_AppInit>, interp=0x5555556d1070)
    at /var/tmp/portage/dev-lang/tk-8.6.8/work/tk8.6.8/unix-abi_x86_64.amd64/../generic/tkMain.c:390
#5  0x0000555555586d63 in main (argc=2, argv=0x7fffffffd1a8) at ./bltUnixMain.c:99
(gdb) 


It seems that a similar problem with other distributions has been already solved, e.g. look at the debian bug report in https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=753476

I am not a tcl expert/developer but only a final user of scripts shipped with other packages. Furthermore as the blt package in portage is customized and patched downstream to support tcl/tk 8.6 I don't know enough details to further help tracking down the problem :-(
Comment 1 Tupone Alfredo gentoo-dev 2019-11-08 07:45:07 UTC
I'm retiring this package.

Unless some one provide a working ebuild, it is gone in 30 days

# Alfredo Tupone <tupone@gentoo.org> (2019-11-08)
# Does not work with tcl/tk 8.6 without upstream
# Removal in 30 days.
dev-tcltk/blt
Comment 2 Fabio Rossi 2019-11-08 08:56:39 UTC
Looking here https://wiki.tcl-lang.org/page/BLT it seems there are three unofficial ports to tcl-8.6, I should see what is available in the debian repositories and maybe align on that. What do you think? I am not a direct user of the package but is needed for other packages like ngspice[tcl]
Comment 3 Tupone Alfredo gentoo-dev 2019-11-08 09:51:44 UTC
The last rite has been removed.

However I tested BLT-2.5. It is not 8.6 compatible. I made it work and some demo actually work, but other segfault.

e.g bltwish barchart1.tcl work but barchart2.tcl segfault

I saw the freebsd port but patching is quite heavy.

Other I have not tested.
Comment 4 Fabio Rossi 2019-11-08 11:28:51 UTC
I would suggest to follow the patches of other distribution where there is someone working actively to keep alive the package. 

Otherwise we can decide to follow a fork, it seems tkblt is quite updated (last release is 23 Oct 2019 as available here https://sourceforge.net/projects/tkblt/files/) and they claim it is "a derived version of the BLT Toolkit, Tcl/Tk 8.5/8.6 TEA compatible". This last option requires of course a compatibility check of all packages in portage that need blt, here is a list:

$ equery d -a dev-tcltk/blt
 * These packages depend on dev-tcltk/blt:
dev-lang/python-2.7.9-r1 (tk ? dev-tcltk/blt)
dev-lang/python-2.7.9-r2 (tk ? dev-tcltk/blt)
dev-lang/python-2.7.10 (tk ? dev-tcltk/blt)
dev-lang/python-2.7.10-r1 (tk ? dev-tcltk/blt)
dev-lang/python-2.7.15 (tk ? dev-tcltk/blt:0)
dev-lang/python-2.7.16 (tk ? dev-tcltk/blt:0)
dev-lang/python-3.3.5-r1 (tk ? dev-tcltk/blt)
dev-lang/python-3.4.0 (tk ? dev-tcltk/blt)
dev-lang/python-3.4.1 (tk ? dev-tcltk/blt)
dev-lang/python-3.4.2 (tk ? dev-tcltk/blt)
dev-lang/python-3.4.3 (tk ? dev-tcltk/blt)
dev-lang/python-3.4.3-r1 (tk ? dev-tcltk/blt)
dev-lang/python-3.5.5 (tk ? dev-tcltk/blt:0)
dev-lang/python-3.5.7 (tk ? dev-tcltk/blt:0)
dev-lang/python-3.6.5 (tk ? dev-tcltk/blt:0)
dev-lang/python-3.6.8 (tk ? dev-tcltk/blt:0)
dev-lang/python-3.6.9 (tk ? dev-tcltk/blt:0)
dev-lang/python-3.7.2 (tk ? dev-tcltk/blt:0)
dev-lang/python-3.7.3 (tk ? dev-tcltk/blt:0)
dev-lang/python-3.7.4-r1 (tk ? dev-tcltk/blt:0)
dev-lang/python-3.7.5 (tk ? dev-tcltk/blt:0)
dev-lang/python-3.7.5-r1 (tk ? dev-tcltk/blt:0)
sci-astronomy/skycat-3.1.2-r2 (>=dev-tcltk/blt-2.4)
sci-astronomy/skycat-3.1.3 (dev-tcltk/blt)
sci-chemistry/nmrpipe-8.7.2015.320.15.26 (dev-tcltk/blt)
sci-electronics/magic-7.5.202-r1 (dev-tcltk/blt)
sci-electronics/magic-7.5.231 (dev-tcltk/blt)
sci-electronics/magic-8.0.138 (dev-tcltk/blt)
sci-electronics/magic-8.0.207 (dev-tcltk/blt)
sci-electronics/ngspice-26 (tcl ? dev-tcltk/blt)
sci-electronics/ngspice-27 (tcl ? dev-tcltk/blt)
sci-electronics/ngspice-27 (tcl ? dev-tcltk/blt)
sci-electronics/ngspice-27-r1 (tcl ? dev-tcltk/blt)
sci-electronics/ngspice-27-r1 (tcl ? dev-tcltk/blt)
sci-electronics/ngspice-29 (tcl ? dev-tcltk/blt)
sci-electronics/ngspice-30 (tcl ? dev-tcltk/blt)
sci-electronics/ngspice-31 (tcl ? dev-tcltk/blt)
sci-electronics/ngspice-31 (tcl ? dev-tcltk/blt)
Comment 5 Tupone Alfredo gentoo-dev 2019-11-12 07:56:23 UTC
I have added the r14 with some fix.

Could you please check if there are some regression (hope no) and some fixes

TIA
Comment 6 Fabio Rossi 2019-11-12 13:46:48 UTC
(In reply to Tupone Alfredo from comment #5)
> I have added the r14 with some fix.
> 
> Could you please check if there are some regression (hope no) and some fixes
> 
> TIA

I have tried running all the demos in /usr/lib64/blt2.4/demos

Most demos now run but they exit with SEGFAULT after interacting with the mouse to zoom an area (i.e. clicking once, dragging the mouse to draw a rectangle and clicking again to finish the operation) or after pressing a button.

Here is a list of examples that doesn't run at all:

$ ./barchart2.tcl
Error in startup script: invalid command name ".header.stacked"
    while executing
".header.stacked invoke"
    (file "./barchart2.tcl" line 184)

$ ./barchart5.tcl
Error in startup script: can't read "graph": no such variable
    while executing
"$graph element create sin -relief raised -bd 1 -x x -y y  -barwidth $barWidth"
    (file "./barchart5.tcl" line 104)

$ ./graph2.tcl
Segmentation fault

$ ./graph5.tcl
Segmentation fault

$ ./graph7.tcl
Segmentation fault

$ ./spline.tcl
Segmentation fault

$ ./stripchart1.tcl
Segmentation fault

$ ./tabnotebook2.tcl
Segmentation fault

$ ./tabnotebook3.tcl
Segmentation fault

$ ./tabset2.tcl
Segmentation fault

$ ./tabset3.tcl
Segmentation fault



Here is a list of problems with other demos:

$ ./bgexec1.tcl
Segmentation fault when clicking on the quit button

$ ./bgexec2.tcl 

... it runs but when closing the window ...

NULL main window
    while executing
"table forget .l1"
    ("after" script)
invalid command name ".l5"
    while executing
".l$name2 configure -text "$var($name2)""
    (procedure "ShowResult" line 3)
    invoked from within
"ShowResult var 5 w"
    (write trace on "var(5)")
Error in startup script: can't invoke "label" command: application has been destroyed
    while executing
"label .l$i "
    ("for" body line 2)
    invoked from within
"for { set i 1 } { $i <= 20 } { incr i } {
    label .l$i 
    table . .l$i $i,0
    set pid [bgexec var($i) du /usr/include &]
    .l$i configure -tex..."
    (file "./bgexec2.tcl" line 37)

$ ./bgexec3.tcl
Segmentation fault when clicking on the quit button

$ ./bgexec4.tcl
Segmentation fault when clicking on the quit button

$ ./bitmap.tcl 
Segmentation fault when clicking one of the buttons

$ ./busy1.tcl 
Segmentation fault when clicking one of the buttons

$ ./busy2.tcl 
Segmentation fault when clicking on the Hold button

$ ./dnd2.tcl 
Segmentation fault when clicking on the Dismiss button

$ ./eps.tcl 
Segmentation fault when clicking on the buttons

$ ./graph1.tcl 
Segmentation fault when drawing rectangle for the zoom

$ ./graph3.tcl 
Segmentation fault when drawing rectangle for the zoom

$ ./graph4.tcl 
Segmentation fault when drawing rectangle for the zoom

$ ./graph6.tcl 
Segmentation fault when drawing rectangle for the zoom

$ ./hierbox2.tcl 
Segmentation fault when clicking on the buttons

$ ./hierbox4.tcl 
Segmentation fault when clicking on the Test button

$ ./hiertable1.tcl 
160 entries
Aborted

$ ./hiertable2.tcl 
160 entries
Aborted

$ ./treeview1.tcl 
159 entries
Error in startup script: can't find tag or id "c_files" in ".t"
    while executing
".t entry configure "c_files" -foreground green4"
    (file "./treeview1.tcl" line 181)
Comment 7 Tupone Alfredo gentoo-dev 2019-11-12 15:21:29 UTC
My primary concern was about "other packages like ngspice[tcl]", if at least the one you use works or not
Comment 8 Tupone Alfredo gentoo-dev 2021-01-04 09:17:29 UTC
I have added 2.5.3.

I have tested some demo. The situation should be better now.

Still some segfault but not so many
Comment 9 Fabio Rossi 2021-01-04 13:25:43 UTC
(In reply to Tupone Alfredo from comment #8)
> I have added 2.5.3.

Thanks! There is a bug in the ebuild which creates /usr/$(get_libdir)/blt2.4/demos/bitmaps instead of *blt2.5*

> I have tested some demo. The situation should be better now.
> 
> Still some segfault but not so many

I confirm the situation with the demos is definitely much better now, no more segfaults but other issues, e.g. some scripts return:

X Error of failed request:  BadMatch (invalid parameter attributes)
  Major opcode of failed request:  138 (RENDER)
  Minor opcode of failed request:  4 (RenderCreatePicture)
  Serial number of failed request:  130
  Current serial number in output stream:  135

which, in according to what is written in https://bugzilla.redhat.com/show_bug.cgi?id=504388, seems related to xft fonts management of blt.
Comment 10 Tupone Alfredo gentoo-dev 2021-01-04 15:46:30 UTC
I have fixed the bug with demos installed under blt2.4
Comment 11 Tupone Alfredo gentoo-dev 2021-04-25 14:03:32 UTC
blt-2.4z version is removed from the tree