-
Notifications
You must be signed in to change notification settings - Fork 50
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
Segmentation fault #1442
Comments
Would you be able to share the contents of the cache json? |
Probably the same as #1370 |
Could you run these lines in Python repl, and paste the output here? It might already be fixed in a newer version of Tk.
|
Also try |
Thanks for the replies! Here's the cache json: Here's the output of those two lines: And here's the output of
What's strange is that I had previously installed Porcupine, probably v2023.06.27, with no issues on this same computer. |
Porcupine is failing to determine which fonts are monospaced. This is used in the settings dialog. I know this is the problem, because there is a The logic for doing this was changed in #1421, between v2023.06.27 and v2024.02.07. I am also using Debian 12 on x86_64, so I might be able to reproduce this if I install the same fonts that you have. The problem is, you have a lot of fonts installed :) It would take quite a while for me to find and install them all. Instead, let's narrow it down by looping through the fonts in a way that keeps going even when the entire Python process crashes. Run this bash script and post the output here: #!/bin/bash
python3 -c '
import tkinter.font
tkinter.Tk()
print("\n".join(tkinter.font.families()))
' | sort -u | while read font; do
echo -n "Trying $font... "
if python3 -c "
import tkinter
from porcupine import settings
settings._dialog_content = tkinter.Tk()
settings._is_monospace('$font')
"; then
echo "ok"
else
echo "ERROR!!!"
fi
done In case I decide to install all fonts you have, please also run:
I think this is the third or fourth time the monospace checking code causes this problem. Maybe I should do the entire check in a subprocess, so that I can handle errors better... |
Sorry, I posted a broken version of my bash script above. I edited my message and it now has a working script. |
Here's the output of the shell script:
Here's the output of that command:
What exactly is causing the Segmentation Fault though? |
Sorry, I forgot to mention that you need to have the venv activated for the script to work. Can you run it again after a
Looks good! I will try to reproduce the problem later today.
A bug in Tk. |
I can't reproduce this even after installing the same font packages that you have. But I will be able to fix this once I know which fonts cause crashing (that's what my bash script is supposed to check). |
Absolutely! Here's the new output:
It stops on Amiri Quran Colored.
👍 |
I don't know why the bash script is stopping, so I rewrote it in python. Try running this Python script (with import sys
import tkinter.font
import subprocess
tkinter.Tk().withdraw()
for font in sorted(set(tkinter.font.families())):
print(f"Trying {font}...", end=" ", flush=True)
ret = subprocess.call([sys.executable, '-c', f'''
import tkinter
from porcupine import settings
settings._dialog_content = tkinter.Tk()
settings._is_monospace({font!r})
'''])
if ret == 0:
print("ok")
else:
print("ERROR!!!") |
Here's the output: "Amiri Quran Colored" is the only one it errors on. |
I released a fix. Try installing today's release and let me know if it works. You can delete the |
Sorry for the late reply! |
I get this output after following the Debian install instructions:
If you need any more info, just let me know!
The text was updated successfully, but these errors were encountered: