Page MenuHome

Blender 2.9 crashes when UNDO limit is reached
Closed, ResolvedPublic

Description

System Information
Operating system: win 10
Graphics card: GTX 1070

Blender Version
Broken: (2.9.0 Alpha daily build)
Worked: (2.8.3)

Running a simple modal script where I am creating a new object and then cutting a new undo check point with bpy.ops.ed.undo_push()
It crashes when UNDO limit is reached

Exact steps for others to reproduce the error

  1. Change the UNDO limit in prefs to a small value(e.g. 5) if you don't want to click 30 times..
  2. Load the attached blend file
  3. Run the script attched from script window
  4. Click in viewport at least 5 times to match the numer of undos

4 Crash..

Same problem if instead of bpy.ops.ed.undo_push() you return FINISHED from the modal op and add bl_options = {'REGISTER', 'UNDO'} to the op definition
So, this bug appears to be related to the undo system

Also, worth mentioning that running with 'blender -d' does not crash!!

Event Timeline

Blend file..

I had a similar crash drawing in grease pencil. Just open 2D template and start to draw...at some point you will get a crash. This is the crash log:

ucrtbased.dll!_aligned_free_dbg(void * block) Line 1975	C++
ucrtbased.dll!_aligned_free(void * block) Line 545	C++
blender.exe!aligned_free(void * ptr) Line 96	C
blender.exe!MEM_lockfree_freeN(void * vmemh) Line 124	C
blender.exe!BLO_memfile_free(MemFile * memfile) Line 66	C
blender.exe!BLO_memfile_merge(MemFile * first, MemFile * second) Line 95	C
blender.exe!memfile_undosys_step_free(UndoStep * us_p) Line 268	C
blender.exe!undosys_step_free_and_unlink(UndoStack * ustack, UndoStep * us) Line 225	C
blender.exe!undosys_stack_clear_all_first(UndoStack * ustack, UndoStep * us, UndoStep * us_exclude) Line 333	C
blender.exe!BKE_undosys_stack_limit_steps_and_memory(UndoStack * ustack, int steps, unsigned __int64 memory_limit) Line 449	C
blender.exe!ED_undo_push(bContext * C, const unsigned char * str) Line 107	C
blender.exe!ED_undo_push_op(bContext * C, wmOperator * op) Line 302	C
blender.exe!wm_operator_finished(bContext * C, wmOperator * op, const bool repeat, const bool store) Line 926	C
blender.exe!wm_handler_operator_call(bContext * C, ListBase * handlers, wmEventHandler * handler_base, wmEvent * event, PointerRNA * properties, const unsigned char * kmi_idname) Line 2050	C
blender.exe!wm_handlers_do_intern(bContext * C, wmEvent * event, ListBase * handlers) Line 2806	C
blender.exe!wm_handlers_do(bContext * C, wmEvent * event, ListBase * handlers) Line 2854	C
blender.exe!wm_event_do_handlers(bContext * C) Line 3283	C
blender.exe!WM_main(bContext * C) Line 478	C
blender.exe!main(int argc, const unsigned char * * UNUSED_argv_c) Line 530	C
[External Code]
Hans Goudey (HooglyBoogly) closed this task as Resolved.Jun 5 2020, 3:31 PM
Hans Goudey (HooglyBoogly) claimed this task.

Thanks for the report. I'm guessing this is the same issue as T77396.

This should be fixed with rB67b17684e69, which will be in the next daily build.

I'm going to close this as resolved, but please comment here if there's still an issue with the next build!

Hans Goudey (HooglyBoogly) reopened this task as Needs Triage.Jun 5 2020, 3:31 PM

Nevermind, my bad, just saw the comment from Antonio.

@Hans Goudey (HooglyBoogly) I compiled the code five minutes ago, so not sure that commit fix the bug.

Bastien Montagne (mont29) changed the task status from Needs Triage to Needs Information from User.Jun 6 2020, 6:32 PM

@Antonio Vazquez (antoniov) your backtrace looks terribly similar to the issue fixed in rB67b17684e69...

In any case, I cannot reproduce with current master (neither debug build with ASAN, nor release one), so am going to ask for a confirmation first here. :)

@Bastien Montagne (mont29) thanks. I can't reproduce this one either with the latest build. I have another thus, related to undoing and object linking to the scene. But i think is better to open another task for that one if I can reproduce it..

Bastien Montagne (mont29) closed this task as Resolved.Jun 6 2020, 7:34 PM

Indeed, lets keep an issue per task. ;)

Thanks, closing then.

new issue probably related T77557