bpy.ops.script.reload() seg fault #80694
Labels
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
7 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#80694
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
System Information
Operating system: Darwin-19.5.0-x86_64-i386-64bit 64 Bits
Graphics card: AMD Radeon Pro 5500M OpenGL Engine ATI Technologies Inc. 4.1 ATI-3.9.15
Blender Version
Broken: version: 2.91.0 Alpha, branch: master, commit date: 2020-08-11 20:18, hash:
ec5f392087
Worked: (newest version of Blender that worked as expected)
Short description of error
Simply running
bpy.ops.script.reload()
causes a seg fault. Not always, but usually the second or third time I run it. I have tested with no unofficial addons installed.Running F3 > Reload Scripts works fine.
terminal output:
Writing: /var/folders/9j/s986zj3575d_p6ns3hqf3sn00000gn/T/blender.crash.txt
blender.crash.txt
Exact steps for others to reproduce the error
open blender
run bpy.ops.script.reload() in the console
Added subscriber: @bunnybones
Changed status from 'Needs Triage' to: 'Confirmed'
Added subscriber: @rjg
The execution of
CONSOLE_OT_execute
results in a mangled data structure of the operatorop
afterwm_operator_invoke
callsrna_operator_execute_cb
throughretval = op->type->exec(C, op);
. Subsequent access to the operator's data structure result in the crash.Added subscriber: @dfelinto
Changed status from 'Confirmed' to: 'Needs User Info'
I cannot reproduce it in Linux with 2.83, 2.90 or master (2.91 to be).
Can either @bunnybones or @rjg check what was the latest working version of Blender where this doesn't crash? Lowering the priority to normal until we figure this out. Specially since this only happens when running this via the console (not via the UI).
And @rjg if you manage to crash in a debug build can you share the complete backtrace?
@dfelinto I will try to bisect this, probably on Sunday. Can't promise that I will have time to identify this though, in case it reaches far back. The stack trace is identical to the one in the supplied crash log, but I can add it as well.
Stack trace for build based on commit
c01f8bb672
current master is equally affected:Added subscriber: @ankitm
2.82a, 2.81a, and 2.80rc3 also crash.
It's possible to crash 2.79 as well. I think we can skip bisecting then.
This inspired a decent workaround, where I just run a script like this:
That way the reload function doesn't return anything to the console directly.
Thanks for the insight.
Added subscriber: @ckohl_art
Added subscriber: @ideasman42
While there are multiple ways to fix this, many would mean making changes with bigger implications - just to support this one case, which I'm not so keen on.
Support operators being re-registered as part of operator execution complicates operator execution for a corner-case, will also cause hard to reason about bugs when an operators properties don't match those which they were activated in.
A quick fix for this case would be to move the console execution into a C operator, however it seems weak to change the implementation just to support reloading.
I think these are more reasonable alternatives...
bpy.ops.script.reload
to postpone reloading so the operator that activates it can finish without being freed (this could use a timer for example).bpy.ops.script.reload
to inspect it's own call-stack. Skip reloading modules which are part of the call stack.At the moment I'm more in favor of postponing reloading as it's not as involved as skipping modules in the call-stack, which might fail if there are any issues filtering out call-stack-modules could be tricky to do in a cross-platform way.
It's also possible the developer expects these modules to be reloaded, and needs to investigate why they don't.
@ideasman42 - another option: change the poll on
script.reload
to return False when executing from the console editor.This issue was referenced by
27ea086242
This issue was referenced by
14b0f20374
Changed status from 'Needs User Info' to: 'Resolved'