Bug 468357 - tkimg crashes when creating png images
Summary: tkimg crashes when creating png images
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: tkimg
Version: 9
Hardware: All
OS: Linux
medium
high
Target Milestone: ---
Assignee: Sergio Pascual
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2008-10-24 10:33 UTC by Takanori MATSUURA
Modified: 2009-02-07 22:21 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-02-07 22:21:18 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Takanori MATSUURA 2008-10-24 10:33:11 UTC
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 20:49:02 UTC
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 13:44:45 UTC
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 18:59:51 UTC
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 08:40:44 UTC
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 18:52:58 UTC
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 08:30:34 UTC
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 08:33:18 UTC
I have reverted the system patches. Please test this new rpm

Comment 8 Takanori MATSUURA 2009-01-21 09:09:13 UTC
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 21:29:22 UTC
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 22:21:15 UTC
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.