Bpy.ops.ed.undo_push causes segfault in background mode

hi there. We’ve been testing with blender 2.80.41 to check compatibility with our addon, it now seems that a segfault occurs with 100% reproducibility when running bpy.ops.ed.undo_push in background. This was not the case for 2.80.40.

Now, I’ve been told that running operators in background is not something that is supported. But we’ve been making use of it to support synchronising lots of computers data for distributed rendering. Now that undo push crashes the background processes, we have to remove support for users using undo. As you can imagine, thats a pretty big hit. We’ll be telling our users that they have to be ‘perfect’ :slight_smile:

So, would it be possible for blender 2.80 beta to be restored to not having a segfault when we use the bpy.ops.ed.undo related operators in background? Another and perhaps better solution might be to allow us to directly access the undo history and be able to push and seek through the history, setting the state to whatever undo epoch we feel like (currently possible using bpy.ops.ed.undo_history(item=undo_index).

So, we’d really like to know, if either of those two options (preferably the latter) can be achieved, or if there are any alternatives.


1 Like

Crashes running operators in the background is a bug, can be reported in the tracker:

At worst it should not work, but if undo work in the background in 2.7 I see no reason it should not in 2.8.


Hi @brecht

thanks so much for the quick reply. I’ll post a bug report today. FYI bpy.ops.ed.undo_push and bpy.ops.ed.undo_history(item=undo_index) both work in background in 2.79b and have been working up until about 2.80.41 (not sure exactly what build hash introduced this though). So it would be great if that could be restored. I mean really amazingly great :smiley:

Hi @brecht, ok, i’ve just entered a bug report for this, here’s the link -> https://developer.blender.org/T60934

@brecht Hi there :slight_smile: would you have any idea how long, roughly, this bug might take to be fixed? The add-on we work on has got a user base that’s growing by about 500 ppl a month and I’m starting to get many e-mails asking about 2.80.41 and beyond and why the addon doesn’t support them. It would be awesome to give them some idea.