Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix a bug in resource monitors yielding a deadlock-caused abort #875

Merged
merged 1 commit into from
Oct 13, 2023

Conversation

pguyot
Copy link
Collaborator

@pguyot pguyot commented Oct 11, 2023

When monitors down handlers were called, the processes table was locked. Yet, monitor down handler might uncarefully need to lock this table, for example to decrement a refc-binary that would be a resource with a down handler.

These changes are made under both the "Apache 2.0" and the "GNU Lesser General
Public License 2.1 or later" license terms (dual license).

SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later

Copy link
Collaborator

@fadushin fadushin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixes crash in OTP socket shutdown tests

src/libAtomVM/context.c Outdated Show resolved Hide resolved
When monitors down handlers were called, the processes table was locked. Yet,
monitor down handler might uncarefully need to lock this table, for example
to decrement a refc-binary that would be a resource with a down handler.

Signed-off-by: Paul Guyot <pguyot@kallisys.net>
@pguyot pguyot force-pushed the w41/fix-resource-monitor-deadlock branch from 88e0068 to d2b21da Compare October 13, 2023 05:30
@bettio bettio merged commit 93b585f into atomvm:master Oct 13, 2023
83 checks passed
@pguyot pguyot deleted the w41/fix-resource-monitor-deadlock branch October 14, 2023 10:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants