# Ctrl+Z crashes Slicer sometimes

**URL:** <https://discourse.slicer.org/t/ctrl-z-crashes-slicer-sometimes/35935>\
**Category:** Support\
**Created:** [May 6, 2024, 7:49am UTC](https://discourse.slicer.org/t/ctrl-z-crashes-slicer-sometimes/35935 "2024-05-06T07:49:20Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![SANTIAGO\_PENDON\_MING](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/santiago_pendon_ming/32/66060_2.png) [@SANTIAGO\_PENDON\_MING](https://discourse.slicer.org/u/SANTIAGO_PENDON_MING)\
**Post date:** [May 6, 2024, 7:49am UTC](https://discourse.slicer.org/t/ctrl-z-crashes-slicer-sometimes/35935/1 "2024-05-06T07:49:20Z")

</div>

Hi to everyone 🙂

Today I’m having some bad responses when I try to use Ctrl+Z shortcut in segmentEditor. The shortcut is not modified (his function is Undo).

In my complete routine program, Ctrl+Z works well some of the times, but after a few steps ( One of them is reduce the number of Undo using `slicer.modules.SegmentEditorWidget.editor.setMaximumNumberOfUndoStates(1)`), then, when I try to use again the shortcut, it blocks the Slicer UI and finally closes the app.

It is a very disappointing issue, so if anyone could give me any advices I would be grateful.

Thanks.

Pd: I mentioned a similar behaviour in Slicer UI a few weeks ago ([Segment Editor shortcurts does not work](https://discourse.slicer.org/t/segment-editor-shortcurts-does-not-work/35303))

---

<div class="post-metadata">

**Author:** ![pieper](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/pieper/32/8_2.png) [@pieper](https://discourse.slicer.org/u/pieper)\
**Post date:** [May 6, 2024, 11:19am UTC](https://discourse.slicer.org/t/ctrl-z-crashes-slicer-sometimes/35935/2 "2024-05-06T11:19:39Z")

</div>

It would help a lot if you can find a way to reproduce this behavior using sample data and a set sequence of steps so the underlying issue can be isolated.

In the meantime, you should save frequently.

---

<div class="post-metadata">

**Author:** ![THartman](https://avatars.discourse-cdn.com/v4/letter/t/e47c2d/32.png) [@THartman](https://discourse.slicer.org/u/THartman)\
**Post date:** [May 9, 2024, 10:33pm UTC](https://discourse.slicer.org/t/ctrl-z-crashes-slicer-sometimes/35935/3 "2024-05-09T22:33:45Z")

</div>

My (admittedly rather naive) thought would be to check your computer’s Memory usage in Task Manager if you’re on Windows, and if it seems to spike when this action is attempted, I would hazard a guess that the behavior you’re attempting to undo might be prompting a big change to the files and this might be causing the crash. I had an issue where slicer was crashing due to drive code I was passing into it for a bit, and it turned out that I was using way too much memory, which caused the crash.
