Repository navigation
fix(r): stop R plots emitting a Fontconfig error into the caller's stderr - #2
Merged
Merged
Conversation
…derr Every R job that drew text returned "Fontconfig error: Cannot load default config file" alongside its real output. NsJail mounts /usr but not /etc — api/config/sandbox.cfg has exactly two /etc entries, ld.so.cache and an inline hosts file — so fontconfig cannot reach /etc/fonts/fonts.conf. The fonts themselves were never missing: they live in /usr/share/fonts, which is mounted. Fixed by carrying fonts.conf into the R tree, which is already mounted, and pointing FONTCONFIG_FILE at it, rather than by adding /etc/fonts to the jail's mount set. Widening what an untrusted-code jail can see is not worth doing for a config file. The copy is self-sufficient: every <dir> it names is under /usr, and its only <include> is conf.d with ignore_missing="yes". Same shape as the /usr/bin/which fix already in api/Dockerfile. Cosmetic only. Verified against sandbox-microvm:v1.11.0-6cdfe0c through /api/v2/execute, with and without the change as a control: the warning disappears and rendering is byte-identical — same text metrics, same PNG md5 376cf616d8d64863d3346d9e7559407f. The remaining "Error parsing /proc/self/maps" is pre-existing and unrelated. build-packages.sh gets the same treatment to keep local builds faithful; its Rscript wrapper was also missing the LD_LIBRARY_PATH export that package-init.sh has had since the launcher fix, so that divergence closes here.
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.
Every R job that drew text returned "Fontconfig error: Cannot load default config file" alongside its real output.
NsJail mounts /usr but not /etc — api/config/sandbox.cfg has exactly two /etc entries, ld.so.cache and an inline hosts file — so fontconfig cannot reach /etc/fonts/fonts.conf. The fonts themselves were never missing: they live in /usr/share/fonts, which is mounted.
Fixed by carrying fonts.conf into the R tree, which is already mounted, and pointing FONTCONFIG_FILE at it, rather than by adding /etc/fonts to the jail's mount set. Widening what an untrusted-code jail can see is not worth doing for a config file. The copy is self-sufficient: every
it names is under /usr, and its only is conf.d with ignore_missing="yes".Same shape as the /usr/bin/which fix already in api/Dockerfile.
Cosmetic only. Verified against sandbox-microvm:v1.11.0-6cdfe0c through /api/v2/execute, with and without the change as a control: the warning disappears and rendering is byte-identical — same text metrics, same PNG md5 376cf616d8d64863d3346d9e7559407f. The remaining "Error parsing /proc/self/maps" is pre-existing and unrelated.
build-packages.sh gets the same treatment to keep local builds faithful; its Rscript wrapper was also missing the LD_LIBRARY_PATH export that package-init.sh has had since the launcher fix, so that divergence closes here.