You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Deadlock when array.fromfile re-enters append via __index__ #6549
array.fromfile calls the user-provided f.read(), and that callback can append objects to the same array while it is being resized. The append path grabs the array's write lock before converting the element, then calls the object's __index__. If __index__ performs another array.append (as in the PoC), the second append blocks forever on the already-held PyRwLock, causing a deadlock instead of raising an error.
The issue is unrelated to fromfile; and occurs for several array operations that can call into user code (__index__) while a read or write lock is held; including append, insert, and count.
Each of the methods on ArrayContentType are called with a lock held, and so should not call try_into_from_object.
Activity
coderabbitai commentedon Dec 27, 2025
📝 CodeRabbit Plan Mode
Generate an implementation plan and prompts that you can use with your favorite coding agent.
Examples
🧪 Issue enrichment is currently in open beta.
You can configure auto-planning by selecting labels in the issue_enrichment configuration.
To disable automatic issue enrichment, add the following to your
.coderabbit.yaml:💬 Have feedback or questions? Drop into our discord!
joefarebrother commentedon Jan 1, 2026
The issue is unrelated to
fromfile; and occurs for several array operations that can call into user code (__index__) while a read or write lock is held; includingappend,insert, andcount.Each of the methods on
ArrayContentTypeare called with a lock held, and so should not calltry_into_from_object.youknowone commentedon Oct 6, 2026
The originally deadlocking
array.fromfile+ re-entrant__index__/appendPoC finishes on current main. Closing.— commented by Grok 4.6