<p>Neels Hofmeyr <strong>uploaded patch set #2</strong> to this change.</p><p><a href="https://gerrit.osmocom.org/10636">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">lchan_fsm: lchan_fail_to(): store target state early<br><br>lchan_fail_to() is a macro to preserve useful source file:line information in<br>logging. But a side effect is that its target state argument might evaluate<br>differently at the end of the macro, if, say, the fi->state has changed.<br><br>I hit such an instance on timeout of WAIT_RLL_RTP_ESTABLISH:<br>lchan_fsm_timer_cb() calls macro lchan_fail(), which calls<br>lchan_fail_to(lchan_fsm_on_error[fi->state]). Unlike for normal function<br>invocation, this argument changes as fi->state changes. Since releasing the<br>lchan_rtp_fsm already transitions the lchan fi into WAIT_RF_RELEASE_ACK, the<br>final state change of lchan_fail_to() suddenly evaluates to the broken state<br>instead of the intended WAIT_RF_RELEASE_ACK.<br><br>Early in lchan_fail_to(), store the argument's value as of macro invocation.<br><br>Change-Id: Id9bf4580a112ee5629f553a8bcb6b5b03b1c5f53<br>---<br>M src/osmo-bsc/lchan_fsm.c<br>1 file changed, 3 insertions(+), 1 deletion(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/36/10636/2</pre><p>To view, visit <a href="https://gerrit.osmocom.org/10636">change 10636</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/10636"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: osmo-bsc </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: newpatchset </div>
<div style="display:none"> Gerrit-Change-Id: Id9bf4580a112ee5629f553a8bcb6b5b03b1c5f53 </div>
<div style="display:none"> Gerrit-Change-Number: 10636 </div>
<div style="display:none"> Gerrit-PatchSet: 2 </div>
<div style="display:none"> Gerrit-Owner: Neels Hofmeyr <nhofmeyr@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: Harald Welte <laforge@gnumonks.org> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins Builder (1000002) </div>