Skip to content

Conversation

julian1
Copy link

@julian1 julian1 commented Jun 1, 2025

See,

#346740
#284880
https://discourse.nixos.org/t/freecad-failed-to-compute-left-right-minimum-bearings-for-cursor-pcf/35266
FreeCAD/FreeCAD#10514

This change blacklists the cursor.pcf font from being background saved into the preferences serialization file.
When this font is loaded, extents cannot be computed, and Freecad freezes at 100% cpu, with errors streamed to stderr.

A proposed workaround, that involves manually editing ~/.config/FreeCAD/user.cfg, to clear the cursor.pcf field when modified, only goes so far.

Since some actions that trigger the behavior - such as DXF import and export - don't provide any opportunity to save work, before one has to perform the pkil, and re-edit the user.cfg, so it is not possible to progress the design.

The change is similar to
FreeCAD/FreeCAD#10555

The proposed fix,
FreeCAD/FreeCAD@9806a46
(now reverted) did not work for me.

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • Nixpkgs 25.11 Release Notes (or backporting 24.11 and 25.05 Nixpkgs Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
  • NixOS 25.11 Release Notes (or backporting 24.11 and 25.05 NixOS Release notes)
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

@github-actions github-actions bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. labels Jun 1, 2025
@nix-owners nix-owners bot requested a review from LordGrimmauld June 1, 2025 10:46
@NixOSInfra NixOSInfra added the 12.first-time contribution This PR is the author's first one; please be gentle! label Jun 1, 2025
@LordGrimmauld
Copy link
Contributor

Might an upstream PR make sense if it crashes not just on NixOS?

@LordGrimmauld
Copy link
Contributor

i also can't reproduce the issue

@julian1
Copy link
Author

julian1 commented Jun 1, 2025

cursor.pcf is used for X11's mouse cursor.
It should not be loaded by the app as a general purpose monospace font.
Depending on the set of installed system fonts, other fonts may be loaded in priority and according to QTs font enumeration, and in the loop code of DlgSettingsEditor.cpp.
So the OS/windowing system/set of installed fonts will all factor in whether the bad behavior is triggered.

@LordGrimmauld
Copy link
Contributor

LordGrimmauld commented Jun 2, 2025

Right. What about upstreaming the patch? Your changes itself do look fine, i am not opposed against this patch. But opening an upstream PR might fix it for more than just nix users while also getting "official" reviews.
(I'd be happy if there'd be an upstream PR that is linked in a comment, no need to get that upstream PR merged immediately)

@julian1
Copy link
Author

julian1 commented Jun 2, 2025

Good points. done.

@LordGrimmauld
Copy link
Contributor

After a backlink in nix (so the next person updating the package can check whether it was merged) this is ready

@julian1 julian1 force-pushed the freecad-fix-font-load-crash branch from 27b02d1 to f1c4f54 Compare June 2, 2025 10:58
@Aleksanaa Aleksanaa merged commit aab7595 into NixOS:master Jun 18, 2025
20 of 21 checks passed
@Aleksanaa Aleksanaa added the backport release-25.05 Backport PR automatically label Jun 18, 2025
@nixpkgs-ci
Copy link
Contributor

nixpkgs-ci bot commented Jun 18, 2025

Successfully created backport PR for release-25.05:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
8.has: port to stable This PR already has a backport to the stable release. 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 12.first-time contribution This PR is the author's first one; please be gentle! backport release-25.05 Backport PR automatically
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants