Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change _tkinter initialization for new versions of Aqua Tk on OS X #49370

Closed
gpolo mannequin opened this issue Jan 31, 2009 · 19 comments
Closed

Change _tkinter initialization for new versions of Aqua Tk on OS X #49370

gpolo mannequin opened this issue Jan 31, 2009 · 19 comments
Assignees

Comments

@gpolo
Copy link
Mannequin

gpolo mannequin commented Jan 31, 2009

BPO 5120
Nosy @terryjreedy, @ronaldoussoren, @ned-deily, @bitdancer
Files
  • oldtkaqua.diff
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = 'https://github.com/ronaldoussoren'
    closed_at = None
    created_at = <Date 2009-01-31.21:25:49.208>
    labels = ['expert-tkinter']
    title = 'Change _tkinter initialization for new versions of Aqua Tk on OS X'
    updated_at = <Date 2021-10-21.22:28:14.811>
    user = 'https://bugs.python.org/gpolo'

    bugs.python.org fields:

    activity = <Date 2021-10-21.22:28:14.811>
    actor = 'vstinner'
    assignee = 'ronaldoussoren'
    closed = False
    closed_date = None
    closer = None
    components = ['Tkinter']
    creation = <Date 2009-01-31.21:25:49.208>
    creator = 'gpolo'
    dependencies = []
    files = ['13000']
    hgrepos = []
    issue_num = 5120
    keywords = ['patch']
    message_count = 18.0
    messages = ['80884', '80887', '80927', '81468', '91464', '92924', '92925', '111071', '111170', '111266', '119318', '133000', '133001', '139517', '139530', '193528', '404641', '404642']
    nosy_count = 5.0
    nosy_names = ['terry.reedy', 'ronaldoussoren', 'gpolo', 'ned.deily', 'r.david.murray']
    pr_nums = []
    priority = 'normal'
    resolution = None
    stage = 'patch review'
    status = 'open'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue5120'
    versions = ['Python 3.3', 'Python 3.4']

    @gpolo
    Copy link
    Mannequin Author

    gpolo mannequin commented Jan 31, 2009

    For some reason the recently added test_ttk_guionly is causing Tcl to
    abort on Mac. I would prefer to disable the test for now, except if some
    mac owner has the time to fix it.

    I would like to know the tcl version being used on the noller-osx86
    buildslave too, if possible.

    @gpolo gpolo mannequin added type-crash A hard crash of the interpreter, possibly with a core dump topic-tkinter labels Jan 31, 2009
    @gpolo
    Copy link
    Mannequin Author

    gpolo mannequin commented Jan 31, 2009

    For some reason the recently added test_ttk_guionly is causing Tcl to
    abort on Mac. I would prefer to disable the test for now, except if some
    mac owner has the time to fix it.

    Just saw it didn't cause an abort with the buildslave heller-x86-osx5, btw.

    @gpolo
    Copy link
    Mannequin Author

    gpolo mannequin commented Feb 2, 2009

    It seems to be good now after a recent modification in how tests are
    performed, closing. Sorry for the fuss.

    @gpolo gpolo mannequin closed this as completed Feb 2, 2009
    @gpolo
    Copy link
    Mannequin Author

    gpolo mannequin commented Feb 9, 2009

    The abort still happens occasionally, see:
    http://www.python.org/dev/buildbot/all/OS%20X%20x86%20trunk/builds/118/step-test/0
    (last lines)

    I've talked with Daniel Steffen, who is one of the maintainers of Tcl/Tk
    on Mac OSX, and I was told that all this conditional code in _tkinter.c
    and tkappinit.c for TK_AQUA is outdated starting with tk 8.4.8, but tk
    8.4.7 that ships with macosx (which happens to be the version being used
    by the buildslave mentioned above) also includes the patch that
    deprecates the usage, and we should be calling only Tk_Init on
    tkappinit.c which will deal with all the details (the details are in
    tkMacOSXInit:TkpInit).

    There is an entry in tk's changelog that is directly related to this:
    http://tktoolkit.cvs.sourceforge.net/viewvc/tktoolkit/tk/ChangeLog.2004?revision=1.1&view=markup
    (lines 210-220)

    Any chance I can change _tkinter and tkappinit to check for
    TKINTER_OLD_AQUA (new macro to be added) instead of TK_AQUA and verify
    if it helps the buildslaves ?

    @gpolo gpolo mannequin reopened this Feb 9, 2009
    @bitdancer
    Copy link
    Member

    To follow up your question posted on bpo-6527 (sorry for the
    duplicate), I don't currently have a mac to test on. I might have
    access to one in a couple weeks, though.

    @ned-deily
    Copy link
    Member

    I noticed this while investigating bpo-6834. Is this still an open issue
    for OS X? Could it explain the symptoms in 6834?

    @ned-deily
    Copy link
    Member

    Sorry, that should be bpo-6864.

    @BreamoreBoy
    Copy link
    Mannequin

    BreamoreBoy mannequin commented Jul 21, 2010

    Is this still a problem on OS X?

    @ronaldoussoren
    Copy link
    Contributor

    Mark: maybe, why don't you test this?

    @ronaldoussoren ronaldoussoren self-assigned this Jul 22, 2010
    @ronaldoussoren
    Copy link
    Contributor

    This is still an issue for the PPC Tiger buildbot:

    test_ttk_guionly
    make: *** [buildbottest] Segmentation fault

    (Direct link: http://www.python.org/dev/buildbot/builders/PPC%20Tiger%202.7/builds/39/steps/test/logs/stdio)

    @bitdancer
    Copy link
    Member

    Presumably this is the same bpo-8716. That issue contains additional details and a patch from Ronald, so I'm not closing it as a duplicate.

    I don't know if the patch on this issue would actually address the issue. I tried to apply it to py3k but it did not apply cleanly.

    @vstinner
    Copy link
    Member

    vstinner commented Apr 5, 2011

    Recent crash on "PPC Tiger 3.x":
    ----------------
    [188/354] test_ttk_guionly
    Fatal Python error: Segmentation fault

    Traceback (most recent call first):
      File "/Users/buildbot/buildarea/3.x.parc-tiger-1/build/Lib/tkinter/ttk.py", line 47 in _load_tile
      File "/Users/buildbot/buildarea/3.x.parc-tiger-1/build/Lib/tkinter/ttk.py", line 559 in __init__
      File "/Users/buildbot/buildarea/3.x.parc-tiger-1/build/Lib/tkinter/ttk.py", line 614 in __init__
      File "/Users/buildbot/buildarea/3.x.parc-tiger-1/build/Lib/test/test_ttk_guionly.py", line 14 in <module>
      File "/Users/buildbot/buildarea/3.x.parc-tiger-1/build/Lib/importlib/_bootstrap.py", line 342 in _load_module
      File "/Users/buildbot/buildarea/3.x.parc-tiger-1/build/Lib/importlib/_bootstrap.py", line 141 in decorated
      File "/Users/buildbot/buildarea/3.x.parc-tiger-1/build/Lib/importlib/_bootstrap.py", line 437 in load_module
      File "./Lib/test/regrtest.py", line 1025 in runtest_inner
      File "./Lib/test/regrtest.py", line 826 in runtest
      File "./Lib/test/regrtest.py", line 650 in main
      File "./Lib/test/regrtest.py", line 1607 in <module>
    make: *** [buildbottest] Segmentation fault
    program finished with exit code 2
    elapsedTime=1656.072954

    http://www.python.org/dev/buildbot/all/builders/PPC%20Tiger%203.x/builds/1701/steps/test/logs/stdio

    @vstinner
    Copy link
    Member

    vstinner commented Apr 5, 2011

    ttk_guionly creates a button (ttk.Button()) which calls _load_tile(), which crashs on: master.tk.eval('package require tile')

    Code of the function:
    -------------------------

    def _load_tile(master):
        if _REQUIRE_TILE:
            import os
            tilelib = os.environ.get('TILE_LIBRARY')
            if tilelib:
                # append custom tile path to the the list of directories that
                # Tcl uses when attempting to resolve packages with the package
                # command
                master.tk.eval(
                        'global auto_path; '
                        'lappend auto_path {%s}' % tilelib)
    
            master.tk.eval('package require tile') # TclError may be raised here
            master._tile_loaded = True

    @vstinner
    Copy link
    Member

    Still crashing on "PPC Tiger 3.x" buildbot:
    ----------------
    ...
    [333/356/2] test_ttk_guionly
    Fatal Python error: Segmentation fault

    Current thread 0xa000ed88:
    File "/Users/buildbot/buildarea/3.x.parc-tiger-1/build/Lib/tkinter/ttk.py", line 47 in _load_tile
    File "/Users/buildbot/buildarea/3.x.parc-tiger-1/build/Lib/tkinter/ttk.py", line 559 in __init__
    File "/Users/buildbot/buildarea/3.x.parc-tiger-1/build/Lib/tkinter/ttk.py", line 614 in __init__
    File "/Users/buildbot/buildarea/3.x.parc-tiger-1/build/Lib/test/test_ttk_guionly.py", line 14 in <module>
    File "/Users/buildbot/buildarea/3.x.parc-tiger-1/build/Lib/importlib/_bootstrap.py", line 342 in _load_module
    File "/Users/buildbot/buildarea/3.x.parc-tiger-1/build/Lib/importlib/_bootstrap.py", line 141 in decorated
    File "/Users/buildbot/buildarea/3.x.parc-tiger-1/build/Lib/importlib/_bootstrap.py", line 437 in load_module
    File "./Lib/test/regrtest.py", line 1063 in runtest_inner
    File "./Lib/test/regrtest.py", line 861 in runtest
    File "./Lib/test/regrtest.py", line 669 in main
    File "./Lib/test/regrtest.py", line 1648 in <module>
    make: *** [buildbottest] Segmentation fault
    ----------------

    http://www.python.org/dev/buildbot/all/builders/PPC%20Tiger%203.x/builds/2109/steps/test/logs/stdio

    Can anyone with a Mac look at this issue?

    @ned-deily
    Copy link
    Member

    See comments to bpo-8716. Suggest any further comments on the "headless" crash issue go there and reserve this issue for investigation into the suggested changes to initialization when using Aqua Tk. BTW, the supplied patch has compile time Tk version tests which can be problematic since Aqua Tk is dynamically linked and so the exact patch version cannot be determined at compile time. However, since 8.4.7 is the earliest version we claim to support we could probably dispense with the check, assuming the change is warranted.

    @ned-deily ned-deily changed the title Disabling test_ttk_guionly on mac Change _tkinter initialization for new versions of Aqua Tk on OS X Jun 30, 2011
    @ned-deily ned-deily removed the type-crash A hard crash of the interpreter, possibly with a core dump label Jun 30, 2011
    @ronaldoussoren
    Copy link
    Contributor

    As mentioned by Ned this is a duplicate of bpo-8716.

    The proposed change to tkinter initialization in msg81468 might be useful to look into, but I'm not interested in doing that work because I don't use Tkinter myself which makes it harder to test if the change actually helps.

    FWIW, the patch looks sane for what it is trying to accomplish.

    NOTE: If the Tk version in OSX 10.4 is new enough to not need the workaround that will be disabled by the TKINTER_OLD_AQUA in the patch we could just drop the code.

    @terryjreedy
    Copy link
    Member

    Can we close this? I expect that if crashes were still happening from this cause, there would be a newer issue.

    @terryjreedy
    Copy link
    Member

    Or should this be marked for 3.11?

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    @zware
    Copy link
    Member

    zware commented Apr 14, 2023

    Looks well out of date to me.

    @zware zware closed this as not planned Won't fix, can't repro, duplicate, stale Apr 14, 2023
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Projects
    None yet
    Development

    No branches or pull requests

    6 participants