You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@qpid.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2024/03/06 19:21:00 UTC
[jira] [Commented] (PROTON-2792) [cpp] Segmentation fault in container::impl::run_timer_jobs
[ https://issues.apache.org/jira/browse/PROTON-2792?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17824146#comment-17824146 ]
ASF GitHub Bot commented on PROTON-2792:
----------------------------------------
astitcher commented on PR #421:
URL: https://github.com/apache/qpid-proton/pull/421#issuecomment-1981610822
There is a clear thread safety violation in ```run_timer_jobs`` use of ```is_active_``` without using the appropriate lock - in fact this is so obvious that I'm puzzled we haven't seen it in the TSAN or even static analyzer runs - maybe we just missed it!
Unfortunately this fix has changed the previous semantics of task cancellation: An important way to cancel a task is from a previous task callback. However this change makes that unreliable as it only checks for task cancellation before executing the entire batch of tasks that are runable at the point where ```run_timer_jobs``` is called. So if an earlier task in the batch cancels a later task in the batch then that cancellation would not be honored.
I'm looking at a fix that should work correctly now and I'll post it here when I'm done.
> [cpp] Segmentation fault in container::impl::run_timer_jobs
> -----------------------------------------------------------
>
> Key: PROTON-2792
> URL: https://issues.apache.org/jira/browse/PROTON-2792
> Project: Qpid Proton
> Issue Type: Bug
> Components: cpp-binding
> Affects Versions: proton-c-0.38.0
> Reporter: Martin Zlomek
> Priority: Major
>
> PROTON-2438 introduced a race condition in [reading|https://github.com/DreamPearl/qpid-proton/blob/8142e3cecd9f668992e76a5448afc09fd7b1030a/cpp/src/proactor_container_impl.cpp#L545] / [writing|https://github.com/DreamPearl/qpid-proton/blob/8142e3cecd9f668992e76a5448afc09fd7b1030a/cpp/src/proactor_container_impl.cpp#L547] {{is_active_}} in [{{run_timer_jobs()}}|https://github.com/DreamPearl/qpid-proton/blob/8142e3cecd9f668992e76a5448afc09fd7b1030a/cpp/src/proactor_container_impl.cpp#L498] while modifying it in [{{schedule()}}|https://github.com/DreamPearl/qpid-proton/blob/8142e3cecd9f668992e76a5448afc09fd7b1030a/cpp/src/proactor_container_impl.cpp#L455] or [{{cancel()}}|https://github.com/DreamPearl/qpid-proton/blob/8142e3cecd9f668992e76a5448afc09fd7b1030a/cpp/src/proactor_container_impl.cpp#L473] at the same time.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For additional commands, e-mail: dev-help@qpid.apache.org