On Fri, Aug 14, 2020 at 12:34 PM Dirk Hohndel <d...@hohndel.org> wrote: > > So we are merging dives and are renumbering cylinders, and then things go > kaboom here: > > static void event_renumber(struct event *ev, const int mapping[]) > ... > ev->gas.index = mapping[ev->gas.index]; > > Line 2139 is that last assignment. > Since you are compiling from source, Salvador, could you insert an fprintf > there that prints out the value of and ev->gas.index ? > My guess is that that's a bogus value and we are accessing memory we should > access here. > > Linus, any other guesses?
This actually was completely rewritten by Berthold in commit 8c2383b49 ("Undo: don't modify source-dives on merge"), so I'm adding him to the cc. gdb says that "mapping=0x5555592a3400" which looks like a valid pointer, So does ev=0x55555906a9b0. They might have been free'd of course. But yeah, at a guess the gas.index is some random number and printing it out would confirm that. That said, looking at that commit, I feel I found a completely unrelated bug. In "merge_events()" we stop merging aftrer we've done *one* event from a divecomputer when we've run out of events from the other divecomputer. That's not in this particular path, but it would seem to lose events when merging thing. Berthold? The old code just added the whole remaining list to the end (which is why it could just stop), the new code after that "don't modify source dives" commit does events one at a time, and needs to go on. Maybe something like the attached, but let's see what Berthold says. But this is a totally different path than the one that causes problems for Manfred. Linus
patch
Description: Binary data
_______________________________________________ subsurface mailing list subsurface@subsurface-divelog.org http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface