spyoungtech / spyoungtech/FreeSimpleGUI

Segmentation fault on MacOS 14.5 / Apple Silicon with Python 3.12.5 and FreeSimpleGUI 5.1.1

Open
#32 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
867
Forks
106
Avg merge
1m
Merged PRs (30d)
2

Description

I have a FreeSimpleGUI front end for a plotting utility; there is a button on the FreeSimpleGUI window that renders a plot with matplotlib show(). After closing the plot window (when show() exits), I'm getting a segmentation fault.

I can invoke the same plot via command line switches and bypass any FreeSimpleGUI rendering. In that case, after I close the show() window, no segmentation fault.

I add a faulthandler.enable() before the show(), and got this stack trace for the segmentation fault:

Fatal Python error: Segmentation fault

Current thread 0x00000001f3454c00 (most recent call first):
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/tkinter/__init__.py", line 1505 in mainloop
  File "/Users/elw/Development/brewmonitor-python-toolkit/.venv/lib/python3.12/site-packages/PySimpleGUI.py", line 11263 in _read
  File "/Users/elw/Development/brewmonitor-python-toolkit/.venv/lib/python3.12/site-packages/PySimpleGUI.py", line 11134 in read
  File "/Users/elw/Development/brewmonitor-python-toolkit/pfi/tools/fplot.py", line 414 in fplot_ui
  File "/Users/elw/Development/brewmonitor-python-toolkit/pfi/tools/fplot.py", line 123 in fplot_cli
  File "/Users/elw/Development/brewmonitor-python-toolkit/pfi/tools/fplot.py", line 570 in <module>
  File "<frozen runpy>", line 88 in _run_code
  File "<frozen runpy>", line 198 in _run_module_as_main

I tried PySimpleGUI-4-foss, and had the same behavior, if that helps. Matplotlib version is the most current (3.9.1.post1), but it occurred with Matplotlib 3.8.3 and 3.8.4 as well.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the reported stack trace, especially the GUI path through pfi/tools/fplot.py at lines 414, 123, and 570, and reproduce it on macOS 14.5 with Python 3.12.5, FreeSimpleGUI 5.1.1, and the reported matplotlib versions. Compare the GUI and command-line paths around closing show(); done means the GUI path closes the plot without a segmentation fault.

Written by the indexing model from the issue text.

Assessment

Tech stack
macos, matplotlib, python
Domain
desktop
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.