Fix rare crashes when reading files with multi-levels of libraries. #114784

Merged
Bastien Montagne merged 1 commits from mont29/blender:tmp-fix-readfile-crash into main 2023-11-13 15:02:11 +01:00

Some left-over code from old refactoring/improvements of old addresses
remapping in library reading code was causing some wrong remapping
between different IDs.

The code was actually not doing what its comment was describing, since
it would cause a random remapping to a different new address than the
expected one:

Initial state, before removed buggy line:
old_addr_1 -> new_addr_1
old_addr_2 -> new_addr_2

End state, if old_addr_2 == new_addr_1:
old_addr_1 -> new_addr_2
old_addr_2 -> new_addr_2

From the description of the removed line, that behavior was actually
already covered by adding the remapping rule in the line above, since
adding a remapping overwrite an existing one if needed, so the line
above would do (in case a placeholder ID existed before the actual ID
got read):

Initial state, before adding new remapping rule:
old_addr_1 -> new_addr_placeholder_1

End state, after adding remapping to newly read ID:
old_addr_1 -> new_addr_1

NOTE: Noticed thanks to rare failures of the liboverride tests on
buildbots. The issue was less than 1%-reproducible with a debug build
and ASAN, but had about 2-4% repducibility with release builds.

Some left-over code from old refactoring/improvements of old addresses remapping in library reading code was causing some wrong remapping between different IDs. The code was actually not doing what its comment was describing, since it would cause a random remapping to a different new address than the expected one: Initial state, before removed buggy line: `old_addr_1 -> new_addr_1` `old_addr_2 -> new_addr_2` End state, if `old_addr_2` == `new_addr_1`: `old_addr_1 -> new_addr_2` `old_addr_2 -> new_addr_2` From the description of the removed line, that behavior was actually already covered by adding the remapping rule in the line above, since adding a remapping overwrite an existing one if needed, so the line above would do (in case a placeholder ID existed before the actual ID got read): Initial state, before adding new remapping rule: `old_addr_1 -> new_addr_placeholder_1` End state, after adding remapping to newly read ID: `old_addr_1 -> new_addr_1` NOTE: Noticed thanks to rare failures of the liboverride tests on buildbots. The issue was less than 1%-reproducible with a debug build and ASAN, but had about 2-4% repducibility with release builds.
Bastien Montagne added 1 commit 2023-11-13 12:13:58 +01:00
buildbot/vexp-code-patch-coordinator Build done. Details
1caa176f32
Fix rare crashes when reading files with multi-levels of libraries.
Some left-over code from old refactoring/improvements of old addresses
remapping in library reading code was causing some wrong remapping
between different IDs.

The code was actually not doing what its comment was describing, since
it would cause a random remapping to a different new address than the
expected one:

Initial state, before removed buggy line:
`old_addr_1 -> new_addr_1`
`old_addr_2 -> new_addr_2`

End state, if `old_addr_2` == `new_addr_1`:
`old_addr_1 -> new_addr_2`
`old_addr_2 -> new_addr_2`

From the description of the removed line, that behavior was actually
already covered by adding the remapping rule in the line above, since
adding a remapping overwrite an existing one if needed, so the line
above would do (in case a placeholder ID existed before the actual ID
got read):

Initial state, before adding new remapping rule:
`old_addr_1 -> new_addr_placeholder_1`

End state, after adding remapping to newly read ID:
`old_addr_1 -> new_addr_1`

NOTE: Noticed thanks to rare failures of the liboverride tests on
buildbots. The issue was less than 1%-reproducible with a debug build
and ASAN, but had about 2-4% repducibility with release builds.
Author
Owner

@blender-bot build

@blender-bot build
Bastien Montagne requested review from Brecht Van Lommel 2023-11-13 12:14:22 +01:00
Author
Owner

NOTE: I would not risk this change into 4.0 at this point, since:

  • Any change there can potentially have dreadful consequences
  • Existing issue is likely very rarely happening in real-life production situation. At least it was never reported.

Could be a good candidate for 4.0.1 though.

CC @ThomasDinges FYI.

NOTE: I would not risk this change into 4.0 at this point, since: * Any change there can potentially have dreadful consequences * Existing issue is likely very rarely happening in real-life production situation. At least it was never reported. Could be a good candidate for 4.0.1 though. CC @ThomasDinges FYI.
Brecht Van Lommel approved these changes 2023-11-13 13:01:23 +01:00
Bastien Montagne merged commit d94281d7af into main 2023-11-13 15:02:11 +01:00
Bastien Montagne deleted branch tmp-fix-readfile-crash 2023-11-13 15:02:13 +01:00
Sign in to join this conversation.
No reviewers
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
2 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#114784
No description provided.