ID User Decriment Error #84885

Closed
opened 2021-01-20 06:21:55 +01:00 by Christopher Gearhart · 17 comments

System Information
Operating system: Mac OS
Graphics card: AMD Radeon Pro 5500M 8 GB

Blender Version
Broken: 2.80, 2.83, 2.91, and 2.92 from buildbot January 20th (c2e6969c56)
Worked: 2.79

Short description of error
I've been getting this error consistently since 2.80 and it still shows up in 2.91:

ERROR (bke.lib_id): /Users/blender/blender-buildbot/macos_291/blender.git/source/blender/blenkernel/intern/lib_id.c:292 id_us_min: ID user decrement error: OBcube (from '[Main]'): 1 <= 1

Blender occasionally crashes after this. I'm assuming the crash is related.

Exact steps for others to reproduce the error

I get the error when using an addon, and I've narrowed it down to the following cause:

  1. A PointerProperty registered via the addon is set to an object (PointerProp is type bpy.types.Object, and is a sub-property of a PropertyGroup registered to the scene as a CollectionProperty; not sure if any of that's relevant)
  2. The project is saved, then Blender & the project file are closed and reopened
  3. The object prints the error above (starting with ERROR (bke.lib_id):...) when it is unlinked from the scene or deleted, or even if the PointerProperty from step 1 is referenced via code.

I've tried for a few hours now to recreate this in a simple situation with a basic script but I can't do it. It comes up very consistently when using the addon, and given my research I know where the error is coming from, but I'm not sure exactly what to do to simplify it and give exact steps to reproduce.

Please let me know what further information I need to give if any. I'm hoping the issue cropping up here will be apparent with what information I've already given.

EDIT: I've been asked to include the addon as well as an example file. Attached below:

bricker_v2-3-0_demo.zip ID User Decriment Error.blend

Exact steps to reproduce:

  1. Open the attached blend file
  2. Install the attached addon
  3. Run {nav Bricker > Delete Model} from the right hand 'UI' menu
  4. Note the error printed to the terminal. This printout comes from line 297 in 'bricker/operators/delete_model.py'
**System Information** Operating system: Mac OS Graphics card: AMD Radeon Pro 5500M 8 GB **Blender Version** Broken: 2.80, 2.83, 2.91, and 2.92 from buildbot January 20th (c2e6969c56ef) Worked: 2.79 **Short description of error** I've been getting this error consistently since 2.80 and it still shows up in 2.91: ``` ERROR (bke.lib_id): /Users/blender/blender-buildbot/macos_291/blender.git/source/blender/blenkernel/intern/lib_id.c:292 id_us_min: ID user decrement error: OBcube (from '[Main]'): 1 <= 1 ``` Blender occasionally crashes after this. I'm assuming the crash is related. **Exact steps for others to reproduce the error** I get the error when using an addon, and I've narrowed it down to the following cause: 1. A PointerProperty registered via the addon is set to an object (PointerProp is type `bpy.types.Object`, and is a sub-property of a PropertyGroup registered to the scene as a CollectionProperty; not sure if any of that's relevant) 3. The project is saved, then Blender & the project file are closed and reopened 4. The object prints the error above (starting with `ERROR (bke.lib_id):`...) when it is unlinked from the scene or deleted, or even if the PointerProperty from step 1 is referenced via code. I've tried for a few hours now to recreate this in a simple situation with a basic script but I can't do it. It comes up very consistently when using the addon, and given my research I know where the error is coming from, but I'm not sure exactly what to do to simplify it and give exact steps to reproduce. Please let me know what further information I need to give if any. I'm hoping the issue cropping up here will be apparent with what information I've already given. EDIT: I've been asked to include the addon as well as an example file. Attached below: [bricker_v2-3-0_demo.zip](https://archive.blender.org/developer/F9589608/bricker_v2-3-0_demo.zip) [ID User Decriment Error.blend](https://archive.blender.org/developer/F9589610/ID_User_Decriment_Error.blend) Exact steps to reproduce: 1. Open the attached blend file 2. Install the attached addon 3. Run {nav Bricker > Delete Model} from the right hand 'UI' menu 4. Note the error printed to the terminal. This printout comes from line 297 in 'bricker/operators/delete_model.py'

Added subscriber: @bblanimation

Added subscriber: @bblanimation
Member

Added subscriber: @lichtwerk

Added subscriber: @lichtwerk
Member

Changed status from 'Needs Triage' to: 'Needs User Info'

Changed status from 'Needs Triage' to: 'Needs User Info'
Member

We also had e.g.
#71250 (ID user decrement error for Collections with ID properties in ViewLayer) or
#81345 (ID user decrement error when removing object which is referred to with a PointerProperty)

But to really proceedwith this issue, we'd have to have an example, reproducable script snippet where this happens.
Please continue to investigate if this can be reproduced in a simple scenario, as an alternative, you could also show this in the "real" Addon and share this here (with repro steps)

Will mark as "Needs Info from User" for now.

We also had e.g. #71250 (ID user decrement error for Collections with ID properties in ViewLayer) or #81345 (ID user decrement error when removing object which is referred to with a PointerProperty) But to really proceedwith this issue, we'd have to have an example, reproducable script snippet where this happens. Please continue to investigate if this can be reproduced in a simple scenario, as an alternative, you could also show this in the "real" Addon and share this here (with repro steps) Will mark as "Needs Info from User" for now.

Added subscriber: @rjg

Added subscriber: @rjg

Could you provide us with a link to the add-on? It might be that it is improperly implemented and does something that is not permitted. For instance it may keep references to data while modifying the container. Common mistakes that can lead to crashes are explained in the Gotcha page of the API docs.

Could you provide us with a link to the add-on? It might be that it is improperly implemented and does something that is not permitted. For instance it may keep references to data while modifying the container. Common mistakes that can lead to crashes are explained in the [Gotcha page ](https://docs.blender.org/api/current/info_gotcha.html#help-my-script-crashes-blender) of the API docs.

Added subscriber: @mont29

Added subscriber: @mont29

@lichtwerk please do not tag projects until report is fully validated. only adds noise in those projects then.

@lichtwerk please do not tag projects until report is fully validated. only adds noise in those projects then.

Sure thing – I've attached the addon as well as an example file above. I double checked the code where the error occurs and there are no lingering references to the data after it's removed, as far as I can tell.

Sure thing – I've attached the addon as well as an example file above. I double checked the code where the error occurs and there are no lingering references to the data after it's removed, as far as I can tell.

Update: I also tried modifying the list created at line 284 of 'bricker/operators/delete_model.py' so that it simply stores the names of the objects rather than references to them. This didn't fix the issue - still got the same error.

Update: I also tried modifying the list created at line 284 of 'bricker/operators/delete_model.py' so that it simply stores the names of the objects rather than references to them. This didn't fix the issue - still got the same error.
Member

Changed status from 'Needs User Info' to: 'Needs Triage'

Changed status from 'Needs User Info' to: 'Needs Triage'
Member

First note: you are overriding existing operators:

  • OBJECT_OT_duplicate_move_override uses bl_idname = "object.duplicate_move"
  • OBJECT_OT_duplicate_override uses bl_idname = "object.duplicate"
  • OBJECT_OT_delete_override uses bl_idname = "object.delete"

Not 100% this is officially supported? Is this documented suggested somwhere?
Installing the Addon in a Debug build will already assert:

BLI_assert failed: source/blender/blenlib/intern/BLI_ghash.c:462, ghash_insert_ex(), at '(gh->flag & GHASH_FLAG_ALLOW_DUPES) || (BLI_ghash_haskey(gh, key) == 0)'

Simply tried renaming the operators (of course this will probably do something completely different then), Assert goes away, and the "ID user decrement error" also goes away.
WIth the original Addon, when removing Bricker_Cube_parent, it will have LIB_FAKEUSER, with my changes it wont.

First note: you are overriding existing operators: - OBJECT_OT_duplicate_move_override uses bl_idname = "object.duplicate_move" - OBJECT_OT_duplicate_override uses bl_idname = "object.duplicate" - OBJECT_OT_delete_override uses bl_idname = "object.delete" Not 100% this is officially supported? Is this documented suggested somwhere? Installing the Addon in a Debug build will already assert: ``` BLI_assert failed: source/blender/blenlib/intern/BLI_ghash.c:462, ghash_insert_ex(), at '(gh->flag & GHASH_FLAG_ALLOW_DUPES) || (BLI_ghash_haskey(gh, key) == 0)' ``` Simply tried renaming the operators (of course this will probably do something completely different then), Assert goes away, and the "ID user decrement error" also goes away. WIth the original Addon, when removing `Bricker_Cube_parent`, it will have `LIB_FAKEUSER`, with my changes it wont.
Member

Will need to have another look with fresh eyes (above is not the root cause, it is just another issue with this particular Addon).
Of course it would help to isolate this as much as possible {same as in #81345}, but will check again next week.

Will need to have another look with fresh eyes (above is not the root cause, it is just another issue with this particular Addon). Of course it would help to isolate this as much as possible {same as in #81345}, but will check again next week.
Member

Changed status from 'Needs Triage' to: 'Needs User Info'

Changed status from 'Needs Triage' to: 'Needs User Info'
Member

@bblanimation: sorry, but given the fact that this might turn out to be a bag of mixed issues, I would like to ask for a simplified / more isolated example code snippet.

@bblanimation: sorry, but given the fact that this might turn out to be a bag of mixed issues, I would like to ask for a simplified / more isolated example code snippet.
Member

Changed status from 'Needs User Info' to: 'Archived'

Changed status from 'Needs User Info' to: 'Archived'
Member

Afraid we have to close this now, please report this again if you can isolate this to a minimal script example as in #81345.

No activity for more than a week. As per the tracker policy we assume the issue is gone and can be closed.
Thanks again for the report. If the problem persists please open a new report with the required information.

Afraid we have to close this now, please report this again if you can isolate this to a minimal script example as in #81345. No activity for more than a week. As per the tracker policy we assume the issue is gone and can be closed. Thanks again for the report. If the problem persists please open a new report with the required information.
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#84885
No description provided.