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

Segmentation fault: Python crashes running fontbakery #4143

Open
hammerscript opened this issue May 25, 2023 · 8 comments
Open

Segmentation fault: Python crashes running fontbakery #4143

hammerscript opened this issue May 25, 2023 · 8 comments

Comments

@hammerscript
Copy link

Observed behaviour

I am trying to run check-adobefonts on a TT variable font, but when it gets to 24%, Python crashes showing the same window of issue #3918

Screenshot 2023-05-24 at 21 53 03

Similar to that issue, this is what the terminal shows:

▒ [PPPPPPPPWPWPPPIPPPS............................................................] 24%
zsh: segmentation fault fontbakery check-adobefonts --verbose

However, unlike what was previously reported, making a new virtual environment didn’t fix the problem. I have also tried force-reinstalling fontbakery, and the problem persists.

What can I do about it?

@miguelsousa
Copy link
Contributor

Hi @hammerscript

My answer assumes that you're using Font Bakery version 0.8.11. The version number can be obtained by running the command fontbakery --version

The check-adobefonts profile has 79 checks. The list of checks can be obtained by running the command fontbakery check-adobefonts --list-checks MyFont-Regular.ttf

Looking at the progress bar you provided ([PPPPPPPPWPWPPPIPPPS..........................]) it seems that the last result, a SKIP, is for the 19th check. This suggests that the 20th check is the one that's crashing; the name of that check is com.google.fonts/check/gpos7. Please confirm that's the crashing check by running Font Bakery in verbose mode; this can be achieved by adding the --verbose option to the fontbakery command you're using.

In case you need to exclude one or more checks from being executed, use the -x followed by the name of the check, for example:

 fontbakery check-adobefonts -x gpos7 -x sfnt_version MyFont-Regular.otf

@hammerscript
Copy link
Author

Hi @miguelsousa

Thank you for your answer. Excluding checks from being executed was useful to find where the problem was. After a few tests, I found that python crashes while executing com.adobe.fonts/check/freetype_rasterizer:adobefonts

Without this check, all works fine. I’m using FontBakery version 0.8.11.

@miguelsousa
Copy link
Contributor

Thanks for the info. Do you get any traceback besides the segmentation fault message?

Please run python3 -m pip list and tell us what's the version of freetype-py installed.
The latest is 2.4.0. I wonder if that version has a bug that is triggered by variable fonts. You can try downgrading by using this command:

python3 -m pip install freetype-py==2.3.0

@miguelsousa
Copy link
Contributor

I'm able to reproduce the segfault with SourceSerif4Variable-Italic.ttf and freetype-py version 2.4.0. No crash happens with v2.3.0.

@hammerscript
Copy link
Author

Hi @miguelsousa

I just got the segmentation fault message: zsh: segmentation fault fontbakery check-adobefonts -x gpos7 -x sfnt_version

I was using freetype-py version 2.4.0. After downgrading to version 2.3.0, it worked with no crashes.

Thank you so much.

@miguelsousa
Copy link
Contributor

I'd like to keep this open until there's a fix on the freetype-py side.

@arrowtype
Copy link
Contributor

I’m hitting this issue, too. It also works when I roll back to freetype-py==2.3.0.

felipesanches added a commit to felipesanches/fontbakery that referenced this issue Jun 1, 2023
felipesanches added a commit that referenced this issue Jun 1, 2023
felipesanches added a commit to felipesanches/fontbakery that referenced this issue Jun 12, 2023
felipesanches added a commit that referenced this issue Jun 13, 2023
and update to the CHANGELOG.md
(issues #4143, #3715 and #3874)
felipesanches added a commit to felipesanches/fontbakery that referenced this issue Jun 14, 2023
Adobe should have been added to this file a long time ago in the
fontbakery project, since the Google CLA doesn't take copyright
assignment, so Adobe is a copyright holder for the contributions
made by Adobe employees.

Also, the following commits were authored by Miguel Sousa at
his Open Bakery repository and ported back to Font Bakery:

These commits are identified by their hashes,
as agreed on a conversation with Miguel at
fonttools#4144 (comment)

- Commit a328639:
  Run black on the codebase
  (discussions fonttools#3397)

  note: To be sure, I have run the black code formatter myself
        on the codebase instead of applying a patch from the
        Open Bakery repo. There were a few strings that were
        placed side-by-side on the same line, which pylint caught.
        I made a followup commit to fix this and a few other
        minor lints.
        (My pylint fixes:
         commit c2daa50)

- Commit 413977d:
  Adopted the sentence
  "A font quality assurance tool for everyone"
  as package description on setup.py

- Commit 8abeb5c:
  Bumping up the version number of a few dependencies
  on requirements.txt, as we do routinely.

- Commit 4b2af53:
  Update setup.py to use extras based on the needs of
  specific profiles.
  (issue fonttools#3874)

  Also:
  - Uses encoding="utf8" when opening the README.md file.
  - Adds all supported Python versions to classifiers list

- Commit 194613e:
  Added code-test for crash on freetype-py 2.4.0
  (issue fonttools#4143)

  I have also updated the CHANGELOG.md with release notes
  for the upcoming version v0.9.0
  (issues fonttools#3715 and fonttools#3874)

- Commit ea4c774:
  Updated versions of dependencies used for code-testing

- Commit 000d806:
  Update actions/setup-python action to v4

- Commit b73a3d2:
  update CONTRIBUTING.md

  The full update written by Miguel was incorporated because
  I believe it is a good set of guidelines for the project.

  Note: The text regarding the Google CLA (that was present
        in the original CONTRIBUTING.md before Miguel's
        new text) was preserved.

- Commit 328dc21:
  Enable publish job to create GitHub release.

  note: Miguel removed the letter 'v' prefix on release tags
        (such as v0.8.12) but I changed it back to using
        the letter, for the sake of consistency with all
        pre-existing release tags in this repo.
felipesanches added a commit to felipesanches/fontbakery that referenced this issue Jun 14, 2023
Adobe should have been added to this file a long time ago in the
fontbakery project, since the Google CLA doesn't take copyright
assignment, so Adobe is a copyright holder for the contributions
made by Adobe employees.

Also, the following commits were authored by Miguel Sousa at
his Open Bakery repository and ported back to Font Bakery:

These commits are identified by their hashes,
as agreed on a conversation with Miguel at
fonttools#4144 (comment)

- Commit a328639:
  Run black on the codebase
  (discussions fonttools#3397)

  note: To be sure, I have run the black code formatter myself
        on the codebase instead of applying a patch from the
        Open Bakery repo. There were a few strings that were
        placed side-by-side on the same line, which pylint caught.
        I made a followup commit to fix this and a few other
        minor lints.
        (My pylint fixes:
         commit c2daa50)

- Commit 413977d:
  Adopted the sentence
  "A font quality assurance tool for everyone"
  as package description on setup.py

- Commit 8abeb5c:
  Bumping up the version number of a few dependencies
  on requirements.txt, as we do routinely.

- Commit 4b2af53:
  Update setup.py to use extras based on the needs of
  specific profiles.
  (issue fonttools#3874)

  Also:
  - Uses encoding="utf8" when opening the README.md file.
  - Adds all supported Python versions to classifiers list

- Commit 194613e:
  Added code-test for crash on freetype-py 2.4.0
  (issue fonttools#4143)

  I have also updated the CHANGELOG.md with release notes
  for the upcoming version v0.9.0
  (issues fonttools#3715 and fonttools#3874)

- Commit ea4c774:
  Updated versions of dependencies used for code-testing

- Commit 000d806:
  Update actions/setup-python action to v4

- Commit b73a3d2:
  update CONTRIBUTING.md

  The full update written by Miguel was incorporated because
  I believe it is a good set of guidelines for the project.

  Note: The text regarding the Google CLA (that was present
        in the original CONTRIBUTING.md before Miguel's
        new text) was preserved.

- Commit 328dc21:
  Enable publish job to create GitHub release.

  note: Miguel removed the letter 'v' prefix on release tags
        (such as v0.8.12) but I changed it back to using
        the letter, for the sake of consistency with all
        pre-existing release tags in this repo.

        Dave Crossland convinced me afterwards that it is
        actually a good idea to drop the prefix, so I will
        do it in a followup commit, with the intention of
        keeping both repos as close to identical as possible.
felipesanches added a commit that referenced this issue Jun 14, 2023
Adobe should have been added to this file a long time ago in the
fontbakery project, since the Google CLA doesn't take copyright
assignment, so Adobe is a copyright holder for the contributions
made by Adobe employees.

Also, the following commits were authored by Miguel Sousa at
his Open Bakery repository and ported back to Font Bakery:

These commits are identified by their hashes,
as agreed on a conversation with Miguel at
#4144 (comment)

- Commit a328639:
  Run black on the codebase
  (discussions #3397)

  note: To be sure, I have run the black code formatter myself
        on the codebase instead of applying a patch from the
        Open Bakery repo. There were a few strings that were
        placed side-by-side on the same line, which pylint caught.
        I made a followup commit to fix this and a few other
        minor lints.
        (My pylint fixes:
         commit c2daa50)

- Commit 413977d:
  Adopted the sentence
  "A font quality assurance tool for everyone"
  as package description on setup.py

- Commit 8abeb5c:
  Bumping up the version number of a few dependencies
  on requirements.txt, as we do routinely.

- Commit 4b2af53:
  Update setup.py to use extras based on the needs of
  specific profiles.
  (issue #3874)

  Also:
  - Uses encoding="utf8" when opening the README.md file.
  - Adds all supported Python versions to classifiers list

- Commit 194613e:
  Added code-test for crash on freetype-py 2.4.0
  (issue #4143)

  I have also updated the CHANGELOG.md with release notes
  for the upcoming version v0.9.0
  (issues #3715 and #3874)

- Commit ea4c774:
  Updated versions of dependencies used for code-testing

- Commit 000d806:
  Update actions/setup-python action to v4

- Commit b73a3d2:
  update CONTRIBUTING.md

  The full update written by Miguel was incorporated because
  I believe it is a good set of guidelines for the project.

  Note: The text regarding the Google CLA (that was present
        in the original CONTRIBUTING.md before Miguel's
        new text) was preserved.

- Commit 328dc21:
  Enable publish job to create GitHub release.

  note: Miguel removed the letter 'v' prefix on release tags
        (such as v0.8.12) but I changed it back to using
        the letter, for the sake of consistency with all
        pre-existing release tags in this repo.

        Dave Crossland convinced me afterwards that it is
        actually a good idea to drop the prefix, so I will
        do it in a followup commit, with the intention of
        keeping both repos as close to identical as possible.
@miguelsousa
Copy link
Contributor

The crash only happens on macOS. 🤔

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

3 participants