Segfaults all around on sample Poseidon MkVI XML log

Giuseppe Bilotta giuseppe.bilotta at gmail.com
Sat Nov 22 06:02:48 PST 2014


Hello,

so, I tried opening dives/Poseidon_MkVILog.xml and Subsurface crashed.
I've been tracking the issue since this morning, and not being
particularly familiar with anything but some of the UI log, I'm not
even sure I'm chasing the right bug(s).

My understanding is presently the following:

* the given sample log is for a CCR dive;
* CCR dives were recently changed to default to the DILUENT cyl, plus
extra stuff done on the OXYGEN cyl;
* the given sample log has two cylinders, of unspecified type, that
means everything defaults to OC_GAS;
* every single piece of code that expectes a DILUENT + OXYGEN cylinder
pair breaks in all possible ways (but mostly by getting -1 indices
when the OXYGEN cylinder isn't found, and thus overwriting random
memory all around).

A quick fix in this case is to obviously change the types of the
cylinders to DILUENT and OXYGEN as appropriate, but (1) I'm not sure
this can be done robustly in more generally borked cases and (2) most
of the code that uses get_cylinder_{idx_by_,}use doesn't check for -1
and is thus very fragile.

Suggestions on how to operate the patient, doc?

-- 
Giuseppe "Oblomov" Bilotta


More information about the subsurface mailing list