[Home]

Summary:ASTERISK-25781: res_stun_monitor: Potential data race when accessing data
Reporter:Badalian Vyacheslav (slavon)Labels:
Date Opened:2016-02-11 23:12:18.000-0600Date Closed:2016-02-15 11:14:34.000-0600
Priority:MinorRegression?
Status:Closed/CompleteComponents:Resources/res_stun_monitor
Versions:13.7.2 Frequency of
Occurrence
Related
Issues:
Environment:[root@vm-asterisk04t asterisk]# git branch -v * master a394865 Merge "Resources/res_phoneprov: fix memory leak and heap-use-after-free" Attachments:
Description:{code}
==================
WARNING: ThreadSanitizer: data race (pid=13561)
 Write of size 1 at 0x7f30e8cbcc7c by thread T40 (mutexes: write M9755):
   #0 stun_monitor_request /root/asterisk/res/res_stun_monitor.c:145 (res_stun_monitor.so+0x000000002646)
   #1 ast_sched_runq /root/asterisk/main/sched.c:748 (asterisk+0x00000061019e)
   #2 sched_run /root/asterisk/main/sched.c:160 (asterisk+0x00000060bc1a)
   #3 dummy_start /root/asterisk/main/utils.c:1232 (asterisk+0x0000006b6674)
   #4 <null> <null> (libtsan.so.0+0x000000023659)

 Previous read of size 1 at 0x7f30e8cbcc7c by main thread:
   [failed to restore the stack]

 Location is global 'args' of size 96 at 0x7f30e8cbcc20 (res_stun_monitor.so+0x000000205c7c)

 Mutex M9755 (0x7f30e8cbcc20) created at:
   #0 pthread_mutex_init <null> (libtsan.so.0+0x000000028645)
   #1 __ast_pthread_mutex_init /root/asterisk/main/lock.c:149 (asterisk+0x000000503c43)
   #2 load_module /root/asterisk/res/res_stun_monitor.c:465 (res_stun_monitor.so+0x000000003b79)
   #3 start_resource /root/asterisk/main/loader.c:1015 (asterisk+0x0000004ff12f)
   #4 load_resource_list /root/asterisk/main/loader.c:1213 (asterisk+0x000000500c7c)
   #5 load_modules /root/asterisk/main/loader.c:1361 (asterisk+0x000000501aba)
   #6 asterisk_daemon /root/asterisk/main/asterisk.c:4659 (asterisk+0x0000002d6e5d)
   #7 main /root/asterisk/main/asterisk.c:4230 (asterisk+0x0000002d5cfd)

 Thread T40 (tid=14082, running) created by main thread at:
   #0 pthread_create <null> (libtsan.so.0+0x000000027b07)
   #1 ast_pthread_create_stack /root/asterisk/main/utils.c:1285 (asterisk+0x0000006b6abd)
   #2 ast_sched_start_thread /root/asterisk/main/sched.c:207 (asterisk+0x00000060c24b)
   #3 stun_start_monitor /root/asterisk/res/res_stun_monitor.c:246 (res_stun_monitor.so+0x000000002cf1)
   #4 __reload /root/asterisk/res/res_stun_monitor.c:436 (res_stun_monitor.so+0x000000003a47)
   #5 load_module /root/asterisk/res/res_stun_monitor.c:467 (res_stun_monitor.so+0x000000003b99)
   #6 start_resource /root/asterisk/main/loader.c:1015 (asterisk+0x0000004ff12f)
   #7 load_resource_list /root/asterisk/main/loader.c:1213 (asterisk+0x000000500c7c)
   #8 load_modules /root/asterisk/main/loader.c:1361 (asterisk+0x000000501aba)
   #9 asterisk_daemon /root/asterisk/main/asterisk.c:4659 (asterisk+0x0000002d6e5d)
   #10 main /root/asterisk/main/asterisk.c:4230 (asterisk+0x0000002d5cfd)

SUMMARY: ThreadSanitizer: data race /root/asterisk/res/res_stun_monitor.c:145 stun_monitor_request
==================

{code}
Comments:By: Asterisk Team (asteriskteam) 2016-02-11 23:12:20.460-0600

Thanks for creating a report! The issue has entered the triage process. That means the issue will wait in this status until a Bug Marshal has an opportunity to review the issue. Once the issue has been reviewed you will receive comments regarding the next steps towards resolution.

A good first step is for you to review the [Asterisk Issue Guidelines|https://wiki.asterisk.org/wiki/display/AST/Asterisk+Issue+Guidelines] if you haven't already. The guidelines detail what is expected from an Asterisk issue report.

Then, if you are submitting a patch, please review the [Patch Contribution Process|https://wiki.asterisk.org/wiki/display/AST/Patch+Contribution+Process].

By: Joshua C. Colp (jcolp) 2016-02-15 11:14:34.083-0600

Looking at the usage this is only for suppressing the output of a log message. While it is possible for a race to occur the impact of such is minimal and isn't really worth doing anything about.