Skip to content

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

Description

@gpolo
mannequin
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']

    Activity

    1. gpolo commented on Jan 31, 2009

      gpolomannequin
      MannequinAuthor

      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.

    2. gpolo commented on Jan 31, 2009

      gpolomannequin
      MannequinAuthor

      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.

    3. gpolo commented on Feb 2, 2009

      gpolomannequin
      MannequinAuthor

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

    4. gpolo commented on Feb 9, 2009

      gpolomannequin
      MannequinAuthor

      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 ?

    5. reopened this on Feb 9, 2009
    6. bitdancer commented on Aug 10, 2009

      @bitdancer
      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.

    7. ned-deily commented on Sep 21, 2009

      @ned-deily
      Member

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

    8. ned-deily commented on Sep 21, 2009

      @ned-deily
      Member

      Sorry, that should be bpo-6864.

    9. BreamoreBoy commented on Jul 21, 2010

      BreamoreBoymannequin
      Mannequin

      Is this still a problem on OS X?

    10. ronaldoussoren commented on Jul 22, 2010

      @ronaldoussoren
      Contributor

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

    11. ronaldoussoren commented on Jul 23, 2010

      @ronaldoussoren
      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)

    12. bitdancer commented on Oct 21, 2010

      @bitdancer
      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.

    13. vstinner commented on Apr 5, 2011

      @vstinner
      Member

      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

    14. vstinner commented on Apr 5, 2011

      @vstinner
      Member

      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

    15. vstinner commented on Jun 30, 2011

      @vstinner
      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?

    16. ned-deily commented on Jun 30, 2011

      @ned-deily
      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.

    17. changed the title [-]Disabling test_ttk_guionly on mac[/-] [+]Change _tkinter initialization for new versions of Aqua Tk on OS X[/+] on Jun 30, 2011
    18. removed
      type-crashA hard crash of the interpreter, possibly with a core dump
      on Jun 30, 2011
    19. ronaldoussoren commented on Jul 22, 2013

      @ronaldoussoren
      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.

    20. terryjreedy commented on Oct 21, 2021

      @terryjreedy
      Member

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

    21. terryjreedy commented on Oct 21, 2021

      @terryjreedy
      Member

      Or should this be marked for 3.11?

    22. transferred this issue fromon Apr 10, 2022
    23. zware commented on Apr 14, 2023

      @zware
      Member

      Looks well out of date to me.

    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions