[asterisk-bugs] [JIRA] (ASTERISK-25782) data race on logger

Corey Farrell (JIRA) noreply at issues.asterisk.org
Fri Feb 12 09:05:32 CST 2016


    [ https://issues.asterisk.org/jira/browse/ASTERISK-25782?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=229438#comment-229438 ] 

Corey Farrell commented on ASTERISK-25782:
------------------------------------------

As with ASTERISK-25783 I'd like to know if this problem can be solved by simply using a volatile.  For this function I'm not keen on using a lock here, {{ast_log_full}} is run so often that we need to be concerned about performance penalty of any additional checks.  Especially since the purpose of this conditional is to avoid creation of a {{struct logmsg}} when it will not be used anyways.

> data race on logger
> -------------------
>
>                 Key: ASTERISK-25782
>                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-25782
>             Project: Asterisk
>          Issue Type: Bug
>      Security Level: None
>    Affects Versions: 13.7.2
>            Reporter: Badalian Vyacheslav
>            Severity: Minor
>
> {code}
> WARNING: ThreadSanitizer: data race (pid=15278)
>   Read of size 4 at 0x7fcb842ff800 by thread T40 (mutexes: write M9761):
>     #0 ast_log_full /root/asterisk/main/logger.c:1922 (asterisk+0x00000050f270)
>     #1 ast_log /root/asterisk/main/logger.c:1991 (asterisk+0x000000510d7f)
>     #2 stun_monitor_request /root/asterisk/res/res_stun_monitor.c:151 (res_stun_monitor.so+0x0000000027d7)
>     #3 ast_sched_runq /root/asterisk/main/sched.c:748 (asterisk+0x00000061019e)
>     #4 sched_run /root/asterisk/main/sched.c:160 (asterisk+0x00000060bc1a)
>     #5 dummy_start /root/asterisk/main/utils.c:1232 (asterisk+0x0000006b6674)
>     #6 <null> <null> (libtsan.so.0+0x000000023659)
>   Previous write of size 4 at 0x7fcb842ff800 by main thread:
>     [failed to restore the stack]
>   Location is global 'global_logmask' of size 4 at 0x7fcb842ff800 (asterisk+0x000000b7a800)
>   Mutex M9761 (0x7fcb749fbc20) 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=15799, 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/main/logger.c:1922 ast_log_full
> ==================
> {code}



--
This message was sent by Atlassian JIRA
(v6.2#6252)



More information about the asterisk-bugs mailing list