<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Aug 14, 2020, at 12:20 PM, Salvador Cuñat <<a href="mailto:salvador.cunat@gmail.com" class="">salvador.cunat@gmail.com</a>> wrote:</div><div class=""><div class=""><blockquote type="cite" class="">That's frustrating and shouldn't happen. But the meta data on the cloud server<br class="">show me that Manfred successfully stored data in the cloud from a Windows<br class="">machine earlier today - so I'm not sure that statement is correct, either.<br class=""><br class=""></blockquote>I've finally been able to sync Manfred's cloud log in my laptop and<br class="">reproduce the segfault.<br class=""></div></div></blockquote><br class=""><blockquote type="cite" class=""><div class=""><div class="">This is the backtrace I'm getting:<br class=""><br class="">Thread 1 "subsurface" received signal SIGSEGV, Segmentation fault.<br class="">event_renumber (mapping=0x5555592a3400, ev=0x55555906a9b0) at<br class="">/home/boret/src/subsurface/core/dive.c:2139<br class="">2139        ev->gas.index = mapping[ev->gas.index];<br class="">(gdb) bt<br class=""><br class="">#0  event_renumber (mapping=0x5555592a3400, ev=0x55555906a9b0) at<br class="">/home/boret/src/subsurface/core/dive.c:2139<br class="">#1  event_renumber (mapping=0x5555592a3400, ev=0x55555906a9b0) at<br class="">/home/boret/src/subsurface/core/dive.c:2133<br class=""></div></div></blockquote><div><br class=""></div><div>So we are merging dives and are renumbering cylinders, and then things go kaboom here:</div><div><br class=""></div><div>
<pre style="margin-top: 0px; margin-bottom: 0px;" class=""><!--StartFragment--><span style=" color:#808000;" class="">static</span><span style=" color:#c0c0c0;" class=""> </span><span style=" color:#808000;" class="">void</span><span style=" color:#c0c0c0;" class=""> </span><span style=" font-weight:600; color:#00677c;" class="">event_renumber</span>(<span style=" color:#808000;" class="">struct</span><span style=" color:#c0c0c0;" class=""> </span><span style=" color:#800080;" class="">event</span><span style=" color:#c0c0c0;" class=""> </span>*<span style=" color:#092e64;" class="">ev</span>,<span style=" color:#c0c0c0;" class=""> </span><span style=" color:#808000;" class="">const</span><span style=" color:#c0c0c0;" class=""> </span><span style=" color:#808000;" class="">int</span><span style=" color:#c0c0c0;" class=""> </span><span style=" color:#092e64;" class="">mapping</span>[])</pre>
<pre style="margin-top: 0px; margin-bottom: 0px;" class="">{</pre>
<pre style="margin-top: 0px; margin-bottom: 0px;" class=""><span style=" color:#c0c0c0;" class="">  </span><span style=" color:#808000;" class="">if</span><span style=" color:#c0c0c0;" class=""> </span>(!<span style=" color:#00677c;" class="">event_is_gaschange</span>(<span style=" color:#092e64;" class="">ev</span>))</pre>
<pre style="margin-top: 0px; margin-bottom: 0px;" class=""><span style=" color:#c0c0c0;" class="">          </span><span style=" color:#808000;" class="">return</span>;</pre>
<pre style="margin-top: 0px; margin-bottom: 0px;" class=""><span style=" color:#c0c0c0;" class="">  </span><span style=" color:#808000;" class="">if</span><span style=" color:#c0c0c0;" class=""> </span>(<span style=" color:#092e64;" class="">ev</span>-><span style=" color:#800000;" class="">gas</span>.<span style=" color:#800000;" class="">index</span><span style=" color:#c0c0c0;" class=""> </span><<span style=" color:#c0c0c0;" class=""> </span><span style=" color:#000080;" class="">0</span>)</pre>
<pre style="margin-top: 0px; margin-bottom: 0px;" class=""><span style=" color:#c0c0c0;" class="">          </span><span style=" color:#808000;" class="">return</span>;</pre>
<pre style="margin-top: 0px; margin-bottom: 0px;" class=""><span style=" color:#c0c0c0;" class="">  </span><span style=" color:#092e64;" class="">ev</span>-><span style=" color:#800000;" class="">gas</span>.<span style=" color:#800000;" class="">index</span><span style=" color:#c0c0c0;" class=""> </span>=<span style=" color:#c0c0c0;" class=""> </span><span style=" color:#092e64;" class="">mapping</span>[<span style=" color:#092e64;" class="">ev</span>-><span style=" color:#800000;" class="">gas</span>.<span style=" color:#800000;" class="">index</span>];</pre>
<pre style="margin-top: 0px; margin-bottom: 0px;" class="">}</pre>
<pre style="margin-top: 0px; margin-bottom: 0px;" class=""><br class=""><!--EndFragment--></pre><div class="">Line 2139 is that last assignment.</div><div class="">Since you are compiling from source, Salvador, could you insert an fprintf there that prints out the value of and ev->gas.index ?</div><div class="">My guess is that that's a bogus value and we are accessing memory we should access here.</div></div></div><br class=""><div class="">Linus, any other guesses?</div><div class=""><br class=""></div><div class="">/D</div></body></html>