Crash while editing keymap entry (MacOS only) #119014
Labels
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset System
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Code Documentation
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
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
Viewport & EEVEE
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Asset Browser Project
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
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
Module
Viewport & EEVEE
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Severity
High
Severity
Low
Severity
Normal
Severity
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
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#119014
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
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
Operating system: macOS Sonoma 14.2
Processor: 2.6 GHz 6-Core Intel Core i7
Graphics card: AMD Radeon Pro 530M 4 GB
Blender Version
Broken: Current
main
,434759d3339
Worked: 4.1.0,
3d6bb6ce04ad
, blender-v4.1-release, 2024-02-29Short description of error
Blender encounters a segfault when editing the
Identifier
property in the keymap preferences.Exact steps for others to reproduce the error
crash.txt
Threw an assert in the sort comparison function here in
interface_utils.cc
, a isnullptr
occasionallySuspect it's
b9ed6ce0a5d12ab706b14ecdab63415faf87054d
causing this but because this is before the git-lfs change I haven't spent time setting up an env with those libraries around still.Can't confirm.
Hmm, I wonder if I have a weird cached file or something. I'll try a clean build in with factory startup tomorrow.
Also can't confirm on Linux.
Ok, I removed any build artifacts that were in the parent directly (
build_darwin_*
), performedran Blender with
../build_darwin_lite/bin/Blender.app/Contents/MacOS/Blender --factory-startup
and I still get the same crash.I'm also able to replicate this on the current daily
4.2.0
build (b0daa792d3b5
) for Intel Mac from the builds page.Unable to confirm either in debug build
8c16b612ca8820503c455eca4603240e6b9bb503
(on Windows btw)Will check on Mac then, perhaps this is platform specific.
Can indeed confirm on Mac
Crash while editing keymap entryto Crash while editing keymap entry (MacOS only)I think I've nailed down the issue to being something in the
std::sort
function - I tried swapping out blender'sVector
class forstd::vector
in that particular code block and still run into the same crash where one of theunique_ptr
s suddenly isnullptr
after about 2k iterations of the comparison function.Observing all the pointers prior to the sort being called shows no signs of
nullptr
No exception is thrown, if to change comparator to:
I suspect that some values in a list with condition
BLI_strcasecmp_natural(a->name.c_str(), b->name.c_str()) <= 0
drives Mac's
std::sort
implementation crazy.While writing this also find out that if to change
<= 0
to< 0
it also works, but I don't know reasoning behind expression.This discussion on the libc++ forum seems possibly related: https://discourse.llvm.org/t/rfc-strict-weak-ordering-checks-in-the-debug-libc/70217
This discussion seems relevant: https://reviews.llvm.org/D146421, specifically the following bit
My guess is that
libc++
's particular implementation ofstd::sort
takes advantage of strict weak ordering somewhere that causes this odd behavior.#93285 had a similar issue - I think the correct move here is to apply the change to use
<
over<=
and then clean up any other usage of this elsewhere in the codebase since this is out of spec with the requirements on Compare