Skip to content

ares_destroy() race condition during shutdown due to missing lock#831

Merged
bradh352 merged 3 commits intoc-ares:mainfrom
bradh352:cleanup_fixes
Jul 24, 2024
Merged

ares_destroy() race condition during shutdown due to missing lock#831
bradh352 merged 3 commits intoc-ares:mainfrom
bradh352:cleanup_fixes

Conversation

@bradh352
Copy link
Member

When using EventThreads, the config change cleanup code might manipulate the event update list if it uses file descriptors (such as on Linux). This was being done without a lock. Rework the event enqueuing to handle locking internally to prevent this and to simplify where it is used. This was found by chance during an ASAN CI run.

Fix By: Brad House (@bradh352)

@bradh352 bradh352 merged commit d4282d7 into c-ares:main Jul 24, 2024
bradh352 added a commit that referenced this pull request Jul 24, 2024
…831)

When using EventThreads, the config change cleanup code might manipulate
the event update list if it uses file descriptors (such as on Linux).
This was being done without a lock. Rework the event enqueuing to handle
locking internally to prevent this and to simplify where it is used.
This was found by chance during an ASAN CI run.

Fix By: Brad House (@bradh352)
bradh352 added a commit that referenced this pull request Jul 24, 2024
…831)

When using EventThreads, the config change cleanup code might manipulate
the event update list if it uses file descriptors (such as on Linux).
This was being done without a lock. Rework the event enqueuing to handle
locking internally to prevent this and to simplify where it is used.
This was found by chance during an ASAN CI run.

Fix By: Brad House (@bradh352)
bradh352 added a commit that referenced this pull request Jul 24, 2024
…831)

When using EventThreads, the config change cleanup code might manipulate
the event update list if it uses file descriptors (such as on Linux).
This was being done without a lock. Rework the event enqueuing to handle
locking internally to prevent this and to simplify where it is used.
This was found by chance during an ASAN CI run.

Fix By: Brad House (@bradh352)
bradh352 added a commit that referenced this pull request Jul 24, 2024
…831)

When using EventThreads, the config change cleanup code might manipulate
the event update list if it uses file descriptors (such as on Linux).
This was being done without a lock. Rework the event enqueuing to handle
locking internally to prevent this and to simplify where it is used.
This was found by chance during an ASAN CI run.

Fix By: Brad House (@bradh352)
@bradh352 bradh352 deleted the cleanup_fixes branch July 25, 2024 14:07
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.

1 participant