Current subsurface breakage

Linus Torvalds torvalds at linux-foundation.org
Fri Jan 2 18:43:39 PST 2015


So I haven't built subsurface for a while, partly because I haven't
had any diving, and have been very busy with the kernel.

But my kernel work is finally calming down, and I have a few test
dives on the EON Steel that have interesting deco etc, so I built a
new version and taught the EON Steel back-end to do gas change events.

In the process, I seem to have hit two different bugs:

Bug #1:  there's something wrong with showing gas changes. On the last
dive I have on the EON steel, I have:

  duration 45:03 min
  cylinder description="" o2=20.0% he=30.0%
  cylinder description="" o2=40.0%
  cylinder description="" o2=80.0%

and then

  event 0:00 type=25 value=1966100 name="gaschange"
  event 23:48 type=25 value=40 name="gaschange"
  event 32:06 type=25 value=80 name="gaschange"
  event 32:34 type=25 value=80 name="gaschange"

so there's an initial gaschange at the beginning of the dive to the
trimix gas (that 1966100 is just "o2+(he << 16)" which is the odd
libdivecomputer GASCHANGE2 format).  And then there's a few at the end
to the deco gases. Don't ask me why there's two switches to the 80%
O2, I wasn't diving, I'm assuming it's just fat-fingering.

Anyway, when I actually *view* this dive, the first gas switch is
suppressed (because it's really just the "switch to initial gas"), but
then the three that are shown are shown off-by-one.

So the gas switch at ~24 min is shown as "gaschange: (20/30)". Which
is obviously wrong. It's the switch to 40%.

So there seems to be some bug in the "suppress showing first gas
change" logic, in that yes, the uninteresting gas change at the
beginning isn't shown, but that then causes the interesting gas
changes to be shown wrong.

I'll see if I can figure it out tomorrow, but I thought I'd holler in
case somebody else sees the bug.

The *other* bug is apparently intentional, and annoying. The code to
suppress saving temperatures for every sample has been broken. So
saving the new dives changed all the old dives I had, and made the
save much bigger. See this diff fragment:

 watertemp 26.0°C
   0:00 0.0m 27.0°C
-  0:30 7.32m
-  1:00 7.62m
-  1:30 7.32m
-  2:00 7.92m
-  2:30 9.45m
-  3:00 10.06m
-  3:30 10.67m
-  4:00 12.19m
-  4:30 14.33m
-  5:00 17.07m
-  5:30 17.07m
-  6:00 17.07m
-  6:30 16.76m
-  7:00 17.68m
-  7:30 18.29m
-  8:00 20.42m
-  8:30 21.64m
-  9:00 24.69m
-  9:30 25.3m
- 10:00 28.04m
- 10:30 31.39m
+  0:30 7.32m 27.0°C
+  1:00 7.62m 27.0°C
+  1:30 7.32m 27.0°C
+  2:00 7.92m 27.0°C
+  2:30 9.45m 27.0°C
+  3:00 10.06m 27.0°C
+  3:30 10.67m 27.0°C
+  4:00 12.19m 27.0°C
+  4:30 14.33m 27.0°C
+  5:00 17.07m 27.0°C
+  5:30 17.07m 27.0°C
+  6:00 17.07m 27.0°C
+  6:30 16.76m 27.0°C
+  7:00 17.68m 27.0°C
+  7:30 18.29m 27.0°C
+  8:00 20.42m 27.0°C
+  8:30 21.64m 27.0°C
+  9:00 24.69m 27.0°C
+  9:30 25.3m 27.0°C
+ 10:00 28.04m 27.0°C
+ 10:30 31.39m 27.0°C
  11:00 32.31m 26.0°C

Again, I'll try to figure this out tomorrow, but maybe this makes
somebody go "Duh!" and the guilty party can fix it before I even have
to start looking.

                          Linus


More information about the subsurface mailing list