Bug 468357 - tkimg crashes when creating png images
tkimg crashes when creating png images
Status: CLOSED NEXTRELEASE
Product: Fedora
Classification: Fedora
Component: tkimg (Show other bugs)
9
All Linux
medium Severity high
: ---
: ---
Assigned To: Sergio Pascual
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2008-10-24 06:33 EDT by Takanori MATSUURA
Modified: 2009-02-07 17:21 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2009-02-07 17:21:18 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Takanori MATSUURA 2008-10-24 06:33:11 EDT
Description of problem:
The following test scripts (all.tcl) failed.
Some of them are core dumped or aborted.

1. install tkimg-1.30.10.20080505svn and tkimg-devel-1.30.10.20080505svn from yum repository
1. rpmbuild tkimg-1.3-0.10.20080505svn.fc9.src.rpm (rpm -i and rpmbuild -bp).
2. move to BUILD/tkimg-20080505
3. move to each tests directory
4. run "wish all.tcl"


ico/tests/all.tcl
==== ico-1.1  FAILED

pixmap/tests/all.tcl
==== bmp-1.1  FAILED
==== bmp-2.0 Binary I/O with BMP images FAILED
(after addinf folder.bmp from tests, all succeeded)

png/tests/all.tcl
segmentation fault

sgi/tests/all.tcl
==== sgi-1.1  FAILED
==== sgi-1.2  FAILED
==== sgi-1.3  FAILED
*** glibc detected *** wish: malloc(): memory corruption: 0x00000000009fff50 ***
Comment 1 Joe Krahn 2008-11-20 15:49:02 EST
I am getting segfaults from the same tkimg version for fc8, which seems likely to be caused buy the same problem. It can be reproduced with the following tclsh input:

package require img::png
image create photo ::img::spot_red_plus3x3 -data "iVBORw0KGgoAAAANSUhEUgAAAAMAAAADCAYAAABWKLW/AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH1gYdDTo2x0v3wwAAAB10RVh0Q29tbWVudABDcmVhdGVkIHdpdGggVGhlIEdJTVDvZCVuAAAAG0lEQVQI12NgYGBg+M/A8J+BgYGBEcaAA5gAAHzEBfwZ/LSpAAAAAElFTkSuQmCC"

It doesn't crash every time. When it does, it is crashing during a call to png_read_info() in libpng12.so. I tried switching to older versions of tkimg, and an older version of libpng, but still get the segfault. I can send more info, but hopefully the above example can reproduce the crash.
Comment 2 Sergio Pascual 2008-11-21 08:44:45 EST
Ok, I can reproduce the crash in f8 and f9, with tkimg-1.3 
The past week I submitted a new tkimg-1.4 for devel and f10 and it seems to crash too. :(

The rpm package is patched to use the system libraries instead of the libraries in the package. I will try recompile tkimg without the patches and see what happens
Comment 3 Joe Krahn 2008-11-22 13:59:51 EST
After my comment above, I tested the SRPM patched sources. It seems that the patches are the problem. However, I think using system libs is the right thing to do. Tkimg really should have a built-in option whether to include it's own libraries. It seems that Tkimg is not maintained much; it still uses K&R syntax.

My suggestion is to build new RPMs without the system-lib patch, and try to work on improving the Tkimg sources for a future release.
Comment 4 Sergio Pascual 2008-12-02 03:40:44 EST
The png driver uses two callbacks that aren't exported anymore by the dynamic png library, png_read_destroy and png_write_destroy. To allow the compilation I have removed them in pngtclDecls.h and pngtclStubInit.c 
I don't know, but this can be the reason of the crash. I will bug this upstream
Comment 5 Joe Krahn 2009-01-13 13:52:58 EST
Several other image formats have problems as well, even though PNG is the only one to segfault. I still think it is worth releasing a version without the system-lib patch until this gets worked out.
Comment 6 Fedora Update System 2009-01-21 03:30:34 EST
tkimg-1.4-0.2.20081115svn.fc10 has been submitted as an update for Fedora 10.
http://admin.fedoraproject.org/updates/tkimg-1.4-0.2.20081115svn.fc10
Comment 7 Sergio Pascual 2009-01-21 03:33:18 EST
I have reverted the system patches. Please test this new rpm
Comment 8 Takanori MATSUURA 2009-01-21 04:09:13 EST
pixmap/tests
(no test script exist)

sgi/tests/all.tcl
==== sgi-1.1  FAILED
==== sgi-1.2  FAILED
==== sgi-1.3  FAILED
==== sgi-1.4  FAILED

Other FAILED test in comment #1 returns no error.
I don't know test for sgi format should be passed on Linux platform.
Comment 9 Fedora Update System 2009-01-21 16:29:22 EST
tkimg-1.4-0.2.20081115svn.fc10 has been pushed to the Fedora 10 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update tkimg'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F10/FEDORA-2009-0764
Comment 10 Fedora Update System 2009-02-07 17:21:15 EST
tkimg-1.4-0.2.20081115svn.fc10 has been pushed to the Fedora 10 stable repository.  If problems still persist, please make note of it in this bug report.

Note You need to log in before you can comment on or make changes to this bug.