CLI --export-3mf segfaults (0xC0000005) in render_thumbnail on Windows when an OpenGL context is available (fixed upstream by OrcaSlicer#16010)
Is there an existing issue for this problem?
- [x] I have searched the existing issues
Related but different: #689 (crash loading a process preset containing wipe_tower_filament) and #935 (crash when the input is a project 3MF). This one is the crash of --export-3mf itself, after slicing has succeeded.
Snapmaker_Orca Version
2.4.0 (the CLI reports engine version 01.10.01.50)
Operating System (OS)
Windows
OS Version
Windows 11 Pro 64-bit, NVIDIA GPU (the CLI logs got opengl version 4.6.0 NVIDIA 616.92)
Printer
Snapmaker U1 (0.4 nozzle) with flattened presets (the wipe_tower_filament workaround from #689 applied, inherits of the machine set to its system name)
How to reproduce
snapmaker-orca.exe model.3mf --datadir <temp dir> ^
--load-settings "machine.json;process.json" --load-filaments filament.json ^
--slice 0 --outputdir <absolute output dir> --export-3mf out.3mf
model.3mf is a plain geometry-only 3MF (no plate data). A tiny model (about 1k triangles) and a 175k-triangle model behave the same.
Actual results
The slice completes and plate_1.gcode is written, then the process dies with an access violation (exit code 0xC0000005) and no 3MF is produced. The log ends with:
plate 1's thumbnail, need to regenerate
framebuffer_type: ARB
render_thumbnail prepare: w 512, h 512, max_samples 32, render_fbo 1
render_thumbnail: plate_idx 0 volumes size 1, shader 000000004F7C3A60, use_top_view=0, for_picking=0
Without --export-3mf the same command exits 0 and writes the G-code. In the same session, Bambu Studio 02.08.02.61 with its own A1 presets exports the project 3MF fine.
Things that do not avoid the crash: empty thumbnails in the machine preset, --min-save, removing bed_model / bed_texture / bed_exclude_area, running the process on a separate Windows desktop (OpenGL is still available there), providing Metadata/plate_*.png files inside the input 3MF.
Likely cause
This looks like the upstream OrcaSlicer bug fixed by https://github.com/OrcaSlicer/OrcaSlicer/pull/16010 (merged 2026-09-30, commit 561737f). Since upstream #15745 the CLI can obtain an OpenGL context and therefore renders the plate thumbnail during --export-3mf. The viewport restore added at the end of GLCanvas3D::render_thumbnail_internal() (upstream #15674) reads the plater through wxGetApp(), which does not exist in CLI mode. Headless machines without an OpenGL context skip thumbnail rendering, which is why they never see it. I have not built the fork to confirm that this exact code is present in 2.4.0, but the crash point (right after the last render_thumbnail log line, only when a GL context exists) matches the upstream description.
Expected results
--export-3mf writes the project 3MF with its plate thumbnails, as upstream does after #16010.
Suggested fix
Cherry-pick upstream 561737f (skip the viewport restore when there is no application or no plater).
Recheck on 2.4.1 (Windows 11, 2026-10-28)
The export crash still reproduces on the official 2.4.1 Windows installation,
using bundled U1 0.4 mm presets flattened into working copies and a 20 mm cube STL.
The export-3mf probe adds --export-3mf <work>/export-3mf/out/cube.3mf to the
otherwise successful baseline command.
Baseline exits 0. Export exits 3221225477 (0xC0000005), after writing one G-code
but no 3MF (exports: []). Both G-code files report 925 s / 3.65 g.
A G-code existing is therefore not sufficient evidence of successful export.
The notes record PartPlate::calc_exclude_triangles: Unable to create exclude triangles
and can not find key Snapmaker U1 in the log. Those messages do not establish
the root cause; this recheck does not confirm the thumbnail stack trace or a fix.
Project file & Debug log uploads
Reproducer script and
recorded results, pinned to the tested revision.
The script generates the inputs and preserves each command (command.json), input
settings, output and combined stdout/stderr (slicer.log) in a separate probe directory.
Raw logs are not attached here. To reproduce with Python >= 3.11 and Orca 2.4.1 installed:
git clone https://github.com/antonio94770/Snapmaker-U1-Print-Copilot.git
cd Snapmaker-U1-Print-Copilot
git checkout aa73504769f591bb9c993c9b662de601251da4e6
python -m pip install -e .
python research/m4-probe/recheck_release.py C:/orca-cli-recheck
Use a fresh short absolute work directory that does not already exist. The script copies bundled presets and does not modify the installation or user presets or communicate with a printer. The suite includes intentional crash probes, each with a 45-second timeout. Commands use Windows-style paths and four filament presets.
Checklist of files to include
- [ ] Raw log file attached (preserved locally by the script)
- [x] Reproducer and input-generation code linked above