Page MenuHome

Python API: Access Violation crash running operator from a timer
Closed, ResolvedPublic

Description



System Information
Operating system: Linux-4.18.0-21-generic-x86_64-with-debian-buster-sid 64 Bits (Verified crashing on Windows 10 as well)
Graphics card: Mesa DRI Intel(R) Haswell Mobile Intel Open Source Technology Center 4.5 (Core Profile) Mesa 18.2.8

Blender Version
Broken: version: 2.80 (sub 74), branch: blender2.7, commit date: 2019-06-18 22:21, hash: rBfc182e318988
Worked: version: 2.80 (sub 74), branch: blender2.7, commit date: 2019-06-03 19:00, hash: rBd62a749fcf48

Short description of error
Blender crashes to desktop when an operator is called from a timer- ONLY on the second time the timer fires! This was not happening a couple of weeks ago (see last working version, I still have that build and the supplied script does not cause a crash)

Exact steps for others to reproduce the error
Run the attached python script. The first time the timer is triggered, it will work correctly- the second time it is triggered (10 seconds later) {F7268889}Blender will crash to desktop.

Edit: script and crash log attached for your convenience

import bpy

def main(context):
    print("Crash will occur on the second timer trigger")

class SimpleOperator(bpy.types.Operator):
    """Tooltip"""
    bl_idname = "object.simple_operator"
    bl_label = "Simple Object Operator"

    def execute(self, context):
        main(context)
        return {'FINISHED'}

def test():    
    bpy.ops.object.simple_operator()
    return 10.0

def register():
    bpy.utils.register_class(SimpleOperator)
    bpy.app.timers.register(test)

def unregister():
    bpy.utils.unregister_class(SimpleOperator)
    bpy.app.timers.unregister(test)

if __name__ == "__main__":
    register()

Details

Type
Bug

Event Timeline

eldee smith (eldee) updated the task description. (Show Details)

I had similar problem. Week or two ago, calling operator from timer worked ok, now crahs.

Sebastian Parborg (zeddb) closed this task as Resolved.
Sebastian Parborg (zeddb) claimed this task.

There was an issue recently solved related to timers. I can't reproduce the crash so I'm guessing it solved this also.
If this is not the case for you, let me know and we'll reopen this.

This is still happening in the latest 2.80 build available on buildbot: version: 2.80 (sub 74), branch: master, commit date: 2019-06-19 18:29, hash: rBd30f72dfd8ac

Were you trying to repro with a locally built blender? Should I try to confirm repro on a different version?

I just updated and compiled and everything is working on my side.

Ah, okay- the fix probably hasn't made its way over to the nightly builds yet. I'll check it again tomorrow.