Segfaults all around on sample Poseidon MkVI XML log

Giuseppe Bilotta giuseppe.bilotta at gmail.com
Sat Nov 22 07:22:15 PST 2014


On Sat, Nov 22, 2014 at 3:52 PM, Dirk Hohndel <dirk at hohndel.org> wrote:
> The XML file should't even be there - I'm going to remove it (unless
> Willem / Robert disagree)
> Open the .txt file. Saving that as XML should then give you a correct XML
> file.

I had a strong suspicion that the XML was leftover from older
conversion attempts, honestly.
OTOH, I think it might be useful to have such a broken XML around, as
a testcase for the robustnestt of the code.
For example, I've since fixed the cylinder thing "manually" (I just
mark the two cylinders as DILUENT and OXYGEN if none of the respective
type are found --I can provide the patch if wanted), but there's still
other parts of the code that blow.

(I'm currently trying to dig through this:

(gdb) bt
#0 0x00000000004601f3 in list_last (list=0xffffffffffffffff) at
gaspressures.c:42
#1 list_add (element=0x1227f30, list=0xffffffffffffffff) at gaspressures.c:50
#2 populate_pressure_information (dive=dive at entry=0x7ee740
<displayed_dive>, dc=dc at entry=0x7eea48 <displayed_dive+776>,
pi=pi at entry=0xb28df8, o2_flag=o2_flag at entry=1) at gaspressures.c:416
#3 0x000000000045f0fa in create_plot_info_new (dive=0x7ee740
<displayed_dive>, dc=0x7eea48 <displayed_dive+776>, pi=0xb28df8) at
profile.c:1020
#4 0x00000000004ef872 in ProfileWidget2::plotDive (this=0xb28d90,
d=<optimized out>, d at entry=0x0, force=force at entry=false) at
qt-ui/profile/profilewidget2.cpp:495

right after the "fixed" import of the broken XML).

> But the more important suggestions is that yes, we should check the
> accesses to the cylinders and do something sane if there is no cylinder
> for that specific use. I haven't looked at the code (I'm in a bit of a
> rush this morning), but most likely this means that we need to change the
> way we use these functions...

Basically, all the direct/indirect calls to the cylinder-by-use
functions should be checked against negative index, but I suspect the
appropriate action to take would change from application to
applicaiton. I can start by spotting all the relevant places and put
appropriate // TODO FIXME check negative index comments, if you want.

-- 
Giuseppe "Oblomov" Bilotta


More information about the subsurface mailing list