<p>Harald Welte has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/10097">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">Make viterbi decoder deterministic in case of bit errors / too few symbols<br><br>Running tetra-rx on a capture with lots of bit errors is not<br>deterministic. Investigation with Valgrind shows various errors about<br>uninitialised values in libosmocore's viterbi decoder.<br><br>The cause appears to lie in @lower_mac/viterbi.c@. The only function<br>there allocates space for 864 symbols and then fills it with the symbols<br>received. However, sym_count is sometimes less than 864, leaving the<br>rest of the array uninitialized.<br><br>Initializing it with @int8_t vit_inp[864*4] = {0};@ fixes the problem.<br><br>Change-Id: Ib745c387e21fb81afef69efcf7e46d5d49331c8f<br>Fixes: OS#3410<br>---<br>M src/lower_mac/viterbi.c<br>1 file changed, 1 insertion(+), 1 deletion(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/osmo-tetra refs/changes/97/10097/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/src/lower_mac/viterbi.c b/src/lower_mac/viterbi.c</span><br><span>index 86aff77..b6f12c1 100644</span><br><span>--- a/src/lower_mac/viterbi.c</span><br><span>+++ b/src/lower_mac/viterbi.c</span><br><span>@@ -5,7 +5,7 @@</span><br><span> </span><br><span> void viterbi_dec_sb1_wrapper(const uint8_t *in, uint8_t *out, unsigned int sym_count)</span><br><span> {</span><br><span style="color: hsl(0, 100%, 40%);">-      int8_t vit_inp[864*4];</span><br><span style="color: hsl(120, 100%, 40%);">+        int8_t vit_inp[864*4] = {0};</span><br><span>         int i;</span><br><span> </span><br><span>   for (i = 0; i < sym_count*4; i++) {</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/10097">change 10097</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/10097"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: osmo-tetra </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: Ib745c387e21fb81afef69efcf7e46d5d49331c8f </div>
<div style="display:none"> Gerrit-Change-Number: 10097 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Harald Welte <laforge@gnumonks.org> </div>