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

Cockpit once again reliably crashing on exit. #891

Closed
iandobbie opened this issue Apr 4, 2024 · 6 comments
Closed

Cockpit once again reliably crashing on exit. #891

iandobbie opened this issue Apr 4, 2024 · 6 comments

Comments

@iandobbie
Copy link
Collaborator

On my mac cockpit now crashes regularly (maybe every time) on exit. It is a crash in thread 0, is a segv and appears to be trying to free some unallocated memory.

I have upgraded to python 3.12.2 and not sure if this is a python upgrade issue or something in cockpit.

@iandobbie
Copy link
Collaborator Author

Running from the command line give a freetype error so I think this might just be a new freetype install that needs fixing again with the python upgrade. I will investigate

@carandraug
Copy link
Collaborator

I think there is no release of freetype with the fix we sent them. You may need to install freetype from dev sources.

@carandraug
Copy link
Collaborator

Actually, here it is from you a few months ago :)

Just to note that new installs on macOS still need to use the master branch of freetype-py from github rather than the current release from PyPI to avoid this crash roughly 1 time in 5.

Originally posted by @iandobbie in #684 (comment) on 11 Jan, 2024

(but maybe there is a new bug?)

@iandobbie
Copy link
Collaborator Author

Ok, installed the freetype from my src directory and appear to have stopped the freetype crash however the code still crashes every time I exit on 3.12, whereas exactly the same code closes cleanly on 3.11.

On 3.12 I am using a venv because python complained about me installing it globally, which is probably actually brew complaining. I will try to run the same code under 3.11 in a venv.

The other strange thing is that when I run from the repl (eg python; import cockpit; cockpit.main(["cockpit'])). Cockpit closes cleaning but the crash happens when a close the python repl.

@iandobbie
Copy link
Collaborator Author

A bit more info, when setup a separate venv with 3.11.8 it does not segfault. I ran it in a loop and of 20 repeats cockpit crashed once in a wxtimer so presumably there is still a lingering issue with one of the timers.

In 3.12.2 it crashes every time, as in the output below (the

  (cockpit_env) ID@IIC-ID-AIR cockpit % cockpit        
  FALLBACK (log once): Fallback to SW vertex for line stipple
  FALLBACK (log once): Fallback to SW vertex processing, m_disable_code: 2000
  FALLBACK (log once): Fallback to SW vertex processing in drawCore, m_disable_code: 2000
  zsh: segmentation fault  cockpit

(the FALLBACK lines are always there and I ought to work out a way to supress them) but it alwasy ends in a segfault, however when a loop it with a tiny shell script

#!/bin/zsh
n=0
while [[ True ]];do
    n=$(($n+1))
    echo $n
    cockpit 2>&1 
done

it does not report the segfault. I guess the segfault is reported to the subshell that runs cockpit and that is just swallowed somewhere.

@carandraug
Copy link
Collaborator

We have tracked this down to wxWidgets/Phoenix#2455 . The problem is limited to the wxPython 4.2.1 binary build for Python 3.12 and MacOS. The issue is already fixed in wxPython but no release has been made yet.

Possible workarounds:

  • install wxPython from its snapshot-builds. Currently, the latest build is https://wxpython.org/Phoenix/snapshot-builds/wxPython-4.2.2a1.dev5670+a207b407-cp312-cp312-macosx_10_10_universal2.whl . Only the last 15 snapshots are kept so this link may no longer work in a couple of months. In that case, look for the most recent file with the -cp312-cp312-macosx_10_10_universal2.whl sufix.

  • The issue appears to be on the sip version used to do the build which was pinned to sip==6.7.9 (it has since been changed to be sip==6.7.11 ). sip is not required at runtime, only for the build. So either:

    • build wxPython from development sources
    • build wxPython 4.2.1from source with a more recent version of sip

Anyway, it seems there is nothing we can do in Cockpit other than wait for wxPython to be re-released.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants