Skip Menu |

This queue is for tickets about the Tcl-pTk CPAN distribution.

Report information
The Basics
Id: 128803
Status: open
Priority: 0/
Queue: Tcl-pTk

People
Owner: CAC [...] cpan.org
Requestors: SREZIC [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 0.96
Fixed in: (no value)



Subject: t/photo.t: segmentation faults on ubuntu 16.04
t/photo.t fails (add dies additionally with an segmentation fault) on my ubuntu 16.04 smokers: ... # Test 63 got: "unfinalized data stream in PNG data at /home/cpansand/.cpan/build/2019030406/Tcl-pTk-0.96-1/blib/lib/Tcl/pTk/Widget.pm line 332.\n" (t/photo.t at line 101 fail #2) # Expected: "" ( load unfinalized data stream in PNG data at /home/cpansand/.cpan/build/2019030406/Tcl-pTk-0.96-1/blib/lib/Tcl/pTk/Widget.pm line 332. #) # t/photo.t line 101 is: ok($@,''," load $@"); # Test 64 got: "" (t/photo.t at line 102 fail #2) # Expected: "1" (Could not load t/test.png) # t/photo.t line 102 is: ok(defined($new),1,"Could not load $f"); Can't call method "cget" on an undefined value at t/photo.t line 106. t/photo.t ..................... Dubious, test returned 11 (wstat 2816, 0xb00) Failed 22/84 subtests (less 51 skipped subtests: 11 okay) ... Test Summary Report ------------------- ... t/photo.t (Wstat: 2816 Tests: 64 Failed: 2) Failed tests: 63-64 Non-zero exit status: 11 Parse errors: Bad plan. You planned 84 tests but ran 64.
Hi Slaven, thanks for reporting this.

I would first like to confirm the Tcl/Tk patchlevel in use (maybe the tests should print this). Current Tcl/Tk on Ubuntu 16.04 appears to be 8.6.5.

Since the tkImg extension (libtk-img 1.4.2) is not installed, the test is using Tk 8.6's built-in PNG support—which is where the unfinalized data stream in PNG data error comes from. I can't tell yet if it is silently converting Xcamel.gif to a "bad" PNG file at t/photo.t line 95, or not recognizing a "good" file at line 100, so I would be interested in recovering the t/test.png for the test that fails. Though it might be better if this test could continue despite this error.

You might want to run the test manually with perl -d to get a stack trace saying where exactly the segmentation fault is happening.

Attached is the output t/test.png I got from Tk 8.6.9 using the built-in PNG support (not tkImg).

Subject: test.png
Download test.png
image/png 4.3k
test.png
On 2019-03-10 10:49:43, CAC wrote: Show quoted text
> Hi Slaven, thanks for reporting this. > > I would first like to confirm the Tcl/Tk patchlevel in use (maybe the > tests > should print this). Current Tcl/Tk on Ubuntu 16.04 appears to be > 8.6.5.
The version I have installed is 8.6.0+9 However this seems to be the latest version available for my system (xenial, xenial-updates and xenial-security repositories are included here). Show quoted text
> > Since the tkImg extension (libtk-img 1.4.2) is not installed, the test > is using > Tk 8.6's built-in PNG support—which is where the unfinalized data > stream in PNG > data error comes from. I can't tell yet if it is silently converting > Xcamel.gif > to a "bad" PNG file at t/photo.t line 95,
I loaded t/test.png into eog, and it says "Fatal error reading PNG image file: Not enough compressed data". Show quoted text
> or not recognizing a "good" > file at > line 100, so I would be interested in recovering the t/test.png for > the test > that fails. Though it might be better if this test could continue > despite this > error. > > You might want to run the test manually with perl -d to get a stack > trace > saying where exactly the segmentation fault is happening.
Actually it does not seem that a segmentation fault is happening. The exit status is indeed 11, but after rotating $? --- if it was without rotating, then it would be a segmentation fault. So it's just a normal test failure. Show quoted text
> > Attached is the output t/test.png I got from Tk 8.6.9 using the built- > in PNG > support (not tkImg).
On 2019-03-10 12:13:33, SREZIC wrote: Show quoted text
> On 2019-03-10 10:49:43, CAC wrote:
> > Hi Slaven, thanks for reporting this. > > > > I would first like to confirm the Tcl/Tk patchlevel in use (maybe the > > tests > > should print this). Current Tcl/Tk on Ubuntu 16.04 appears to be > > 8.6.5.
> > The version I have installed is 8.6.0+9 > > However this seems to be the latest version available for my system > (xenial, xenial-updates and xenial-security repositories are included > here).
Well, this is the version for the tk and tcl packages (which are maybe some kind of virtual or meta packages?). There are also packages tk86 and tcl86 installed: * tcl8.6: 8.6.5+dfsg-2 * tk8.6: 8.6.5-1
Yes, the `tcl` and `tk` packages are for requesting that some default Tcl/Tk version be installed, while each major version (8.4, 8.5, 8.6, 8.7, ) gets its own packages and can be installed simultaneously.

When in doubt, asking tclsh `info patchlevel` should get what we want, though there is a chance distribution packages have applied some patches.

Also, I notice 
this test failed for one of your Debian 8 (jessie) testers, which I would guess is using Tcl/Tk 8.6.2.
On 2019-03-10 17:30:05, CAC wrote: Show quoted text
> Yes, the `tcl` and `tk` packages are for requesting that some default > Tcl/Tk > version be installed, while each major version (8.4, 8.5, 8.6, 8.7, …) > gets its > own packages and can be installed simultaneously. > > When in doubt, asking tclsh `info patchlevel` should get what we want, > though > there is a chance distribution packages have applied some patches. > > Also, I notice this test failed for one of your Debian 8 (jessie) > testers, > which I would guess is using Tcl/Tk 8.6.2.
I think you refer to http://www.cpantesters.org/cpan/report/4d6a09a4-433f-11e9-ab17-674b1f24ea8f This is also on Ubuntu 16.04, using the system perl, which has a misleading kernel version compiled in: $ lsb_release -cs; perl -V:myuname xenial myuname='linux localhost 3.16.0 #1 smp debian 3.16.0 x86_64 gnulinux ';
On Sun Mar 10 17:45:56 2019, SREZIC wrote:
Show quoted text
> On 2019-03-10 17:30:05, CAC wrote:
> > Yes, the `tcl` and `tk` packages are for requesting that some default
> > Tcl/Tk
> > version be installed, while each major version (8.4, 8.5, 8.6, 8.7,
> > …)
> > gets its
> > own packages and can be installed simultaneously.
> >
> > When in doubt, asking tclsh `info patchlevel` should get what we
> > want,
> > though
> > there is a chance distribution packages have applied some patches.
> >
> > Also, I notice this test failed for one of your Debian 8 (jessie)
> > testers,
> > which I would guess is using Tcl/Tk 8.6.2.
>
> I think you refer to http://www.cpantesters.org/cpan/report/4d6a09a4-
> 433f-11e9-ab17-674b1f24ea8f
>
> This is also on Ubuntu 16.04, using the system perl, which has a
> misleading kernel version compiled in:
>
> $ lsb_release -cs; perl -V:myuname
> xenial
> myuname='linux localhost 3.16.0 #1 smp debian 3.16.0 x86_64 gnulinux
> ';

Ahh, that makes sense especially for non-self-compiled Perls. So I shouldn't assume that the OS version in a report is what the test was run under. Though for some reports the "OS version" column in cpantesters.org/distro/… lists something different than the actual report.
I've now encountered a very similar error for the TIFF format on Ubuntu 18.04.2 i686 (32-bit), using Ubuntu-provided Perl 5.26.1, Tcl/Tk 8.6.8, TkImg 1.4.7, and libtiff5 4.0.9. (This happens even after borrowing TkImg 1.4.8 or libtiff5 4.0.10 from Debian 10 buster.)

I notice that line 106, where the fatal error is, sets an unused variable $width. I have now removed it to allow the test proceed with remaining test cases and avoid the "Bad plan" message in the test report: 
https://github.com/chrstphrchvz/perl-tcl-ptk/commit/91d54ed
I was able to reproduce the bad PNG output from a Lubuntu 16.04.6 amd64 Live CD, using tcl8.6 8.6.5+dsfg-2 and tk8.6 8.6.5-1. This is a Tcl/Tk bug, since I can reproduce it with Tcl syntax:

package require Tk
# not doing `package require Img`--use PNG support included in Tk
 
image create photo icon -file "Xcamel.gif" -format gif
button .b -image icon
pack .b
 
icon write "Xcamel.png" -format png
 
# the following line will fail with "unfinalized data stream in PNG data"
image create photo icon2 -file "Xcamel.png" -format png
button .b2 -image icon2
pack .b2

I could not reproduce this issue in more recent Ubuntu versions, so I suspect the issue was resolved by the more recent versions of Tcl/Tk they contain. Indeed, I notice that the release notes for Tcl/Tk 8.6.7 mention a "PNG writing" issue having been addressed. I believe upstream Tk ticket is https://core.tcl-lang.org/tk/tktview/10f2e7872b ; that issue turned out to be caused by a Tcl bug, ticket: https://core.tcl-lang.org/tcl/tktview/b26e38a3e4

I have filed a bug against the tk8.6 package in Ubuntu, in case they want to address this issue for 16.04: https://bugs.launchpad.net/ubuntu/+source/tk8.6/+bug/1834314