[jira] [Comment Edited] (PROTON-2792) [cpp] Segmentation fault in container::impl::run_timer_jobs

2024-02-08 Thread Martin Zlomek (Jira)


[ 
https://issues.apache.org/jira/browse/PROTON-2792?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17815748#comment-17815748
 ] 

Martin Zlomek edited comment on PROTON-2792 at 2/8/24 5:05 PM:
---

Of course, there might be a competing thread, e.g. the app can call 
{{schedule()}} or {{cancel()}} as I mentioned in the Description, 
{{is_active_}} should be protected for the same reason as {{{}deferred_{}}}.


was (Author: JIRAUSER304126):
Of course, there might be a competing thread, e.g. the app can call 
{{schedule()}} or {{cancel()}} as I mentioned in the Description, 
{{is_active_}} should be protected from the same reason as {{deferred_}}.

> [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-unsubscr...@qpid.apache.org
For additional commands, e-mail: dev-h...@qpid.apache.org



[jira] [Comment Edited] (PROTON-2792) [cpp] Segmentation fault in container::impl::run_timer_jobs

2024-02-08 Thread Martin Zlomek (Jira)


[ 
https://issues.apache.org/jira/browse/PROTON-2792?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17815762#comment-17815762
 ] 

Martin Zlomek edited comment on PROTON-2792 at 2/8/24 4:58 PM:
---

I actually have 2 stack traces:

(gdb) p info->si_signo
$14 = 11

(gdb) p info->_sifields._sigfault
$16 = {
  si_addr = 0x8,

(gdb) p is_active_
$17 = std::unordered_set with 10 elements =

{   [0] = 24,   [1] = 23,   [2] = 22,   [3] = 21,   [4] = 16,   [5] = 17,   [6] 
= 18,   [7] = 19,   [8] = 20 }

(gdb) p current_work_handle_
$18 = 25
{noformat}
#3  
#4  0x7f1b8eb417c6 in std::equal_to::operator() 
(__y=, __x=, this=)
    at /opt/rh/gcc-toolset-11/root/usr/include/c++/11/bits/stl_function.h:370
#5  std::__detail::_Hashtable_base, std::hash, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, 
std::__detail::_Hashtable_traits >::_M_equals (__n=..., 
__c=, __k=, this=)
    at 
/opt/rh/gcc-toolset-11/root/usr/include/c++/11/bits/hashtable_policy.h:1617
#6  std::_Hashtable, std::__detail::_Identity, std::equal_to, 
std::hash, std::__detail::_Mod_range_hashing, 
std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, 
std::__detail::_Hashtable_traits >::_M_find_before_node 
(__code=15, 
    __k=@0x7f1a4a4f4f78: 15, __bkt=1, this=0x158a2b80) at 
/opt/rh/gcc-toolset-11/root/usr/include/c++/11/bits/hashtable.h:1840
#7  std::_Hashtable, std::__detail::_Identity, std::equal_to, 
std::hash, std::__detail::_Mod_range_hashing, 
std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, 
std::__detail::_Hashtable_traits >::_M_find_node (__c=15, 
__key=@0x7f1a4a4f4f78: 15, 
    __bkt=1, this=0x158a2b80) at 
/opt/rh/gcc-toolset-11/root/usr/include/c++/11/bits/hashtable.h:810
#8  std::_Hashtable, std::__detail::_Identity, std::equal_to, 
std::hash, std::__detail::_Mod_range_hashing, 
std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, 
std::__detail::_Hashtable_traits >::find 
(__k=@0x7f1a4a4f4f78: 15, this=0x158a2b80)
    at /opt/rh/gcc-toolset-11/root/usr/include/c++/11/bits/hashtable.h:1610
#9  std::_Hashtable, std::__detail::_Identity, std::equal_to, 
std::hash, std::__detail::_Mod_range_hashing, 
std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, 
std::__detail::_Hashtable_traits >::count 
(__k=@0x7f1a4a4f4f78: 15, this=0x158a2b80)
    at /opt/rh/gcc-toolset-11/root/usr/include/c++/11/bits/hashtable.h:1657
#10 std::unordered_set, 
std::equal_to, std::allocator >::count 
(__x=@0x7f1a4a4f4f78: 15, this=0x158a2b80)
    at /opt/rh/gcc-toolset-11/root/usr/include/c++/11/bits/unordered_set.h:686
#11 proton::container::impl::run_timer_jobs (this=0x158a2ae0)
    at 
/sw/cmqa/migration/PRISMA/thirdparty/qpid-proton/001.000.100/1300.1/x86_64-el8-linux-gnu-gcc11-v11-relwithdebinfofile/_CPackGTS_Packages/workspace/RPM/BUILD/qpid-proton-0.38.0/cpp/src/proactor_container_impl.cpp:545
#12 0x7f1b8eb443fa in proton::container::impl::dispatch 
(this=this@entry=0x158a2ae0, event=0x7f1a49776980)
    at 
/sw/cmqa/migration/PRISMA/thirdparty/qpid-proton/001.000.100/1300.1/x86_64-el8-linux-gnu-gcc11-v11-relwithdebinfofile/_CPackGTS_Packages/workspace/RPM/BUILD/qpid-proton-0.38.0/cpp/src/proactor_container_impl.cpp:580
#13 0x7f1b8eb44a88 in proton::container::impl::thread (this=0x158a2ae0)
    at 
/sw/cmqa/migration/PRISMA/thirdparty/qpid-proton/001.000.100/1300.1/x86_64-el8-linux-gnu-gcc11-v11-relwithdebinfofile/_CPackGTS_Packages/workspace/RPM/BUILD/qpid-proton-0.38.0/cpp/src/proactor_container_impl.cpp:768
#14 0x7f1b8eb44f18 in proton::container::impl::run (this=0x158a2ae0, 
threads=)
    at 
/sw/cmqa/migration/PRISMA/thirdparty/qpid-proton/001.000.100/1300.1/x86_64-el8-linux-gnu-gcc11-v11-relwithdebinfofile/_CPackGTS_Packages/workspace/RPM/BUILD/qpid-proton-0.38.0/cpp/src/proactor_container_impl.cpp:814{noformat}
 

(gdb) p info->si_signo
$2 = 11

(gdb) p info->_sifields._sigfault
$3 = {
  si_addr = 0x7f5539244216,

(gdb) p is_active_
$4 = std::unordered_set with 2 elements =

{   [0] = 14,   [1] = 11403596452484277790,   [2] = 0 }

(gdb) p current_work_handle_
$5 = 16
{noformat}
#3  
#4  0x7f55465147d7 in std::__detail::_Hash_code_base, 
std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, 
false>::_M_hash_code (__k=@0x7f5539244216: 0, this=0x15d4bae0) at 
/opt/rh/gcc-toolset-11/root/usr/include/c++/11/bits/hashtable_policy.h:1219
#5  std::__detail::_Hash_code_base, 
std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, 
false>::_M_bucket_index (__bkt_count=7, __n=..., this=0x15d4bae0) at 
/opt/rh/gcc-toolset-11/root/usr/include/c++/11/bits/hashtable_policy.h:1242
#6  std::_Hashtable, std::__detail::_Identity, std::equal_to, 
std::hash, std::__detail::_Mod_range_hashing, 
std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, 
std::__detail::_Hashtable_traits