<div dir="ltr">> Is this also covered in gerrit review for some of your patches like 933 <br>> or 1628?<br><br>Yeah, it's covered by <a href="https://gerrit.osmocom.org/#/c/933/">https://gerrit.osmocom.org/#/c/933/</a> , and this is<br>exactly the reason, why the change isn't ready to merge yet :(<br><br><br>Well, some more details:<br># valgrind --track-origins=yes tests/coding/.libs/lt-coding_test<br><br>==27652== Memcheck, a memory error detector<br>==27652== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.<br>==27652== Using Valgrind-3.10.1 and LibVEX; rerun with -h for copyright info<br>==27652== Command: tests/coding/.libs/lt-coding_test<br>==27652==<br>xcch_decode: n_errors=60 n_bits_total=456 ber=0.13<br>xcch_decode: n_errors=60 n_bits_total=456 ber=0.13<br>xcch_decode: n_errors=60 n_bits_total=456 ber=0.13<br>tch_fr_decode: n_errors=8 n_bits_total=378 ber=0.02<br>tch_fr_decode: n_errors=8 n_bits_total=378 ber=0.02<br>tch_fr_decode: n_errors=10 n_bits_total=456 ber=0.02<br>tch_fr_decode: n_errors=10 n_bits_total=456 ber=0.02<br>tch_fr_decode: n_errors=10 n_bits_total=456 ber=0.02<br>==27652== Conditional jump or move depends on uninitialised value(s)<br>==27652==    at 0x400F49: ubits2sbits (coding_test.c:48)<br>==27652==    by 0x401416: test_hr (coding_test.c:290)<br>==27652==    by 0x400D62: main (coding_test.c:486)<br>==27652==  Uninitialised value was created by a stack allocation<br>==27652==    at 0x4E402ED: gsm0503_tch_hr_encode (gsm0503_coding.c:1839)<br>==27652== <br>==27652== Conditional jump or move depends on uninitialised value(s)<br>==27652==    at 0x400F4E: ubits2sbits (coding_test.c:54)<br>==27652==    by 0x401416: test_hr (coding_test.c:290)<br>==27652==    by 0x400D62: main (coding_test.c:486)<br>==27652==  Uninitialised value was created by a stack allocation<br>==27652==    at 0x4E402ED: gsm0503_tch_hr_encode (gsm0503_coding.c:1839)<br>==27652== <br>==27652== Conditional jump or move depends on uninitialised value(s)<br>==27652==    at 0x5422CCE: osmo_conv_decode_scan (conv.c:394)<br>==27652==    by 0x54231E8: osmo_conv_decode (conv.c:616)<br>==27652==    by 0x4E3D677: osmo_conv_decode_ber (gsm0503_coding.c:469)<br>==27652==    by 0x4E3FFCD: gsm0503_tch_hr_decode (gsm0503_coding.c:1818)<br>==27652==    by 0x40144A: test_hr (coding_test.c:336)<br>==27652==    by 0x400D62: main (coding_test.c:486)<br>==27652==  Uninitialised value was created by a stack allocation<br>==27652==    at 0x4E3FF30: gsm0503_tch_hr_decode (gsm0503_coding.c:1763)<br>==27652== <br>==27652== Conditional jump or move depends on uninitialised value(s)<br>==27652==    at 0x5422D08: osmo_conv_decode_scan (conv.c:403)<br>==27652==    by 0x54231E8: osmo_conv_decode (conv.c:616)<br>==27652==    by 0x4E3D677: osmo_conv_decode_ber (gsm0503_coding.c:469)<br>==27652==    by 0x4E3FFCD: gsm0503_tch_hr_decode (gsm0503_coding.c:1818)<br>==27652==    by 0x40144A: test_hr (coding_test.c:336)<br>==27652==    by 0x400D62: main (coding_test.c:486)<br>==27652==  Uninitialised value was created by a stack allocation<br>==27652==    at 0x4E3FF30: gsm0503_tch_hr_decode (gsm0503_coding.c:1763)<br>==27652== <br>==27652== Conditional jump or move depends on uninitialised value(s)<br>==27652==    at 0x5422F91: osmo_conv_decode_flush (conv.c:509)<br>==27652==    by 0x5423235: osmo_conv_decode (conv.c:619)<br>==27652==    by 0x4E3D677: osmo_conv_decode_ber (gsm0503_coding.c:469)<br>==27652==    by 0x4E3FFCD: gsm0503_tch_hr_decode (gsm0503_coding.c:1818)<br>==27652==    by 0x40144A: test_hr (coding_test.c:336)<br>==27652==    by 0x400D62: main (coding_test.c:486)<br>==27652==  Uninitialised value was created by a stack allocation<br>==27652==    at 0x4E3FF30: gsm0503_tch_hr_decode (gsm0503_coding.c:1763)<br>==27652== <br>==27652== Conditional jump or move depends on uninitialised value(s)<br>==27652==    at 0x4E3D72C: osmo_conv_decode_ber (gsm0503_coding.c:480)<br>==27652==    by 0x4E3FFCD: gsm0503_tch_hr_decode (gsm0503_coding.c:1818)<br>==27652==    by 0x40144A: test_hr (coding_test.c:336)<br>==27652==    by 0x400D62: main (coding_test.c:486)<br>==27652==  Uninitialised value was created by a stack allocation<br>==27652==    at 0x4E3FF30: gsm0503_tch_hr_decode (gsm0503_coding.c:1763)<br>==27652== <br>tch_hr_decode: n_errors=11 n_bits_total=211 ber=0.05<br>tch_hr_decode: n_errors=10 n_bits_total=456 ber=0.02<br>tch_hr_decode: n_errors=10 n_bits_total=456 ber=0.02<br>tch_hr_decode: n_errors=10 n_bits_total=456 ber=0.02<br>pdtch_decode: n_errors=0 n_bits_total=456 ber=0.00<br>pdtch_decode: n_errors=132 n_bits_total=588 ber=0.22<br>pdtch_decode: n_errors=220 n_bits_total=676 ber=0.33<br>pdtch_decode: n_errors=0 n_bits_total=444 ber=0.00<br>pdtch_decode: n_errors=0 n_bits_total=456 ber=0.00<br>pdtch_decode: n_errors=132 n_bits_total=588 ber=0.22<br>pdtch_decode: n_errors=220 n_bits_total=676 ber=0.33<br>pdtch_decode: n_errors=0 n_bits_total=444 ber=0.00<br>Success<br>==27652== <br>==27652== HEAP SUMMARY:<br>==27652==     in use at exit: 0 bytes in 0 blocks<br>==27652==   total heap usage: 2,367 allocs, 2,367 frees, 397,488 bytes allocated<br>==27652== <br>==27652== All heap blocks were freed -- no leaks are possible<br>==27652== <br>==27652== For counts of detected and suppressed errors, rerun with: -v<br>==27652== ERROR SUMMARY: 7041 errors from 6 contexts (suppressed: 0 from 0)<br><br>I paid my attention on the "Uninitialised value was created by a stack<br>allocation" warning, and merely used memset() to fill some arrays by 0x00<br>in the gsm0503_tch_hr_decode(). And... it was the first time when I got<br>successful build on Jenkins! This is the temporary solution:<br><br>sbit_t iB[912], cB[456], h;<br>ubit_t conv[98], b[112], d[112], p[3];<br>int i, rv, steal = 0;<br><br>/**<br> * Fix valgrind warnings:<br> * "Uninitialised value was created by a stack allocation"<br> * "Conditional jump or move depends on uninitialised value(s)"<br> */<br>memset(iB, 0x00, sizeof(iB));<br><br>Then I started to dig deeper into the code, and used memset()<br>one more time: <a href="http://pastebin.com/jBJT3q6R">http://pastebin.com/jBJT3q6R</a><br><br>This dirty printf based debug led me closer to the problem. We are getting<br>different results (successes and fails) because the gsm0503_tch_burst_map()<br>refers to uninitialized value at iB[353].<br><br>Now we need to find out, where is the bug. There are two assumptions:<br><br>1) The gsm0503_tch_hr_interleave() doesn't initialize the iB[353];<br>2) The gsm0503_tch_burst_map() refers to the value which it shouldn't<br>   refer to.<br><br><br clear="all"><div><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div>With best regards,<br></div><div>Vadim Yanitskiy.<br></div></div></div></div></div></div>
</div>