understanding the sensor values in our samples

Dirk Hohndel dirk at hohndel.org
Thu Apr 28 12:15:39 PDT 2022


On Thu, 2022-04-28 at 11:06 -0700, Linus Torvalds wrote:
> 
> The cylinder_with_sensor_sample() function indeed only tests "do we
> have a mapping to this cylinder for this sample".
> 
> But it doesn't actually test "does the sample have an actual
> _reading_?" as part of that.
> 
> That's what is causing the pointless "The deleted cylinder has sensor
> readings, which will be lost." warning.
> 
> Trivial patch attached. We could do this other ways - maybe we could
> do it as part of some cylinder cleanup phase where we just remove the
> sensor[] thing for cylinders without any sensor data.

Yes, I think that patch makes sense and fixes the problem.
I still wonder why it makes sense to populate the sensor array with
what is essentially a meaningless value in the case of a typical single
cylinder OC dive - but that doesn't change the fact that this patch is
correct.

Are you going to send a PR, or do you want me to just make something up
for you?

> But I think one of the reports had a "subsurface crashes" in it too,
> and I don't see _that_ part.
> 
> Was there some way to reproduce the crash? I ran it (very very slowly)
> under valgrind too, and there were no complaints when removing the
> cylinder (now without any warning), so it's at least not something
> hugely obvious.

I never managed to recreate the crash or to show an invalid memory
access. The user who reported this is on Windows which makes debugging
just too painful to be worth it, TBH.

/D



More information about the subsurface mailing list