BMesh.free causes crash under curtain conditions #96791
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
6 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#96791
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: Linux-5.16.16-200.fc35.x86_64-x86_64-with-glibc2.34 64 Bits
Graphics card: NVIDIA GeForce GTX 1660 SUPER/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 510.47.03
Blender Version
Broken: version: 3.2.0 Alpha, branch: master, commit date: 2022-03-25 21:17, hash:
1909fd2781
Worked: 2.93.8 LTS
On Fedora also some 2.91 versions have been affected, according to rebuild agains newer pythons.
Reported on redhat bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1872980
Short description of error
blender.crash.txt
Using my python addon blender crashes on _PyEval_EvalFrameDefault or _Py_Dealloc.
Exact steps for others to reproduce the error
Unable to describe simple steps to reproduce. This happens using my python addon, but if a bug is in addon, still shouldn't crash blender but throw an python traceback.
When I delete line describen in crash log's backtrace, then another row is marked as a problem, so unable to identify exactly what's happening.
Please, let me know, if you need more information.
Edit, run this script with the following command line arguments: boxmaker_crash_single_script.py
blender -b --factory-startup --python boxmaker_crash_single_script.py
Added subscriber: @ondrejj
Added subscriber: @PratikPB2123
Changed status from 'Needs Triage' to: 'Needs User Info'
Hi, thanks for the report.
Not necessary that the crash caused by Python script is a bug in Blender code.
We use this canned response if crash or error is introduced by their own python script.
Crashes or errors involving your own C/C++ code (Python C/API for example) will only be accepted as bugs if you are able to identify the error in Blender's code. Finding that your code isn't working as expected in Blender isn't sufficient to consider it a Blender bug as there may be other reasons that aren't necessarily caused by errors in Blender's code.
Added subscriber: @StephenSwaney
/me bets on a reference counting error.
Hello. Thanks for reply. My script is only plain python, using only bpy, mesh and mathutils (only Vector) modules. No extenal C code. This is the reason why I reported this here.
If you wish, I can share my python script, even if it's not ready for public. My script also needs some interaction, which I can't fully describe, so I don't know if it helps.
Added subscriber: @deadpin
Either way, we need a way to reproduce the crash. We can't, and won't, debug through an entire addon to do so. A simplified repro is necessary. Strip out as much as possible until you arrive at only the pieces that are necessary.
Sorry, I can't reproduce this in a small script, however I found a problem. Using this function fails:
After removal of bm.free(), script works again.
@StephenSwaney, thank you for pointing me to an referencing error.
Why this bm.free() exists and should or shouldn't be called? In blender's documentation I found, that I should call it.
I think it's not necessary to call bm.free()
Data is expected to get freed at the end of function execution.
We may handle this as a valid report if that call is responsible for the crash.
I can confirm, that reenable of bm.free() will crash again and after removal it's back.
This script doesn't crash on bm.free() or at end of function, but crashes aprox. 10 rows after return from this function. May be crash log from this report can help to identify, what's happening.
My initial problem has been solved by removing of bm.free(), but I am ready to do more tests if needed. Just let me know, how I can help.
Added subscriber: @lichtwerk
There might be an issue in your script itself (Still I'm not sure unless we have steps to reproduce it).
Please try one of the community websites: https://www.blender.org/community/
If you think you found a bug, please submit a new report and carefully follow the instructions. Be sure to provide system information, Blender version, and a .blend file with exact steps to reproduce the problem.
Just in case I'm missing something, @lichtwerk, can you check?
To speed the process up (there are multiple people looking at this already), please always attach a .blend file where this script is already set up to just be executed from the Text Editor.
(This also ensures we are all on the same page)
There is no .blend file. My script is running from blender addons and is using multiple scripts.
Added subscriber: @ondrew
@ondrew : than please share that here or try to isolate relevant parts into a script (embedded in a .blend file) with clear steps to reproduce
@lichtwerk, you mentioned wrong people. :-)
So ok, I am adding my script. First is: boxmaker.py:
boxmaker.py
Copy this to addons and enable it.
Download pir.py:
pir.py
and run:
blender -P pir.py
This crashes my blender. Not tested today.
Removing of "bm.free()" can fix this script.
Please, do not ask me to make this script simpler. I can't figure, where is the exact problem.
Removed subscriber: @ondrew
Changed status from 'Needs User Info' to: 'Needs Triage'
Oops, thx noting
Added subscriber: @ideasman42
@ondrejj please make a simple test script that causes the error without relying on a separate add-on.
Any logic that isn't related to reproducing the crash should be removed.
Sorry, but I can't. My blender script programming is not good enough to do this. I did some experiment but without any success.
@ondrejj it should not be so difficult to merge the add-on into a script, then remove function calls - checking the crash still occurs.
But don't know which calls to remove. After removal of one line which makes a problem this problem moves to another line. Sorry, but as I said, I did some experiments, but without success.
@ondrejj uploaded a slightly simplified script with tracing enabled that runs in background mode and crashes reliably, this needs some more investigation though.
Edit: this seems to be memory corruption however it's not clear where exactly this occurs, tested with ASAN and Valgrind don't point to anything obvious.
It looks like the Python state is corrupted some time before the crash occurs.
Changed status from 'Needs Triage' to: 'Confirmed'
Changed status from 'Confirmed' to: 'Needs Developer To Reproduce'
Crash using python addon on _PyEval_EvalFrameDefaultto BMesh.free causes crash under curtain conditionsReport is already classified as a
Bug
so can we also mark it as "Confirmed"?