[BUG] profile.c / plot_cylinder_pressure_text()

Dirk Hohndel dirk at hohndel.org
Sun Nov 11 09:02:59 PST 2012


Dirk Hohndel <dirk at hohndel.org> writes:

> "Lubomir I. Ivanov" <neolit123 at gmail.com> writes:
>
>> against 96fb31bc0128414
>> there is a bug a cannot reproduce on ubuntu/debian, but gdb on win7 shows a:
>> --------
>> Program received signal SIGSEGV, Segmentation fault.
>> 0x00423ae1 in plot_cylinder_pressure_text (gc=0x470380, pi=0x3512f78)
>>     at profile.c:1303
>> 1303            cyl = entry->cylinderindex;
>> --------
>> when subsurface opens 'test12.xml".
>>
>> bug is not present if there are not <cylinder..> entries in the XML.
>> a naive solution seems to be to check if "entry" is NULL.
>
> This puzzles me.
[..]
> How can entry be NULL? Unless we have an invalid plot_info structure.

Actually, we had invalid start and end times if a dive had no samples at
all (which is rather unusual, but happens for many of our test dives).

> So instead of just checking for NULL I would love to figure out how the
> could be NULL - because THAT seems to be the bug to me...

Done. Fixed. Pushed.

Thanks for catching this.

/D


More information about the subsurface mailing list