help on fixing a ghost cylinder bug.

Tomaz Canabrava tcanabrava at kde.org
Thu Mar 20 15:15:50 PDT 2014


On Thu, Mar 20, 2014 at 6:03 PM, Jan Mulder <jlmulder at planet.nl> wrote:

> Not a solution yet, but some more observations.
>
>
> On 20-03-14 17:53, Tomaz Canabrava wrote:
>
>> So, I was playing with Dirk's DiveLog and I found a rather serious bug
>> and started digging, and I'm a bit lost on how to solve it.
>>
>> The bug:
>>
>> Create two cylinders and edit them, o2, n2, then save. *some* values
>> makes the cylinder count on the dive go crazy ( I use 32 as the 02 value
>> and it jumps from 2 to 7  on dirk's dive n 222.
>>
> As a beginner on this list, I do not know how to access the mentioned dive
> nr 222, so I tried to recreate the problem as described above. However, I
> have not been able to reproduce the issue, but there are more strange
> things going on in the cylinder handling that might be related to issue as
> described by Tomaz.
>
>
>> What I managed to discover:
>>
>> The Edit is fine, we are actually editing the right cylinder.
>> The backup copy is fine, both dives ( copy and original ) have the
>> correct data
>>
>> The issue sems to be on the fixup_dive code, more important on the
>> 'check_for_unused_tanks', that calls 'mark_used_tanks'. Now, before this
>> call, the last cylinder ID of a used dive is 1, after the call, it's 6.
>>
>> and since on the model we have code that counts untill the last valud (
>> or used ) tank, we jump from 2 to 7 tanks being displayed on the model,
>> just by changing the 02 of a tank.
>>
>> This is a tiny bit out of the scope that I usually help on subsurface and
>> I didn't understand how it should be fixed.
>>
>> any help, appreciated.
>>
>> Tomaz
>>
>
> I discovered the following:
>
> Added 2 cylinders to a dive, and did not add any gas change event in the
> profile. Tried to remove 2nd-ly added cylinder, and got the dialog "the gas
> is in use and cannot be removed". Obviously a bug.
>

Yes - That's a real bug.


>
> Restarted the application, and now only 1 cylinder is shown. I'm using
> latest master and I'm using the git store for the dives. A check of the
> stored git data shows 2 cylinders. Things even get stranger, because I can
> add a gas change event for both cylinders, and the 2nd added cylinder (the
> one I'm switching to) appears in the Equipment tab when adding a gas change
> event.
>

This one is not, as Dirk took some time to explain me today, some dive
computers  send wrong data, so subsurface hides those cylinders if they are
not in use.


> Tomorrow, I will investigate a little further.
>
> best,
>
> --jan
>
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.hohndel.org/pipermail/subsurface/attachments/20140320/b11dde63/attachment.html>


More information about the subsurface mailing list