<p>Neels Hofmeyr <strong>uploaded patch set #2</strong> to this change.</p><p><a href="https://gerrit.osmocom.org/12388">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">make sure early lchan act failure resets the lchan<br><br>Fix crash after AMR configuration fails.<br><br>The crash is due to an assertion that finds a non-NULL conn in the lchan, when<br>re-using an lchan that has failed in AMR configuration earlier on. That is<br>because the AMR config still happens in state UNUSED.<br><br>  DCHAN ERROR lchan(0-0-2-TCH_F_TCH_H_PDCH-0)[0x6120000066a0]{UNUSED}: (type=TCH_F) lchan allocation failed in state UNUSED: Can not generate multirate configuration IE<br>  ...<br>  DCHAN DEBUG lchan(0-0-2-TCH_F_TCH_H_PDCH-0)[0x6120000066a0]{UNUSED}: (type=TCH_F) After failure handling, already in state UNUSED<br>  ...<br>  ...<br>  DCHAN DEBUG lchan(0-0-2-TCH_F_TCH_H_PDCH-0)[0x6120000066a0]{UNUSED}: Received Event LCHAN_EV_ACTIVATE (lchan_fsm.c:324)<br>  Assert failed !lchan->conn ../../../../src/osmo-bsc/src/osmo-bsc/lchan_fsm.c:491<br><br>The FSM design idea is that when returning to the UNUSED state, all lchan state<br>is cleared. However, when calling lchan_activate(), a failure may happen still<br>in state UNUSED, so that we don't transition *back* to UNUSED properly.<br><br>So, first transition out of UNUSED before failures can happen. (Other ways to<br>solve this would be to invoke lchan clearing even if already in UNUSED, but<br>semantically, transitioning first makes more sense.)<br><br>Upon LCHAN_EV_ACTIVATE, just remember the lchan_activate_info and transition to<br>WAIT_TS_READY, so that on lchan_fail(), we can normally transition back to<br>UNUSED and clear the lchan.<br><br>Move the initial lchan activation code to lchan_fsm_wait_ts_ready_onenter().<br><br>Also, there is a bit of duplication of members of the lchan->activate (lchan<br>state) and the lchan_activate_info (passed to lchan_activate()) structs. The<br>fix for this also removes the dup:<br><br>Add struct lchan_activate_info as child struct at lchan->activate.info, drop<br>the other lchan->activate members that would dup .info.*. Move struct<br>lchan_activate_info declaration to gsm_data.h.<br><br>Apply the new '.info' member struct throughout the code.<br><br>Related: OS#3737<br>Change-Id: Ide665b10fa3f4583059c55346db8da833959e3cc<br>---<br>M include/osmocom/bsc/gsm_data.h<br>M include/osmocom/bsc/lchan_fsm.h<br>M src/osmo-bsc/assignment_fsm.c<br>M src/osmo-bsc/bsc_subscr_conn_fsm.c<br>M src/osmo-bsc/handover_fsm.c<br>M src/osmo-bsc/lchan_fsm.c<br>M src/osmo-bsc/lchan_rtp_fsm.c<br>M src/osmo-bsc/osmo_bsc_bssap.c<br>8 files changed, 105 insertions(+), 107 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/88/12388/2</pre><p>To view, visit <a href="https://gerrit.osmocom.org/12388">change 12388</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/12388"/><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: Ide665b10fa3f4583059c55346db8da833959e3cc </div>
<div style="display:none"> Gerrit-Change-Number: 12388 </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: Jenkins Builder (1000002) </div>
<div style="display:none"> Gerrit-Reviewer: Neels Hofmeyr <nhofmeyr@sysmocom.de> </div>
<div style="display:none"> Gerrit-CC: Pau Espin Pedrol <pespin@sysmocom.de> </div>