trip merging bug

Dirk Hohndel dirk at hohndel.org
Thu Dec 6 13:30:33 PST 2012


I just pushed two new test dives that trigger two bugs.

One of the bugs happens when loading those two xml files which each
contain a trip with the same start time. Our insert_trip routine tries
to keep just one of those two trips, but doesn't go all the way and
leaves the internal data structures in a very odd state where one of the
trips can't be reached through the dive_trip_list, but still is
referenced by a dive. Because of this fill_dive_list shows two trips in
the dive list. Now trying to merge those two trips ended up with
merge_trips_cb in an infinite loop.

I also pushed out a patch for that bug (including an assert in case some
other code path can get us into the same infinite loop in
merge_trips_cb).

Now if you load those two trips you get two dives that are rather close
together and are both rather artificial (i.e., have only very very few
samples). Merging those two dives triggers a different bug in the dive
merging code... we fill in the gap between the samples WITHIN each of
the dives with surface time - which is clearly a bug. We should only
fill in surface time between the end of the first and the beginning of
the second dive.

Linus, could you look at that and fix it?

Thanks

/D


More information about the subsurface mailing list