<div dir="ltr"><div>Good night.<br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">El vie., 14 ago. 2020 a las 22:27, Linus Torvalds (<<a href="mailto:torvalds@linux-foundation.org">torvalds@linux-foundation.org</a>>) escribió:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Fri, Aug 14, 2020 at 12:34 PM Dirk Hohndel <<a href="mailto:dirk@hohndel.org" target="_blank">dirk@hohndel.org</a>> wrote:<br>
><br>
> So we are merging dives and are renumbering cylinders, and then things go kaboom here:<br>
><br>
> static void event_renumber(struct event *ev, const int mapping[])<br>
>  ...<br>
> ev->gas.index = mapping[ev->gas.index];<br>
><br>
> Line 2139 is that last assignment.<br>
> Since you are compiling from source, Salvador, could you insert an fprintf there that prints out the value of and ev->gas.index ?<br>
> My guess is that that's a bogus value and we are accessing memory we should access here.<br></blockquote><div><br></div><div>Dive num = 394 -- ev type = 11<br>ev->gas,index = 1<br>Dive num = 398 -- ev type = 11<br>ev->gas,index = 1<br>Dive num = 401 -- ev type = 25<br>ev->gas,index = 0<br>Dive num = 401 -- ev type = 6<br>Dive num = 401 -- ev type = 3<br>Dive num = 401 -- ev type = 3<br>Dive num = 401 -- ev type = 3<br>Dive num = 401 -- ev type = 6<br>Dive num = 401 -- ev type = 25<br>ev->gas,index = 270305728<br>Violación de segmento</div><div><br></div><div>You were right, off course Dirk, look at the last line before the segfault.</div><div>I've pasted the previous lines because they are wrong too ... Dive 401 has just a single event type 25, following events are wrong and, most probably come from following dives.</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
But yeah, at a guess the gas.index is some random number and printing<br>
it out would confirm that.<br>
<br></blockquote><div> </div><div>Yes, seems completely random.</div><div><br></div><div>BTW, Manfred's workflow to add dives to the log is quite unusual and I think it could be interesting to be considered.  Manfred downloads his dives on Wlog and then imports the whole file (>1200 dives) in his current subsurface divelog, so a lot of dives, tanks and events are reworked each time he does this process. In fact, importing the dives to a xml file, removing the duplicities and then importing the rest of dives to the divelog, works like a charm.</div><div><br></div><div>Salva.<br></div></div></div>