Bug: --load-assemble-list Segmentation Fault #1411

Closed
opened 2026-04-05 17:38:01 +02:00 by MrUnknownDE · 0 comments
Owner

Originally created by @SANCHES-Pedro on 12/5/2025

Is there an existing issue for this problem?

  • I have searched the existing issues

OrcaSlicer Version

2.3.1

Operating System (OS)

macOS

OS Version

macOS 26.1 25B78

Additional system information

  • OrcaSlicer Version: 2.3.1
  • Platform: macOS (likely affects all platforms)
  • Mode: CLI (command-line interface)
  • Build: Release build

Printer

Bambu Lab P1 (but it doesnt matter)

How to reproduce

Description

OrcaSlicer CLI crashes with a segmentation fault when using the --load-assemble-list option, even when all required machine, process, and filament settings are properly loaded. The crash occurs after objects are successfully created but before they can be processed, preventing CLI-only workflows that require per-object settings.

Steps to Reproduce

  1. Create an assemble list JSON file (assemble_list.json):
{
  "plates": [
    {
      "plate_name": "Plate 1",
      "need_arrange": false,
      "objects": [
        {
          "path": "file1.stl",
          "count": 1,
          "filaments": [1],
          "pos_x": [0.0],
          "pos_y": [0.0],
          "pos_z": [0.0],
          "print_params": {
            "sparse_infill_density": "15%"
          }
        },
        {
          "path": "file2.stl",
          "count": 1,
          "filaments": [1],
          "pos_x": [50.0],
          "pos_y": [0.0],
          "pos_z": [0.0],
          "print_params": {
            "sparse_infill_density": "50%"
          }
        }
      ]
    }
  ]
}
  1. Run OrcaSlicer CLI:
orca-slicer \
  --load-assemble-list assemble_list.json \
  --load-settings "machine.json;process.json" \
  --load-filaments "filament.json" \
  --slice 0 \
  --export-3mf output.3mf

Actual results

OrcaSlicer crashes with a segmentation fault after:

  1. Successfully loading the assemble list JSON
  2. Successfully constructing objects (log shows "total objects 2")
  3. Successfully loading machine/process/filament settings
  4. Crash occurs - segmentation fault

Expected results

OrcaSlicer should:

  1. Load the assemble list JSON file
  2. Load the specified STL files
  3. Apply per-object print parameters (print_params)
  4. Slice the objects
  5. Export to 3MF file

All operations should complete successfully in CLI mode without requiring GUI interaction.

Project file & Debug log uploads

The debug logs show a critical discrepancy:

Line ~344: construct_assemble_list: has objects need to be merged, total plates 1, total objects 2 ✅
Line ~381: total 1 models, 0 objects ❌
Then: Segmentation fault

The objects are created successfully in construct_assemble_list(), but are lost when the model is moved to m_models. The final model shows "0 objects" even though 2 objects were created.

Checklist of files to include

  • Log file
  • Project file

Anything else?

Root Cause Analysis

Issue 1: Object Transfer Bug

Location: src/OrcaSlicer.cpp lines 1798-1799

model.add_default_instances();
m_models.push_back(std::move(model));

The construct_assemble_list() function (line 845) creates objects and adds them to a local Model variable (temp_model). However, when this model is moved to m_models via std::move(), the objects are not properly transferred. The log shows "0 objects" in the final model even though construct_assemble_list reported creating objects successfully.

Issue 2: GUI Component Access in CLI Mode

Location: src/OrcaSlicer.cpp line 4567

When need_arrange: true is set in the assemble list JSON, the code attempts to access GUI components (Slic3r::GUI::PartPlate*) that are not initialized in CLI mode:

Slic3r::GUI::PartPlate* cur_plate = (Slic3r::GUI::PartPlate*)partplate_list.get_plate(i);

This causes a segmentation fault because GUI components are not available in CLI mode. Even with need_arrange: false, the crash still occurs due to Issue 1 (object transfer bug).

Environment

  • OrcaSlicer Version: 2.3.1
  • Platform: macOS (likely affects all platforms)
  • Mode: CLI (command-line interface)
  • Build: Release build

Additional Notes

  • Bug occurs with both need_arrange: true and need_arrange: false
  • Bug occurs with and without manual positioning (pos_x, pos_y, pos_z)
  • Bug occurs with and without --no-check flag
  • All required settings (machine, process, filament) are properly loaded before the crash
  • The crash prevents any CLI automation workflows that require per-object settings

Impact

This bug completely blocks CLI automation for workflows requiring per-object settings, which is a critical use case for:

  • Batch processing multiple objects with different configurations
  • Server-side slicing automation
  • CI/CD pipelines for 3D printing
  • Automated manufacturing workflows

Workaround (Partial)

A partial workaround exists but has significant limitations:

  1. Export each STL file separately with its specific settings to individual 3MF files
  2. Manually merge the 3MF files using external tools (e.g., Python script to extract/merge/rezip 3MF contents)
  3. Limitation: Still requires GUI verification to ensure per-object settings are applied correctly
  4. Limitation: Does not provide a complete CLI-only solution

This workaround is not suitable for fully automated CLI workflows.

Proposed Fix

  1. Fix object transfer: Ensure objects created in construct_assemble_list() are properly transferred to m_models. The issue may be related to how Model objects are moved or how object references are maintained.

  2. Remove GUI dependencies: Ensure arrange functionality (when need_arrange: true) does not access GUI components in CLI mode. Either:

    • Implement a CLI-only arrange function
    • Disable arrange functionality in CLI mode when using --load-assemble-list
    • Add proper guards to prevent GUI component access in CLI mode
  3. Add validation: Add checks to verify objects are properly transferred before proceeding with slicing operations.

  • src/OrcaSlicer.cpp:845 - construct_assemble_list() function
  • src/OrcaSlicer.cpp:1798-1799 - Model transfer to m_models (object loss occurs here)
  • src/OrcaSlicer.cpp:4567 - GUI component access (Slic3r::GUI::PartPlate*) in CLI mode
  • src/OrcaSlicer.cpp:4569-4578 - Arrange functionality block that accesses GUI components
*Originally created by @SANCHES-Pedro on 12/5/2025* ### Is there an existing issue for this problem? - [x] I have searched the existing issues ### OrcaSlicer Version 2.3.1 ### Operating System (OS) macOS ### OS Version macOS 26.1 25B78 ### Additional system information - **OrcaSlicer Version**: 2.3.1 - **Platform**: macOS (likely affects all platforms) - **Mode**: CLI (command-line interface) - **Build**: Release build ### Printer Bambu Lab P1 (but it doesnt matter) ### How to reproduce ## Description OrcaSlicer CLI crashes with a segmentation fault when using the `--load-assemble-list` option, even when all required machine, process, and filament settings are properly loaded. The crash occurs after objects are successfully created but before they can be processed, preventing CLI-only workflows that require per-object settings. ## Steps to Reproduce 1. Create an assemble list JSON file (`assemble_list.json`): ```json { "plates": [ { "plate_name": "Plate 1", "need_arrange": false, "objects": [ { "path": "file1.stl", "count": 1, "filaments": [1], "pos_x": [0.0], "pos_y": [0.0], "pos_z": [0.0], "print_params": { "sparse_infill_density": "15%" } }, { "path": "file2.stl", "count": 1, "filaments": [1], "pos_x": [50.0], "pos_y": [0.0], "pos_z": [0.0], "print_params": { "sparse_infill_density": "50%" } } ] } ] } ``` 2. Run OrcaSlicer CLI: ```bash orca-slicer \ --load-assemble-list assemble_list.json \ --load-settings "machine.json;process.json" \ --load-filaments "filament.json" \ --slice 0 \ --export-3mf output.3mf ``` ### Actual results OrcaSlicer crashes with a segmentation fault after: 1. ✅ Successfully loading the assemble list JSON 2. ✅ Successfully constructing objects (log shows "total objects 2") 3. ✅ Successfully loading machine/process/filament settings 4. ❌ **Crash occurs** - segmentation fault ### Expected results OrcaSlicer should: 1. Load the assemble list JSON file 2. Load the specified STL files 3. Apply per-object print parameters (`print_params`) 4. Slice the objects 5. Export to 3MF file All operations should complete successfully in CLI mode without requiring GUI interaction. ### Project file & Debug log uploads The debug logs show a critical discrepancy: ``` Line ~344: construct_assemble_list: has objects need to be merged, total plates 1, total objects 2 ✅ Line ~381: total 1 models, 0 objects ❌ Then: Segmentation fault ``` The objects are created successfully in `construct_assemble_list()`, but are lost when the model is moved to `m_models`. The final model shows "0 objects" even though 2 objects were created. ### Checklist of files to include - [ ] Log file - [ ] Project file ### Anything else? ## Root Cause Analysis ### Issue 1: Object Transfer Bug **Location**: `src/OrcaSlicer.cpp` lines 1798-1799 ```cpp model.add_default_instances(); m_models.push_back(std::move(model)); ``` The `construct_assemble_list()` function (line 845) creates objects and adds them to a local `Model` variable (`temp_model`). However, when this model is moved to `m_models` via `std::move()`, the objects are not properly transferred. The log shows "0 objects" in the final model even though `construct_assemble_list` reported creating objects successfully. ### Issue 2: GUI Component Access in CLI Mode **Location**: `src/OrcaSlicer.cpp` line 4567 When `need_arrange: true` is set in the assemble list JSON, the code attempts to access GUI components (`Slic3r::GUI::PartPlate*`) that are not initialized in CLI mode: ```cpp Slic3r::GUI::PartPlate* cur_plate = (Slic3r::GUI::PartPlate*)partplate_list.get_plate(i); ``` This causes a segmentation fault because GUI components are not available in CLI mode. Even with `need_arrange: false`, the crash still occurs due to Issue 1 (object transfer bug). ## Environment - **OrcaSlicer Version**: 2.3.1 - **Platform**: macOS (likely affects all platforms) - **Mode**: CLI (command-line interface) - **Build**: Release build ## Additional Notes - Bug occurs with both `need_arrange: true` and `need_arrange: false` - Bug occurs with and without manual positioning (`pos_x`, `pos_y`, `pos_z`) - Bug occurs with and without `--no-check` flag - All required settings (machine, process, filament) are properly loaded before the crash - The crash prevents any CLI automation workflows that require per-object settings ## Impact This bug **completely blocks CLI automation** for workflows requiring per-object settings, which is a critical use case for: - Batch processing multiple objects with different configurations - Server-side slicing automation - CI/CD pipelines for 3D printing - Automated manufacturing workflows ## Workaround (Partial) A partial workaround exists but has significant limitations: 1. Export each STL file separately with its specific settings to individual 3MF files 2. Manually merge the 3MF files using external tools (e.g., Python script to extract/merge/rezip 3MF contents) 3. **Limitation**: Still requires GUI verification to ensure per-object settings are applied correctly 4. **Limitation**: Does not provide a complete CLI-only solution This workaround is not suitable for fully automated CLI workflows. ## Proposed Fix 1. **Fix object transfer**: Ensure objects created in `construct_assemble_list()` are properly transferred to `m_models`. The issue may be related to how `Model` objects are moved or how object references are maintained. 2. **Remove GUI dependencies**: Ensure arrange functionality (when `need_arrange: true`) does not access GUI components in CLI mode. Either: - Implement a CLI-only arrange function - Disable arrange functionality in CLI mode when using `--load-assemble-list` - Add proper guards to prevent GUI component access in CLI mode 3. **Add validation**: Add checks to verify objects are properly transferred before proceeding with slicing operations. ## Related Code Locations - `src/OrcaSlicer.cpp:845` - `construct_assemble_list()` function - `src/OrcaSlicer.cpp:1798-1799` - Model transfer to `m_models` (object loss occurs here) - `src/OrcaSlicer.cpp:4567` - GUI component access (`Slic3r::GUI::PartPlate*`) in CLI mode - `src/OrcaSlicer.cpp:4569-4578` - Arrange functionality block that accesses GUI components
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/OrcaSlicer#1411