Memory corruption when freeing custom bone shape objects #37709

Closed
opened 2013-12-05 16:22:34 +01:00 by Tom Edwards · 18 comments

System Information
Win7 x64, GTX 560

Blender Version
Broken: git latest (193dd134)
Worked: unknown

There are memory corruption errors when freeing the custom bone object ("smd_bone_vis") in the attached blend file. They doesn't actually crash Blender, but do cause the Windows debug CRT to raise an exception.

Exact steps for others to reproduce the error

  • Open the attached file with a debug build, or with the MSVC 11 or 12 debugger attached
  • Unload the blend (e.g. re-open the file)

Observe console warnings and/or CRT breakpoint

Running the script in the blend to remove the bone shapes eliminates the problem.

**System Information** Win7 x64, GTX 560 **Blender Version** Broken: git latest (193dd134) Worked: unknown There are memory corruption errors when freeing the custom bone object ("smd_bone_vis") in the attached blend file. They doesn't actually crash Blender, but do cause the Windows debug CRT to raise an exception. **Exact steps for others to reproduce the error** - Open the attached file with a debug build, or with the MSVC 11 or 12 debugger attached - Unload the blend (e.g. re-open the file) # Observe console warnings and/or CRT breakpoint Running the script in the blend to remove the bone shapes eliminates the problem.
Author

Changed status to: 'Open'

Changed status to: 'Open'
Author

Added subscriber: @artfunkel

Added subscriber: @artfunkel

Added subscriber: @Sergey

Added subscriber: @Sergey

I don't see any issues with the attached file. Also don't see smd_bone_vis object there. Is it that exact file you've been intending to share? :)

I don't see any issues with the attached file. Also don't see smd_bone_vis object there. Is it that exact file you've been intending to share? :)

Ah, found the object now. It's in "Blend FIle" of outliner but not in "datablocks", which seems a bit strange for me. Also, what does it exactly means "freeing custom bone object"? Just removing it?

Ah, found the object now. It's in "Blend FIle" of outliner but not in "datablocks", which seems a bit strange for me. Also, what does it exactly means "freeing custom bone object"? Just removing it?
Author

By "freeing custom bone object" I mean that the error occurs while freeing the scene if there are custom bones present. I missed out the all-important repro step #2 of opening a new file, sorry!

Edit: I can't edit the report, even though the error message says that the bug owner always can..?

By "freeing custom bone object" I mean that the error occurs while freeing the scene if there are custom bones present. I missed out the all-important repro step #2 of opening a new file, sorry! Edit: I can't edit the report, even though the error message says that the bug owner always can..?
Author

Weird that it's not in Datablocks too, it's right there for me.

Weird that it's not in Datablocks too, it's right there for me.

Added subscriber: @ideasman42

Added subscriber: @ideasman42

Cant redo the bug, tried running the script in bone_shape_crash.blend then removing the scene. No error printed.

Cant redo the bug, tried running the script in `bone_shape_crash.blend` then removing the scene. No error printed.
Author

Removing the scene won't repro, you need to unload the whole blend file.

Removing the scene won't repro, you need to unload the whole blend file.
Author

It turns out that the appearance of console errors differs between builds, but the bug remains. Add a breakpoint at action.c:720 (the id_us_min call in BKE_pose_channel_free) and you'll see that pchan->custom has already been freed.

It turns out that the appearance of console errors differs between builds, but the bug remains. Add a breakpoint at action.c:720 (the `id_us_min` call in `BKE_pose_channel_free`) and you'll see that `pchan->custom` has already been freed.

Can indeed see an error in valgrind. We had such kind of issues before, but still not sure what would be the proper way to solve this.

Can indeed see an error in valgrind. We had such kind of issues before, but still not sure what would be the proper way to solve this.

Ok, I can redo the bug now too,
Simple fix would be for pose-bones not to be object users.

(IIRC they weren't always object users)

Ok, I can redo the bug now too, Simple fix would be for pose-bones not to be object users. (IIRC they weren't always object users)
Sergey Sharybin self-assigned this 2013-12-23 15:27:38 +01:00

Can remember bones's custom shapes became user-counted on purpose. Will look into the reason of this and try to solve wrong memory read..

Can remember bones's custom shapes became user-counted on purpose. Will look into the reason of this and try to solve wrong memory read..

This issue was referenced by blender/blender-addons-contrib@122e2b4bfa

This issue was referenced by blender/blender-addons-contrib@122e2b4bfa0211676042ba8e02570d1dcd2fc40d

This issue was referenced by 122e2b4bfa

This issue was referenced by 122e2b4bfa0211676042ba8e02570d1dcd2fc40d

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'

Closed by commit 122e2b4bfa.

Closed by commit 122e2b4bfa.
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
4 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#37709
No description provided.