Repository navigation
fix(HardwareManager): don't crash on devicetree boards without DMI - #559
Merged
Merged
Conversation
pastaq
requested changes
Oct 3, 2026
loki666
force-pushed
the
fix/no-dmi-devicetree
branch
from
October 3, 2026 22:35
4ed6ea9 to
26bc6e7
Compare
ARM handhelds (e.g. Snapdragon SM8250/SM8550/SM8650) boot from devicetree and have no SMBIOS, so /sys/devices/virtual/dmi/id/* does not exist. _read_sys() called get_length() on the null FileAccess, which crashes a release build with SIGSEGV a few seconds into every start. Return an empty string when the file cannot be opened, and fall back to /sys/firmware/devicetree/base/model for the product name. Devicetree properties are NUL-terminated, so cut the buffer at the first NUL instead of decoding it (which logs a Unicode warning and leaves a U+FFFD). Fixes ShadowBlip#542
ShadowApex
approved these changes
Oct 3, 2026
ShadowApex
left a comment
Collaborator
There was a problem hiding this comment.
Looks good! Thank you for this!
pastaq
approved these changes
Oct 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #542.
Problem
Devicetree ARM boards (Snapdragon SM8250 / SM8550 / SM8650 handhelds) have no SMBIOS, so
/sys/devices/virtual/dmi/id/*does not exist.HardwareManager._read_sys()callsget_length()on the nullFileAccess, and a release build dies with SIGSEGV about 10 s into every start.Changes
_read_sys()returns""when the file cannot be opened.get_product_name()picks the path by CPU architecture:/sys/firmware/devicetree/base/modelonarm64/arm32, the DMIproduct_nameeverywhere else. It returns"Unknown"when nothing is read.x86 / DMI machines behave as before, except that an empty product name now reads
"Unknown".Testing
Tested on v0.46.1 with this patch, exported with the arm64 Godot 4.7.1 editor. Without the patch, OGUI crash-loops at startup.