Skip to content

Report a clear error when a font fallback crashes lualatex#14560

Open
cderv wants to merge 2 commits into
mainfrom
fix/luaotfload-fallback-error-message
Open

Report a clear error when a font fallback crashes lualatex#14560
cderv wants to merge 2 commits into
mainfrom
fix/luaotfload-fallback-error-message

Conversation

@cderv
Copy link
Copy Markdown
Member

@cderv cderv commented May 29, 2026

When a document sets a font fallback (mainfontfallback, monofontfallback, ...) and renders to PDF with lualatex on recent TeX Live (luaotfload v3.29), lualatex crashes before producing a PDF and Quarto reports only a generic compilation failed- error.

Root Cause

luaotfload's fallback resolver appends an internal ;-fallback feature to each fallback entry and resolves it with define_font, which returns nil on this version; luaotfload-fallback.lua then dereferences the nil. The crash is a Lua runtime error with no ! ...Here is how much block, so findLatexError in src/command/render/latexmk/parse-error.ts extracts nothing and the user is left with a generic failure and no signal.

Fix

Detect the crash signature in findLatexError and return an actionable message: it names the fallback options, explains it is a known upstream luaotfload bug on this TeX Live, and points to the single-font workaround (e.g. monofont: JuliaMono). Upstream report: latex3/luaotfload#331

This is a diagnostic only — the underlying crash is upstream. The single-font workaround renders correctly today.

Test Plan

  • Render a PDF with monofont + monofontfallback on lualatex (TeX Live 2026) — the error names the fallback options and links the upstream issue, instead of a generic failure
  • Unit test in tests/unit/latexmk/parse-error.test.ts covers the crash-log signature

Related to #14553

On recent TeX Live (luaotfload v3.29), setting a font fallback
(mainfontfallback/monofontfallback/...) crashes LuaLaTeX before a PDF is
produced: luaotfload's fallback resolver dereferences a nil font. Quarto only
showed a generic "compilation failed" with no usable signal, because the crash
is a Lua runtime error with no standard "! ...Here is how much" block for the
log parser to key off.

Detect the crash signature in findLatexError and return a message that names
the fallback options, explains it is a known upstream luaotfload bug on this
TeX Live, and points to the single-font workaround. Upstream report:
latex3/luaotfload#331

See #14553.
@posit-snyk-bot
Copy link
Copy Markdown
Collaborator

posit-snyk-bot commented May 29, 2026

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

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

Successfully merging this pull request may close these issues.

2 participants