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

SIGABRT with python3 --with-tcl-tk #12808

Closed
jkl1337 opened this issue Apr 24, 2017 · 18 comments

Comments

Projects
None yet
@jkl1337
Copy link

commented Apr 24, 2017

Please always follow these steps:

To help us debug your issue please explain:

  • What you were trying to do (and why)
    • Install python3 that uses the homebrew tcl-tk (8.6)
  • What happened (include command output)
$ python3
Python 3.6.1 (default, Apr 23 2017, 19:58:06)
[GCC 4.2.1 Compatible Apple LLVM 8.1.0 (clang-802.0.41)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import tkinter
>>> tkinter.Tk()
Abort trap: 6
$ 
  • Step-by-step reproduction instructions (by running brew install commands)
$ brew install tcl-tk
$ brew install python3 --with-tcl-tk
$ python3 -c 'import tkinter; tkinter.Tk()'

A similar issue with python2 was opened in #12114, but the user closed it because they reinstalled python against the Apple provided Tcl/Tk, which doesn't resolve the issue.

@agentirons

This comment has been minimized.

Copy link

commented Apr 25, 2017

My open issue #12068 may be related, as I get a EXC_BAD_ACCESS (SIGSEGV) with python2 --with-tcl-tk trying to open files with IDLE. As with the other issue you mentioned, Apple's Tcl/Tk doesn't have the same behavior.

@dunn dunn added the python label Apr 29, 2017

@schiotz

This comment has been minimized.

Copy link

commented May 4, 2017

Please note that the Apple-provided Tcl/Tk is known to be slow and buggy (https://www.python.org/download/mac/tcltk/) so it would have real value to be able to build Python (both version 2 and 3) with either ActiveState's Tcl/Tk or Homebrew's.

@jeremy886

This comment has been minimized.

Copy link

commented May 23, 2017

Same problem for me. Looking for solutions.

% python3 -c 'import tkinter; tkinter.Tk()'
[1] 64587 abort python3 -c 'import tkinter; tkinter.Tk()'

@theli-ua

This comment has been minimized.

Copy link

commented Jun 6, 2017

not sure how helpfull but here is the backtrace

`(lldb) bt

  • thread #2, queue = 'com.apple.main-thread', stop reason = signal SIGABRT
    • frame #0: 0x00007fff93981d42 libsystem_kernel.dylib__pthread_kill + 10 frame #1: 0x00007fff93a6f5bf libsystem_pthread.dylibpthread_kill + 90
      frame #2: 0x00007fff938e7420 libsystem_c.dylibabort + 129 frame #3: 0x00007fff938e7592 libsystem_c.dylibabort_report_np + 181
      frame #4: 0x00007fff9390df28 libsystem_c.dylib__chk_fail + 48 frame #5: 0x00007fff9390def8 libsystem_c.dylib__chk_fail_overflow + 16
      frame #6: 0x00007fff9390e145 libsystem_c.dylib__strcpy_chk + 83 frame #7: 0x0000000102be8e86 libtk8.6.dylibTk_WmObjCmd + 12920
      frame #8: 0x0000000102c7479f libtcl8.6.dylibTclNRRunCallbacks + 80 frame #9: 0x00000001003f2b5a _tkinter.cpython-36m-darwin.soTkapp_Call + 415
      frame #10: 0x00000001000d277d Python_PyCFunction_FastCallDict + 166 frame #11: 0x000000010013a3f1 Pythoncall_function + 511
      frame #12: 0x0000000100132baf Python_PyEval_EvalFrameDefault + 5185 frame #13: 0x000000010013ac0c Python_PyEval_EvalCodeWithName + 1903
      frame #14: 0x000000010013b331 Pythonfast_function + 227 frame #15: 0x000000010013a3c1 Pythoncall_function + 463
      frame #16: 0x0000000100132baf Python_PyEval_EvalFrameDefault + 5185 frame #17: 0x000000010013b5d4 Python_PyFunction_FastCall + 122
      frame #18: 0x000000010013a3c1 Pythoncall_function + 463 frame #19: 0x0000000100132baf Python_PyEval_EvalFrameDefault + 5185
      frame #20: 0x000000010013ac0c Python_PyEval_EvalCodeWithName + 1903 frame #21: 0x000000010013b4fc Python_PyFunction_FastCallDict + 444
      frame #22: 0x00000001000995d8 Python_PyObject_FastCallDict + 214 frame #23: 0x00000001000996fc Python_PyObject_Call_Prepend + 156
      frame #24: 0x0000000100099445 PythonPyObject_Call + 102 frame #25: 0x00000001000e628e Pythonslot_tp_init + 61
      frame #26: 0x00000001000e30c6 Pythontype_call + 184 frame #27: 0x000000010009959c Python_PyObject_FastCallDict + 154
      frame #28: 0x000000010013a3ba Pythoncall_function + 456 frame #29: 0x0000000100132baf Python_PyEval_EvalFrameDefault + 5185
      frame #30: 0x000000010013ac0c Python_PyEval_EvalCodeWithName + 1903 frame #31: 0x00000001001316f9 PythonPyEval_EvalCode + 43
      frame #32: 0x000000010015a4b8 Pythonrun_mod + 54 frame #33: 0x000000010015a910 PythonPyRun_StringFlags + 120
      frame #34: 0x000000010015a860 PythonPyRun_SimpleStringFlags + 69 frame #35: 0x000000010016de26 PythonPy_Main + 2570
      frame #36: 0x0000000100001e1b Python___lldb_unnamed_symbol1$$Python + 228 frame #37: 0x00007fff93853235 libdyld.dylibstart + 1
      frame #38: 0x00007fff93853235 libdyld.dylibstart + 1

@stale stale bot added the stale label Jun 27, 2017

@stale

This comment has been minimized.

Copy link

commented Jun 27, 2017

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@jkl1337

This comment has been minimized.

Copy link
Author

commented Jun 27, 2017

Lol it's still an issue.

@stale stale bot removed the stale label Jun 27, 2017

@ilovezfs

This comment has been minimized.

Copy link
Contributor

commented Jun 27, 2017

@jkl1337 It is?

iMac-TMP:~ joe$ brew linkage python3
System libraries:
  /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit
  /System/Library/Frameworks/Carbon.framework/Versions/A/Carbon
  /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
  /System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices
  /System/Library/Frameworks/Foundation.framework/Versions/C/Foundation
  /System/Library/Frameworks/SystemConfiguration.framework/Versions/A/SystemConfiguration
  /usr/lib/libSystem.B.dylib
  /usr/lib/libbz2.1.0.dylib
  /usr/lib/libncurses.5.4.dylib
  /usr/lib/libobjc.A.dylib
  /usr/lib/libpanel.5.4.dylib
  /usr/lib/libz.1.dylib
Homebrew libraries:
  /usr/local/opt/gdbm/lib/libgdbm.4.dylib (gdbm)
  /usr/local/opt/openssl/lib/libcrypto.1.0.0.dylib (openssl)
  /usr/local/opt/openssl/lib/libssl.1.0.0.dylib (openssl)
  /usr/local/Cellar/python3/3.6.1/Frameworks/Python.framework/Versions/3.6/Python (python3)
  /usr/local/opt/readline/lib/libreadline.7.dylib (readline)
  /usr/local/opt/sqlite/lib/libsqlite3.0.dylib (sqlite)
  /usr/local/opt/tcl-tk/lib/libtcl8.6.dylib (tcl-tk)
  /usr/local/opt/tcl-tk/lib/libtk8.6.dylib (tcl-tk)
  /usr/local/opt/xz/lib/liblzma.5.dylib (xz)
iMac-TMP:~ joe$ python3
Python 3.6.1 (default, Jun 27 2017, 07:28:07) 
[GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.42.1)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import tkinter
>>> tkinter.Tk()
<tkinter.Tk object .>
>>> 
iMac-TMP:~ joe$ 
@ilovezfs

This comment has been minimized.

Copy link
Contributor

commented Jun 27, 2017

@jkl1337 ah ok I can reproduce this on 10.12 but not 10.11.

@iMichka

This comment has been minimized.

Copy link
Member

commented Jun 27, 2017

@ilovezfs
In the python3 bug, one user found out that

bringing back the --with-x11 removed in 1b5d094 fixes this

I did not have time try this out though.

@ilovezfs

This comment has been minimized.

Copy link
Contributor

commented Jun 27, 2017

@iMichka sure … but that's a different tcl-tk.

@gphein

This comment has been minimized.

Copy link

commented Jun 28, 2017

Having the same issue on mac 10.12.5. Not sure if this helps, but this is where I am after trying to find more info about whats going wrong. Disclosure: I know nothing about tcl/tk and very little about brew. For me, the error is thrown at line 1958 in /usr/local/Cellar/python3/3.6.1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/tkinter/init.py (might be off a line or two from me messing with it).

1958:        return self.tk.call('wm', 'protocol', self._w, name, command)

called from:

2051: self.protocol("WM_DELETE_WINDOW", self.destroy)

That calling sequence was from:

import tkinter as tk
tk._test()
Abort trap: 6

self.tk is an instance of _tkinter (created around line 2017), which appears to be a class from /usr/local/Cellar/python3/3.6.1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/lib-dynload/_tkinter.cpython-36m-darwin.so

which has dependencies on the tcl/tk libraries:

>otool -L /usr/local/Cellar/python3/3.6.1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/lib-dynload/_tkinter.cpython-36m-darwin.so
/usr/local/Cellar/python3/3.6.1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/lib-dynload/_tkinter.cpython-36m-darwin.so:
	/usr/local/opt/tcl-tk/lib/libtk8.6.dylib (compatibility version 8.6.0, current version 8.6.6)
	/usr/local/opt/tcl-tk/lib/libtcl8.6.dylib (compatibility version 8.6.0, current version 8.6.6)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1238.50.2)

I was hoping to get more info about what's going wrong beyond the "overflow" posted above which is what appears to me, too. I don't know enough about the systems involved so I'm at a loss to dig up more info.

@cemarriott

This comment has been minimized.

Copy link

commented Jun 30, 2017

According to the Python site (https://www.python.org/download/mac/tcltk/#activetcl-8-5-17-0), Python 3.6.1 should be using Tcl/Tk version 8.5.x, not 8.6. I have noted that the only version available through Homebrew is 8.6.6. ActiveState provides an 8.5 version of ActiveTcl which would presumably work, however I have not had the chance to test it.

@ilovezfs

This comment has been minimized.

Copy link
Contributor

commented Jun 30, 2017

@cemarriott given that the bug doesn't occur on 10.11 that doesn't sound likely to be relevant.

@jkl1337

This comment has been minimized.

Copy link
Author

commented Jun 30, 2017

@cemarriott That page refers to compatibility amongst the various semi-official prebuilt binary versions of python and tcl/tk. And actually that is precisely the reason why this bug is relevant to some of us because it has previously been the one way to get tkinter with tk 8.6 on Mac.

@stale stale bot added the stale label Jul 21, 2017

@stale

This comment has been minimized.

Copy link

commented Jul 21, 2017

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

telamonian pushed a commit to telamonian/homebrew-core that referenced this issue Jul 22, 2017

telamonian
tcl-tk: fix for Homebrew#12114 and Homebrew#12808. Reenabled the `--w…
…ith-x11` option. Without --with-x11 `brew test python` and `brew test python3` fail, and some formulae (eg pymol) break
@telamonian

This comment has been minimized.

Copy link
Contributor

commented Jul 22, 2017

@cowsandmilk's suggestion to readd (and use) the --with-x11 option in the tcl-tk formula fixed these issues for me. I've made a pull request with the revised formula. This apparently also fixes #12114.

@stale stale bot removed the stale label Jul 22, 2017

@ilovezfs

This comment has been minimized.

Copy link
Contributor

commented Jul 22, 2017

I've closed that PR but an actual fix for these issues would be most welcome.

BrewTestBot added a commit to BrewTestBot/homebrew-core that referenced this issue Jul 22, 2017

tcl-tk: fix for Homebrew#12114 and Homebrew#12808. Reenabled the `--w…
…ith-x11` option. Without --with-x11 `brew test python` and `brew test python3` fail, and some formulae (eg pymol) break

telamonian pushed a commit to telamonian/homebrew-core that referenced this issue Jul 25, 2017

telamonian pushed a commit to telamonian/homebrew-core that referenced this issue Aug 1, 2017

telamonian
tcl-tk: fix python tkinter issues Homebrew#12114 and Homebrew#12808 b…
…y adding devel

build. Also removes semi-function HEAD build

BrewTestBot added a commit to BrewTestBot/homebrew-core that referenced this issue Aug 1, 2017

BrewTestBot added a commit to BrewTestBot/homebrew-core that referenced this issue Aug 1, 2017

tcl-tk: fix python tkinter issues Homebrew#12114 and Homebrew#12808 b…
…y adding devel build. Also removes semi-function HEAD build

@ilovezfs ilovezfs closed this in 4a61e09 Aug 2, 2017

@ilovezfs

This comment has been minimized.

Copy link
Contributor

commented Aug 2, 2017

This should be fixed if you

brew install --devel tcl-tk

@Homebrew Homebrew locked and limited conversation to collaborators May 4, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.