Skip to content

Fix segfault in --merge CLI command (#14548)#15235

Open
joshherkness wants to merge 1 commit intoprusa3d:masterfrom
joshherkness:fix/cli-merge-segfault
Open

Fix segfault in --merge CLI command (#14548)#15235
joshherkness wants to merge 1 commit intoprusa3d:masterfrom
joshherkness:fix/cli-merge-segfault

Conversation

@joshherkness
Copy link

Summary

Running PrusaSlicer --merge model.stl results in a segmentation fault. The root cause is an unsafe access to the dont_arrange option - calling transform.opt_bool("dont_arrange") when the option hasn't been set causes the crash.

Changes

  • Added safety check before accessing the dont_arrange option
    • If the transform does not have dont_arrange, we'll skip checking the dont_arrange option since this causes crash

Testing

  • ~/Projects/prusa-slicer/build/src/PrusaSlicer --merge /tmp/3DBenchy.stl /tmp/3DBenchy.stl --export-stl --output /tmp/merged.stl, verify no crash occurs and output contains merged models which have been arranged
merged-arrange stl # - ✅ `~/Projects/prusa-slicer/build/src/PrusaSlicer --merge /tmp/3DBenchy.stl /tmp/3DBenchy.stl --export-stl --output /tmp/merged.stl --dont-arrange`, verify no crash occurs and output contains merged models which have **not** been arranged merged-dont-arrange stl

Issue

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.

1 participant