Tk Source Code

View Ticket
Login
Bounty program for improvements to Tcl and certain Tcl packages.
2017-09-16
09:04 Closed ticket [607ffb05]: Segmentation fault on image zoom wish large factor plus 6 other changes artifact: e0ce6d71 user: fvogel
2015-12-28
00:30 Ticket [607ffb05]: 3 changes artifact: 6a3cd009 user: aspect
2015-12-27
16:33 New ticket [607ffb05]. artifact: 53edf34b user: storchaka

Ticket UUID: 607ffb053c783490692916bdd131d962db606528
Title: Segmentation fault on image zoom wish large factor
Type: Bug Version:
Submitter: storchaka Created on: 2015-12-27 16:33:39
Subsystem: 41. Photo Images Assigned To: nobody
Priority: 5 Medium Severity: Important
Status: Closed Last Modified: 2017-09-16 09:04:30
Resolution: Fixed Closed By: fvogel
    Closed on: 2017-09-16 09:04:30
Description:
This bug was originally reported on Python tracker [http://bugs.python.org/issue25959].

When zoom large image with large factors, Tk crashes. Example:

    image create photo src -format gif -width 1000 -heigh 681
    image create photo dst
    dst copy src -zoom 54 44

I can't reproduce the crash on my computer (it has no enough memory and becomes swapping), but there are some backtraces on Python tracker:

(gdb) run test2.py
Starting program: /usr/bin/python test2.py
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7ffff47ca700 (LWP 14639)]

Program received signal SIGSEGV, Segmentation fault.
memset () at ../sysdeps/x86_64/memset.S:80
80	../sysdeps/x86_64/memset.S: No such file or directory.
(gdb) backtrace
#0  memset () at ../sysdeps/x86_64/memset.S:80
#1  0x00007ffff66ce4ad in ?? () from /usr/lib/x86_64-linux-gnu/libtk8.6.so
#2  0x00007ffff66cffab in Tk_PhotoPutZoomedBlock ()
   from /usr/lib/x86_64-linux-gnu/libtk8.6.so
#3  0x00007ffff66cc12b in ?? () from /usr/lib/x86_64-linux-gnu/libtk8.6.so
#4  0x00007ffff62c8337 in TclNRRunCallbacks ()
   from /usr/lib/x86_64-linux-gnu/libtcl8.6.so
#5  0x00007ffff6982030 in ?? () from /usr/lib/python2.7/lib-dynload/_tkinter.so
#6  0x000000000049968d in PyEval_EvalFrameEx ()
#7  0x00000000004a090c in PyEval_EvalCodeEx ()
#8  0x0000000000499a52 in PyEval_EvalFrameEx ()
#9  0x00000000004a1634 in ?? ()
#10 0x000000000044e4a5 in PyRun_FileExFlags ()
#11 0x000000000044ec9f in PyRun_SimpleFileExFlags ()
#12 0x000000000044f904 in Py_Main ()
#13 0x00007ffff7818ec5 in __libc_start_main (main=0x44f9c2 <main>, argc=2, 
    argv=0x7fffffffe0b8, init=<optimized out>, fini=<optimized out>, 
    rtld_fini=<optimized out>, stack_end=0x7fffffffe0a8) at libc-start.c:287
#14 0x0000000000578c4e in _start ()
---------------------------------------

Starting program: /usr/bin/python gui.py
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7ffff435d700 (LWP 10798)]

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff64ba07b in Tk_PhotoPutZoomedBlock ()
   from /usr/lib/x86_64-linux-gnu/libtk8.6.so
(gdb) backtrace
#0  0x00007ffff64ba07b in Tk_PhotoPutZoomedBlock ()
   from /usr/lib/x86_64-linux-gnu/libtk8.6.so
#1  0x00007ffff64b6171 in ?? () from /usr/lib/x86_64-linux-gnu/libtk8.6.so
#2  0x00007ffff6092a87 in TclNRRunCallbacks ()
   from /usr/lib/x86_64-linux-gnu/libtcl8.6.so
#3  0x00007ffff6ae53c0 in ?? () from /usr/lib/python2.7/lib-dynload/_tkinter.so
#4  0x00000000004c9e05 in PyEval_EvalFrameEx ()
#5  0x00000000004c87a1 in PyEval_EvalCodeEx ()
#6  0x00000000004ca31a in PyEval_EvalFrameEx ()
#7  0x00000000004c87a1 in PyEval_EvalCodeEx ()
#8  0x00000000004ca31a in PyEval_EvalFrameEx ()
#9  0x00000000004ca592 in PyEval_EvalFrameEx ()
#10 0x00000000004ca592 in PyEval_EvalFrameEx ()
#11 0x00000000004ca592 in PyEval_EvalFrameEx ()
#12 0x00000000004e5fe8 in ?? ()
#13 0x00000000005045d8 in ?? ()
#14 0x00000000004eb950 in PyInstance_New ()
#15 0x00000000004caaa1 in PyEval_EvalFrameEx ()
#16 0x00000000004c87a1 in PyEval_EvalCodeEx ()
#17 0x00000000005030ef in ?? ()
#18 0x00000000004f8c72 in PyRun_FileExFlags ()
#19 0x00000000004f7d77 in PyRun_SimpleFileExFlags ()
#20 0x00000000004982f2 in Py_Main ()
---Type <return> to continue, or q <return> to quit---
#21 0x00007ffff6f14b45 in __libc_start_main (main=0x497d80 <main>, argc=2, 
    argv=0x7fffffffe3b8, init=<optimized out>, fini=<optimized out>, 
    rtld_fini=<optimized out>, stack_end=0x7fffffffe3a8) at libc-start.c:287
#22 0x0000000000497ca0 in _start ()
User Comments: fvogel added on 2017-09-16 09:04:30:
Confirmed. I can't reproduce any crash, at least in:

- core-8-5-branch, core-8-6-branch and trunk on Windows

- core-8-6-branch on Linux

aspect added on 2015-12-28 00:30:33:
I can reproduce this crash on 8.5.18 and 8.6.4, but it appears to be fixed in trunk:  "not enough free memory for image buffer".

Timeline for generic/tkImgPhoto.c suggests [dece6313] as likely origin of the fix.