SShortSingh.
Back to feed

One Wrong Word in Typst's Eval Caused Uncatchable Stack Overflow on Recursive Import

0
·4 views

A bug in Typst, the Rust-based typesetting system, caused the program to crash with a native stack overflow instead of returning a clean error when a document used the #eval() function to recursively import itself. The issue, tracked as typst/typst#8632, could be reproduced with a single line of code and resulted in no PDF output, no diagnostic message, and no usable exit code. The root cause was traced to the eval_string function in the typst-eval crate, where the route parameter was initialized with Route::default() instead of Route::extend(route), effectively stripping all call-chain history. Because Typst's cyclic-import and recursion-depth guards both rely on that route chain, every #eval() call appeared to the engine as a brand-new, depth-zero evaluation, bypassing both protections entirely. The fix required changing a single word in the source code so that eval_string inherits the caller's route context rather than starting from an empty one.

Read the full story at DEV Community

This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)

Log in to join the discussion and vote.

Log in

Related stories

0
ProgrammingDEV Community ·

How Pleadwise Uses Deterministic Code Over AI to Format Court-Ready Legal Filings

Developer building Pleadwise, a court-document tool for self-represented litigants, found that legal tech requires a fundamentally different approach than typical AI-driven products. Unlike creative tools where variation is acceptable, court filings must meet strict, exact formatting rules on margins, captions, line spacing, and page numbering. The solution involved structuring filings as validated data objects and storing each court's formatting requirements as separate, source-linked configuration profiles. This architecture allows formatting rules to be updated independently without rebuilding the entire document workflow. The key principle applied was to reserve AI for tasks where variation adds value, while using deterministic software for precision-critical legal requirements.

0
ProgrammingDEV Community ·

Polish Developer Launches Windows Monitor App on Microsoft Store After Warehouse Job Loss

Marcin Firmuga, a Polish developer, has launched PC Workman — a Windows system monitoring application — on the Microsoft Store after building it during nights following a warehouse job loss in the Netherlands days before Christmas. Working 15-kilometre daily shifts for roughly 19 złoty an hour, Firmuga coded on an overheating 2014 laptop between shifts to develop the tool. PC Workman version 1.8.0 aims to explain not just that a PC is slow, but why, using an on-device AI assistant called hck_GPT that requires no internet connection or API key. The assistant reads live hardware data and responds in plain language, processing queries through a local intent-parsing system built entirely by Firmuga. The project began as a means of survival and personal purpose during financial hardship, ultimately resulting in a publicly available Windows application.

0
ProgrammingDEV Community ·

How One Developer Built a Fault-Isolated, Multi-Exchange Spot Trading Bot

A developer is building NOVA, a Telegram-based bot that automates repeatable spot trading cycles without predicting markets or using leverage. The core design challenge was executing user-defined buy-sell sequences reliably across failures like dropped HTTP responses, WebSocket disconnections, and mid-cycle process restarts. To prevent exchange-specific details from leaking into business logic, the architecture strictly separates normalized trading concepts from raw exchange API behavior. Each market pair runs in its own isolated process with its own API credential context, limiting the blast radius of any single failure. The system requires only read and spot-trading permissions, deliberately excluding withdrawal access to reduce security risk.

0
ProgrammingDEV Community ·

Developer Rebuilds Browser OS for Mobile by Ditching the Desktop Window Model

A developer has released GnokeStation 2 (GS2), a browser-based mobile OS that replaces the traditional floating-window desktop metaphor with a tab-as-process model, where each tab occupies the full screen independently. The shift was driven by the impracticality of running a shared-canvas, windowed UI on a 5-inch smartphone screen, a limitation the developer says no amount of code polish could fix. GS2 uses a layer called gnoke-spirit to continuously save tab state to IndexedDB, allowing backgrounded tabs killed by the OS to resume rather than reload from scratch. The system is designed to be offline-first, with local storage as the source of truth and no dependency on accounts or remote servers. The developer claims GS2 can run roughly double the app tabs of a standard mobile browser at the same memory footprint by sharing a single browser runtime instead of duplicating engine overhead per app.