Open Rubonnek opened 9 months ago
https://github.com/godotengine/godot/issues/74850#issuecomment-1471063284 I'm still experiencing this deadlock ~5x/day even with version from current github tip...
Related Issues: #76585, #72646
I've stumbled upon a related deadlock I can hit almost constantly with a ThreadSanitizer build (deadlock_mrp.zip) by pressing Space
or Enter
a few times -- the deadlock happens in my case when the LineEdit
is added to the scene.
Here's the relevant ThreadSanitizer log:
As noted in https://github.com/godotengine/godot/pull/72646#issuecomment-1666161105, these TextServer
deadlock warnings seem to be currently supressed in CI:
I don't think they should be -- although hard to reproduce, the same deadlock MRP (deadlock_mrp.zip) sometimes show Object
leaks related to TextServerAdvanced
which I suppose are related to these deadlocks holding resources it shouldn't. More commonly, however, some RefCounted
objects seem to get held in memory as well and reported as leaked when they shouldn't be. This also happens with the same deadlock MRP sometimes where DialogueEngine
(which extends RefCounted
) gets leaked but it shouldn't -- I don't think there's any cyclic reference against DialogueEngine
either that could explain it getting leaked from time to time.
CC @bruvzg
I'll re-check and try to simplify #72646 next week, it was fixing lock order but had some performance impact (and there were no reproducible issues related to it, apart from thread sanitizer report).
Tested versions
63d6bda8e95ac992da74e84b2f3be62f3d85190b - reproducible
System information
Godot v4.3.dev (63d6bda8e) - Arch Linux #1 SMP PREEMPT_DYNAMIC Fri, 02 Feb 2024 17:03:55 +0000 - Tty - Vulkan (Forward+) - dedicated AMD Radeon RX 6900 XT (RADV NAVI21) () - AMD Ryzen 9 5950X 16-Core Processor (32 Threads)
Issue description
Opening the Editor against an empty project with ThreadSanitizer enabled will generate a
lock-order-inversion (potential deadlock)
warning. The Editor deadlocks are quite rare in my computer, but they tend to happen when I close the Editor -- I suppose the ThreadSanitizer warning is related to those deadlocks I've had in the past.Steps to reproduce
If you are on Arch Linux, it seems that linking to
libatomic.a
is unnecessary -- you may need to apply the following patch and try to compile again if it previously failed:Decompress the MRP below and open a terminal at the MRP project path and run:
If the
FATAL: ThreadSanitizer: unexpected memory mapping
error appears, you may need to temporarily lower the ASLR entropy:OR disable ASLR entirely temporarily :
The following ThreadSanitizer warning should appear:
SUMMARY: ThreadSanitizer: lock-order-inversion (potential deadlock) (/opt/godot/bin/godot.linuxbsd.editor.dev.x86_64.llvm.san+0x3b0dd71) (BuildId: 77398a27c54674f8) in pthread_mutex_lock