Import WLOG no longer working

Linus Torvalds torvalds at linux-foundation.org
Fri Aug 14 13:27:00 PDT 2020


On Fri, Aug 14, 2020 at 12:34 PM Dirk Hohndel <dirk at 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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch
Type: application/octet-stream
Size: 596 bytes
Desc: not available
URL: <http://lists.subsurface-divelog.org/pipermail/subsurface/attachments/20200814/1b8dc096/attachment.obj>


More information about the subsurface mailing list