• <i id='Lrr1a'><tr id='Lrr1a'><dt id='Lrr1a'><q id='Lrr1a'><span id='Lrr1a'><b id='Lrr1a'><form id='Lrr1a'><ins id='Lrr1a'></ins><ul id='Lrr1a'></ul><sub id='Lrr1a'></sub></form><legend id='Lrr1a'></legend><bdo id='Lrr1a'><pre id='Lrr1a'><center id='Lrr1a'></center></pre></bdo></b><th id='Lrr1a'></th></span></q></dt></tr></i><div id='Lrr1a'><tfoot id='Lrr1a'></tfoot><dl id='Lrr1a'><fieldset id='Lrr1a'></fieldset></dl></div>
    <legend id='Lrr1a'><style id='Lrr1a'><dir id='Lrr1a'><q id='Lrr1a'></q></dir></style></legend>
      <tfoot id='Lrr1a'></tfoot>
        <bdo id='Lrr1a'></bdo><ul id='Lrr1a'></ul>

        <small id='Lrr1a'></small><noframes id='Lrr1a'>

      1. Tkinter 导致 SIGSEGV 和系统崩溃 - 如何修复?

        时间:2023-08-06

              <tbody id='Z1KqG'></tbody>

                <bdo id='Z1KqG'></bdo><ul id='Z1KqG'></ul>
                  <tfoot id='Z1KqG'></tfoot>

                  <i id='Z1KqG'><tr id='Z1KqG'><dt id='Z1KqG'><q id='Z1KqG'><span id='Z1KqG'><b id='Z1KqG'><form id='Z1KqG'><ins id='Z1KqG'></ins><ul id='Z1KqG'></ul><sub id='Z1KqG'></sub></form><legend id='Z1KqG'></legend><bdo id='Z1KqG'><pre id='Z1KqG'><center id='Z1KqG'></center></pre></bdo></b><th id='Z1KqG'></th></span></q></dt></tr></i><div id='Z1KqG'><tfoot id='Z1KqG'></tfoot><dl id='Z1KqG'><fieldset id='Z1KqG'></fieldset></dl></div>
                • <legend id='Z1KqG'><style id='Z1KqG'><dir id='Z1KqG'><q id='Z1KqG'></q></dir></style></legend>

                • <small id='Z1KqG'></small><noframes id='Z1KqG'>

                  本文介绍了Tkinter 导致 SIGSEGV 和系统崩溃 - 如何修复?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  我正在为一个 python 项目开发一个 Tkinter GUI.昨天一切都很好,但是今天当我运行 mainloop() 命令时,我的 mac 立即崩溃(返回登录屏幕).

                  I'm developing a Tkinter GUI for a python project. Everything was fine yesterday, but today my mac immediately crashes (back to log-in screen) when I run the mainloop() command.

                  我试图通过减少 GUI 功能来隔离问题,但没有任何帮助.即使是最简单的 GUI 也会出现问题.

                  I've tried to isolate the issue by cutting back GUI features, but nothing helped. The problem even occurs with the simplest of GUIs.

                  我正在使用这个演示代码:

                  I'm using this demo code:

                  from tkinter import Tk, Label, Button
                  
                  class MyFirstGUI:
                      def __init__(self, master):
                          self.master = master
                          master.title("A simple GUI")
                  
                  
                  root = Tk()
                  my_gui = MyFirstGUI(root)
                  root.mainloop()
                  

                  当我运行最后一行时,我的屏幕会变黑一秒钟并返回 MacOS 登录屏幕.从终端运行脚本时也会发生.重复几次后,我发现在每次崩溃后,system.log 中都会出现这一行:

                  When I run the last line, my screen goes black for a second and returns the MacOS log-in screen. Also happens when running the script from terminal. After a few repeats, I found this line to recur in the system.log after at each crash:

                  Jul 29 17:58:51 MacBook-Pro-myname com.apple.xpc.launchd[1] (com.apple.WindowServer[1510]): Service exited due to SIGSEGV | sent by exc handler[1510]
                  

                  每次崩溃的处理程序编号都是唯一的.以安全模式启动可以解决问题,但我当然不能永远处于安全模式:)

                  The handler number is unique to each crash. Booting in Safe Mode resolves the issue, but of course I cannot live in Safe Mode forever :)

                  这似乎是某种内部问题,因为 python 代码再简单不过了.我不知道如何调试这个,谁能帮帮我?

                  It seems some sort of internal issue, as the python code could not be simpler. I have no clue how to debug this, can anyone help me out?

                  已修复 - 出于某种原因,Tkinter 开始弄乱我的机器.更新到 8.6.9 解决了这个问题.(参见:https://bugs.python.org/issue34927)

                  FIXED IT - For some reason Tkinter started to mess with my machine. Update to 8.6.9 resolved the issue. (see: https://bugs.python.org/issue34927)

                  推荐答案

                  结果由于某种原因标准版本的 Tkinter (8.6.*) 不再正常运行.我发现 https://bugs.python.org/issue34927 并很快更新到 Tkinter 8.6.9(conda forge),这似乎已经解决了这个问题.

                  Turns out for some reason the standard version of Tkinter (8.6.*) was no longer functioning correctly. I found https://bugs.python.org/issue34927 and soon after updated to Tkinter 8.6.9 (conda forge), which seems to have solved the issue.

                  这篇关于Tkinter 导致 SIGSEGV 和系统崩溃 - 如何修复?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:使用 Python ctypes 调用 rs232.c 时如何解决分段错误 下一篇:Python 线程 stack_size 和 segfaults

                  相关文章

                  最新文章

                • <legend id='N3wQ7'><style id='N3wQ7'><dir id='N3wQ7'><q id='N3wQ7'></q></dir></style></legend>

                  • <bdo id='N3wQ7'></bdo><ul id='N3wQ7'></ul>
                  <tfoot id='N3wQ7'></tfoot>
                    <i id='N3wQ7'><tr id='N3wQ7'><dt id='N3wQ7'><q id='N3wQ7'><span id='N3wQ7'><b id='N3wQ7'><form id='N3wQ7'><ins id='N3wQ7'></ins><ul id='N3wQ7'></ul><sub id='N3wQ7'></sub></form><legend id='N3wQ7'></legend><bdo id='N3wQ7'><pre id='N3wQ7'><center id='N3wQ7'></center></pre></bdo></b><th id='N3wQ7'></th></span></q></dt></tr></i><div id='N3wQ7'><tfoot id='N3wQ7'></tfoot><dl id='N3wQ7'><fieldset id='N3wQ7'></fieldset></dl></div>
                  1. <small id='N3wQ7'></small><noframes id='N3wQ7'>