Python API: Access Violation crash running operator from a timer #65917

Closed
opened 2019-06-19 04:06:02 +02:00 by eldee smith · 11 comments

timer_crash.py
blender.crash.txt
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: fc182e3189
Worked: version: 2.80 (sub 74), branch: blender2.7, commit date: 2019-06-03 19:00, hash: d62a749fcf

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()
[timer_crash.py](https://archive.blender.org/developer/F7268846/timer_crash.py) [blender.crash.txt](https://archive.blender.org/developer/F7268991/blender.crash.txt) **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: `fc182e3189` Worked: version: 2.80 (sub 74), branch: blender2.7, commit date: 2019-06-03 19:00, hash: `d62a749fcf` **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](https://archive.blender.org/developer/F7268889/blender.crash.txt)}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() ```
Author

Added subscriber: @testure

Added subscriber: @testure

Added subscriber: @simon_lusenc

Added subscriber: @simon_lusenc

Added subscriber: @AndrewPeel

Added subscriber: @AndrewPeel

Added subscriber: @JoseConseco

Added subscriber: @JoseConseco

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

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

Added subscriber: @ZedDB

Added subscriber: @ZedDB

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'
Sebastian Parborg self-assigned this 2019-06-21 11:38:02 +02:00

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.

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.
Author

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: d30f72dfd8

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

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: `d30f72dfd8` 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.

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

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

Ah, okay- the fix probably hasn't made its way over to the nightly builds yet. I'll check it again tomorrow.
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
5 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#65917
No description provided.