[New-bugs-announce] [issue22770] test_ttk_guionly and test_tk can cause Tk segfaults on OS X when run with regrtest -j option

Ned Deily report at bugs.python.org
Fri Oct 31 00:05:44 CET 2014


New submission from Ned Deily:

The changes to tkinter tests introduced by the changes for Issue22236 (2.7 32fdaf401e50, 3.4 dd1dffe6f0d2, and default/3.5 014060738f7f) may cause Python to crash due to a Tk segfault on OS X.  The crash only shows up when using the -j option to regrtest and is dependent on other factors, e.g. 64-bit vs 32-bit and randomized address space allocations, so it is not 100% reproducible.  But it happens often enough (to me) when running the Python test suite from an installed framework location with a current Cocoa Tk 8.5.x or 8.6.x, for example, with an instance from a python.org binary installer:

    /usr/local/bin/python3.4 -m test -w -uall -j3

The reasons for the segfault are due to an arcane bug in Tk which shows up when Tcl interpreter instances are destroyed and created within the execution of an OS X app bundle, behavior which now happens as a result of the above changes when -j > 0 is used in an OS X framework build.  There is a more detailed analysis in the Tk bug I've opened:

    https://core.tcl.tk/tk/tktview?name=c18c36f80c

The bug is not one that most Tk users would run into, I think, so it's certainly not a critical bug in Tk.  But it is annoying to run into when running Python tests.  On the other hand, I'm not sure that it is worth trying to work around the problem in the tests; I think the basic idea of the Issue22236 changes is sound.

There is a relatively easy workaround if one runs into the problem: exclude the two problematic Tk tests and run them separately sequentially.

    pythonx.y -m test -w -uall -j3 -x test_tk test_ttk_guionly
    pythonx.y -m test -w -uall        test_tk test_ttk_guionly

(-m test.regrtest for Python 2.7.x)

It may be sufficient to just document the workaround here in case others run into it.

----------
components: Tests, Tkinter
messages: 230307
nosy: ned.deily, serhiy.storchaka
priority: normal
severity: normal
status: open
title: test_ttk_guionly and test_tk can cause Tk segfaults on OS X when run with regrtest -j option
versions: Python 2.7, Python 3.4, Python 3.5

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue22770>
_______________________________________


More information about the New-bugs-announce mailing list