<p>pespin <strong>uploaded patch set #2</strong> to this change.</p><p><a href="https://gerrit.osmocom.org/c/libosmocore/+/26089">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">logging: Fix double lock of log_tgt_mutex<br><br>Recent commit introduced the "blocking-io" param to "log stderr" VTY<br>command, which calls log_target_file_switch_to_{stream,wqueue}.<br>The VTY command already locks the log_tgt_mutex mutex, since it has to<br>access the tgt list. However, the functions mention above also want to<br>lock the same mutex in order to log information. Let's drop the logging<br>to avoid the double lock, and update its documentation to mention it<br>must be called with the lock already held, as documented on other<br>similar functions.<br><br>The issue can be spotted when running osmo-trx-uhd:<br>"""<br>(gdb) bt<br> #0  0x00007ffff75d7600 in __lll_lock_wait () from /usr/lib/libpthread.so.0<br> #1  0x00007ffff75d0503 in pthread_mutex_lock () from /usr/lib/libpthread.so.0<br> #2  0x00007ffff66314fb in log_tgt_mutex_lock_impl () at /git/libosmocore/src/logging.c:130<br> #3  0x00007ffff6638e74 in log_check_level (subsys=8, subsys@entry=-1, level=level@entry=3) at /git/libosmocore/src/logging.c:1510<br> #4  0x00007ffff6639c91 in log_target_file_switch_to_wqueue (target=target@entry=0x611000000320) at /git/libosmocore/src/logging.c:1186<br> #5  0x00007ffff68565d3 in cfg_log_stderr (self=<optimized out>, vty=0x6140000018a0, argc=0, argv=<optimized out>) at /git/libosmocore/src/vty/logging_vty.c:859<br> #6  0x00007ffff683db3d in cmd_execute_command_strict (vline=0x60b0000dfe80, vty=vty@entry=0x6140000018a0, cmd=cmd@entry=0x0) at /git/libosmocore/src/vty/command.c:2768<br> 7  0x00007ffff683e396 in config_from_file (vty=vty@entry=0x6140000018a0, fp=fp@entry=0x615000036400) at /git/libosmocore/src/vty/command.c:2880<br> 8  0x00007ffff684cedb in vty_read_config_filep (confp=confp@entry=0x615000036400, priv=priv@entry=0x0) at /git/libosmocore/src/vty/vty.c:1529<br> 9  0x00007ffff684ebfc in vty_read_config_file (file_name=0x7fffffffe7d8 "/build/new/conf/osmo-trx-uhd.cfg", priv=0x0) at /git/libosmocore/src/vty/vty.c:1920<br> 10 0x0000555555565270 in main (argc=3, argv=0x7fffffffe3c8) at /git/osmo-trx/Transceiver52M/osmo-trx.cpp:652<br>"""<br><br>Debugged by rebuilding libosmocore with "LOG_MTX_DEBUG 1":<br>"""<br>/libosmocore/src/logging.c:1510 [log_check_level] lock<br>/libosmocore/src/logging.c:1522 [log_check_level] unlock<br>/libosmocore/src/vty/logging_vty.c:844 [cfg_log_stderr] lock<br>/libosmocore/src/logging.c:1510 [log_check_level] lock<br>"""<br>Fixes: b72867f0e68c96ca25e1f9929ce92be0a802db6b<br>Related: OS#4311<br>Change-Id: Idb4215fa2f364e28c0bb73fb9975b6c9f50a46f6<br>---<br>M src/logging.c<br>1 file changed, 6 insertions(+), 36 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/89/26089/2</pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/libosmocore/+/26089">change 26089</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.osmocom.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.osmocom.org/c/libosmocore/+/26089"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: libosmocore </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: Idb4215fa2f364e28c0bb73fb9975b6c9f50a46f6 </div>
<div style="display:none"> Gerrit-Change-Number: 26089 </div>
<div style="display:none"> Gerrit-PatchSet: 2 </div>
<div style="display:none"> Gerrit-Owner: pespin <pespin@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins Builder </div>
<div style="display:none"> Gerrit-MessageType: newpatchset </div>