Alternating LibLoad and LibFree crashes BGE #40555
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
9 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#40555
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
Windows 8 64-bit
Intel i3 3.4Ghz
AMD HD5650
Blender Version
Broken: 2.71-testbuild2
Worked: Never
This code will crash, even with delays:
Exact steps for others to reproduce the error
Was already reported and marked as solved, but this bug still exists.
https://developer.blender.org/T40199
Changed status to: 'Open'
Added subscriber: @iPLEOMAX
#43224 was marked as duplicate of this issue
#42167 was marked as duplicate of this issue
Added demonstration file.
Added subscriber: @raco
It seems the crash occurs only when freeing objects that were loaded and freed once or more.
I can confirm that this also happens with LibNews of (inactive) objects, LibLoaded or not.
Edit: I was wrong. The crash occurs WHEN LOADING objects that were freed once or more.
Added subscriber: @brita
Had another look at this. This may be related to #40924 because Blender only crashes if the LibLoaded object has a material.
LibLoad_LibFree_material_bug.zip
Added subscriber: @Moguri
Added subscriber: @mobious
The same problem occurs when using LibNew instead of LibLoad. As you can see in this file, it the crash occurs even if you load and free a different object each time. All that seems to matter is that the loaded object is using a material.
crash.blend
For me, the crash occurs on the second call to LibFree.
Added subscriber: @pgi
Well, I may have find an issue. It may even be the bug - who knows.
Disabling material caching prevents the crash.
My wild wild guess right now is that the pointer to the material in m_polymat_cache (KX_BlenderSceneConverter.cpp) is not released, removed, destroyed or whatever - I'm being technical here - but the pointed block is freed by LibFree (KX_BlenderSceneConverter::FreeBlendFile, perhaps :1371)
Things go on perfectly fine for a while, until the pointed block is actually recycled by the memory manager - or the name this thing has in C++.
When that happens, BANG!, the == operator in RAS_IPolyMaterial starts reading funny values and ultimately SIGSEGVs.
I'll try to see if I'm right (I'm like 50% sure about this)
I'm 99.9% positive on a material caching issue here. But it's a very long story.
Added subscriber: @arielvb
This issue was referenced by
377822729c
Changed status from 'Open' to: 'Resolved'
Added subscriber: @JohnDramor
Im diagnos random bug on complex scenes when libfree(). Be solve review i-- in unregister action, because unlimited loop and freezing game.
My worked sample: