stack trace for bug #755

Lubomir I. Ivanov neolit123 at gmail.com
Tue Nov 11 15:12:59 PST 2014


On 11 November 2014 20:55, Dirk Hohndel <dirk at hohndel.org> wrote:
> On Tue, Nov 11, 2014 at 06:42:34PM +0200, Lubomir I. Ivanov wrote:
>> On 11 November 2014 17:23, Lubomir I. Ivanov <neolit123 at gmail.com> wrote:
>> >
>> > but i think i found another one:
>> >> - start new divelog
>> >> - import dives/test0.xml-test38.xml
>> > - select first dive in the trip
>> > - select second dive in the trip (dive #35?)
>> >
>> > it enters an infinite loop allocating 3MB per second while frozen.
>> >
>>
>> i'm a bit confused about this one...
>>
>> created ticked:
>> http://trac.subsurface-divelog.org/ticket/759#ticket
>>
>> ticket text:
>> --------------
>>
>> Qt 5.3.0, win7 64bit, SHA1: d06cc2c68e10bb3
>>
>> start subsurface
>> load ./dives/test35.xml
>
> Above you say open all of them, here you say just load that one.
>
>> the dctype='CCR' attribute in test35.xml is causing an infinite loop.
>> if i put this line:
>
> This doesn't happen for me - I can open test35.xml just fine (latest
> master, Linux).
>

i think it's due to the fact i have the partial pressure graphs
enabled, but i haven't tested this.
anyway, here is a patch for the bug but i'm CCing the author of the
code as i really don't have much of an idea what a diluent cyclinder
actually is, apart from the fact that i just saw a picture of it via
google.

if there is a better fix, please ignore the patch.

---------
In a test case loading dives/test35.xml results in a infinite(-like)
loop (Note: possibly requires the partial pressure plots enabled).

calculate_gas_information_new() has an 'if' branch to
update the cylinderindex to a dive's diluent_cylinder_index,
but it does not consider that said index can be set previously
to -1.

This results in a random neighbour memory assigned as
&dive->cylinder[-1].gasmix and passed to fill_pressures(..).

Following the calculations in the function the He gas,
can receive a bad value (e.g. for the test case in the
E+6 ranges).

Said value is then used in DivePlotDataModel()::pheMax()
(defined by MAX_PPGAS_FUNC()) resulting in one of the loops
(the 3rd one) in DiveCartesianAxis::updateTicks() to
loop indefinitely.

---------

difficult to debug, mainly due to Qt's "signal / slot / emit"
mechanics and the "model / view" network of "stuff" - not much fun.
also the backtrace from GDB was somewhere in kernel32.dll, which is
not useful at all, so i had to do the good-old:
add some breakpoints -> step / next (100 times) -> <goes nowhere> ->
quit -> add more printf()'s -> recompile -> check values -> repeat...
(etc)

lubomir
--
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-profile.c-fix-a-bug-in-calculate_gas_information_new.patch
Type: application/octet-stream
Size: 1889 bytes
Desc: not available
URL: <http://lists.subsurface-divelog.org/pipermail/subsurface/attachments/20141112/084cfb1b/attachment.obj>


More information about the subsurface mailing list