Assert when pack sound in blender DEBUG #97466

Closed
opened 2022-04-20 11:21:04 +02:00 by Marcos Perez · 10 comments
Contributor

System Information
Operating system: Windows 10
Graphics card: Intel

Blender Version
Broken: any tested 3.2 alpha version. For example, last commit: │bf80dc2
It works in "make release" but it fails with "make debug"

Short description of error
with a sound strip selected, you push "pack button" in the "source section" and it crashes with an alert of Assert exception

blender_r8V4q16N70.png

Exact steps for others to reproduce the error
Open Blender --> New file --> Video editor --> Add sound strip -> source -> pack

Output:
blender_crash_tintwotin_20220330.txt

**System Information** Operating system: Windows 10 Graphics card: Intel **Blender Version** Broken: any tested 3.2 alpha version. For example, last commit: │bf80dc2 It works in "make release" but it fails with "make debug" **Short description of error** with a sound strip selected, you push "pack button" in the "source section" and it crashes with an alert of Assert exception ![blender_r8V4q16N70.png](https://archive.blender.org/developer/F13012103/blender_r8V4q16N70.png) **Exact steps for others to reproduce the error** Open Blender --> New file --> Video editor --> Add sound strip -> source -> pack Output: [blender_crash_tintwotin_20220330.txt](https://archive.blender.org/developer/F13012105/blender_crash_tintwotin_20220330.txt)
Author
Contributor

Added subscriber: @pistolario

Added subscriber: @pistolario
Member

Added subscriber: @lichtwerk

Added subscriber: @lichtwerk
Member

Changed status from 'Needs Triage' to: 'Confirmed'

Changed status from 'Needs Triage' to: 'Confirmed'
Member

Can confirm

BLI_assert failed: source/blender/blenkernel/intern/sound.c:250, sound_verify_evaluated_id(), at 'id->tag & (LIB_TAG_COPIED_ON_WRITE | LIB_TAG_COPIED_ON_WRITE_EVAL_RESULT | LIB_TAG_NO_MAIN)'
Aborted (core dumped)
1  __pthread_kill_implementation                                               0x7ffff7a90f0c 
2  raise                                                                       0x7ffff7a40a36 
3  abort                                                                       0x7ffff7a2a82f 
4  _BLI_assert_abort                                BLI_assert.c         46    0x10d5edfe     
5  sound_verify_evaluated_id                        sound.c              250   0x3f814e1      
6  BKE_sound_load                                   sound.c              593   0x3f814e1      
7  sound_pack_exec                                  sound_ops.c          764   0x5869f46      
8  wm_operator_invoke                               wm_event_system.c    1400  0x45c5082      
9  wm_operator_call_internal                        wm_event_system.c    1593  0x45c56da      
10 WM_operator_name_call_ptr                        wm_event_system.c    1641  0x45c58db      
11 WM_operator_name_call_ptr_with_depends_on_cursor wm_event_system.c    1833  0x45c5e93      
12 ui_apply_but_funcs_after                         interface_handlers.c 1008  0x592312f      
13 ui_handler_region_menu                           interface_handlers.c 11396 0x593f848      
14 wm_handler_ui_call                               wm_event_system.c    736   0x45c352a      
15 wm_handlers_do_intern                            wm_event_system.c    3116  0x45c93cf      
16 wm_handlers_do                                   wm_event_system.c    3235  0x45c998e      
17 wm_event_do_handlers                             wm_event_system.c    3825  0x45cb842      
18 WM_main                                          wm.c                 623   0x45bce4e      
19 main                                             creator.c            547   0x3d87c74      
Can confirm ``` BLI_assert failed: source/blender/blenkernel/intern/sound.c:250, sound_verify_evaluated_id(), at 'id->tag & (LIB_TAG_COPIED_ON_WRITE | LIB_TAG_COPIED_ON_WRITE_EVAL_RESULT | LIB_TAG_NO_MAIN)' Aborted (core dumped) ``` ``` 1 __pthread_kill_implementation 0x7ffff7a90f0c 2 raise 0x7ffff7a40a36 3 abort 0x7ffff7a2a82f 4 _BLI_assert_abort BLI_assert.c 46 0x10d5edfe 5 sound_verify_evaluated_id sound.c 250 0x3f814e1 6 BKE_sound_load sound.c 593 0x3f814e1 7 sound_pack_exec sound_ops.c 764 0x5869f46 8 wm_operator_invoke wm_event_system.c 1400 0x45c5082 9 wm_operator_call_internal wm_event_system.c 1593 0x45c56da 10 WM_operator_name_call_ptr wm_event_system.c 1641 0x45c58db 11 WM_operator_name_call_ptr_with_depends_on_cursor wm_event_system.c 1833 0x45c5e93 12 ui_apply_but_funcs_after interface_handlers.c 1008 0x592312f 13 ui_handler_region_menu interface_handlers.c 11396 0x593f848 14 wm_handler_ui_call wm_event_system.c 736 0x45c352a 15 wm_handlers_do_intern wm_event_system.c 3116 0x45c93cf 16 wm_handlers_do wm_event_system.c 3235 0x45c998e 17 wm_event_do_handlers wm_event_system.c 3825 0x45cb842 18 WM_main wm.c 623 0x45bce4e 19 main creator.c 547 0x3d87c74 ```
Philipp Oeser changed title from Assert crash when pack sound in blender DEBUG to Assert when pack sound in blender DEBUG 2022-04-20 16:46:15 +02:00

Added subscribers: @Sergey, @dr.sybren, @mont29

Added subscribers: @Sergey, @dr.sybren, @mont29

This call to BKE_sound_load looks horribly old (from 2008! code) and wrong to me in context of new evaluation with depsgraph, I would expect rather something like that here:

diff --git a/source/blender/editors/sound/sound_ops.c b/source/blender/editors/sound/sound_ops.c
index a63ed142ed8..2f50569c1a8 100644
--- a/source/blender/editors/sound/sound_ops.c
+++ b/source/blender/editors/sound/sound_ops.c
@@ -761,7 +761,7 @@ static int sound_pack_exec(bContext *C, wmOperator *op)
 
   sound->packedfile = BKE_packedfile_new(
       op->reports, sound->filepath, ID_BLEND_PATH(bmain, &sound->id));
-  BKE_sound_load(bmain, sound);
+  DEG_id_tag_update_ex(bmain, &sound->id, ID_RECALC_AUDIO | ID_RECALC_COPY_ON_WRITE);
 
   return OPERATOR_FINISHED;
 }

@Sergey or @dr.sybren, thoughts?

This call to `BKE_sound_load` looks horribly old (from 2008! code) and wrong to me in context of new evaluation with depsgraph, I would expect rather something like that here: ``` diff --git a/source/blender/editors/sound/sound_ops.c b/source/blender/editors/sound/sound_ops.c index a63ed142ed8..2f50569c1a8 100644 --- a/source/blender/editors/sound/sound_ops.c +++ b/source/blender/editors/sound/sound_ops.c @@ -761,7 +761,7 @@ static int sound_pack_exec(bContext *C, wmOperator *op) sound->packedfile = BKE_packedfile_new( op->reports, sound->filepath, ID_BLEND_PATH(bmain, &sound->id)); - BKE_sound_load(bmain, sound); + DEG_id_tag_update_ex(bmain, &sound->id, ID_RECALC_AUDIO | ID_RECALC_COPY_ON_WRITE); return OPERATOR_FINISHED; } ``` @Sergey or @dr.sybren, thoughts?

@mont29 Using DEG_id_tag_update_ex instead of BKE_sound_load is correct. The only thing is that flag should just be ID_RECALC_AUDIO. Basically you almost never want to use explicit ID_RECALC_COPY_ON_WRITE.

@mont29 Using `DEG_id_tag_update_ex` instead of `BKE_sound_load` is correct. The only thing is that flag should just be `ID_RECALC_AUDIO`. Basically you almost never want to use explicit `ID_RECALC_COPY_ON_WRITE`.

@Sergey thanks, will commit fix then

@Sergey thanks, will commit fix then

This issue was referenced by acafc7327e

This issue was referenced by acafc7327ec94358d7b9599a153c509989b809ed

Changed status from 'Confirmed' to: 'Resolved'

Changed status from 'Confirmed' to: 'Resolved'
Bastien Montagne self-assigned this 2022-05-06 15:06:50 +02:00
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
5 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#97466
No description provided.