pull-request: trip management, next try

Dirk Hohndel dirk at hohndel.org
Mon Sep 3 09:10:54 PDT 2012


Henrik Brautaset Aronsen <subsurface at henrik.synth.no> writes:

> Den 03.09.12 17:14, skrev Dirk Hohndel:
>> On Sep 3, 2012, at 7:28 AM, Dirk Hohndel wrote:
>>>> Also, Subsurface crashed when I removed a topmost dive from a group:
>>>>
>>>> Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
>>>> 0   org.hohndel.subsurface            0x000000010735887e move_dive_between_trips + 430 (divelist.c:1297)
>>>> 1   org.hohndel.subsurface            0x0000000107358fe6 insert_trip_before + 1078 (divelist.c:1378)
>>>> 2   org.hohndel.subsurface            0x00000001073591bb remove_from_trip_cb + 219 (divelist.c:1416)
>>>> 3   libgobject-2.0.0.dylib            0x0000000107fa3104 g_closure_invoke + 308
>>> Haven't seen this before. Will investigate.
>> Actually, I cannot seem to reproduce this. Can you send me the xml file you used and the precise steps to reproduce?
>
> It's not easy, it just seemed to happen randomly.  But I managed to 
> reproduce it, using your trip3 branch:
>
> - start Subsurface
> - import all test dives
> - remove dive 15 and 14 from their trips
> - order by date
> - remove dive 16 from its trip
> - crash!

Lovely. Digging deeper into this I found two different issues.

One is that the test dives are now incorrect - Linus had me remove the
trip time at some point at that's when I authored the test dives. Yet
now that we actually DO need the time after all, the parse-xml code
doesn't really work if there is a data and no time.  So I have updated
the test dives to be correct (since we so far have never committed code
to subsurface that was able to actually store trips this should not be
an issue for anyone else outthere except for the test dives).

After fixing that and randomly clicking around I was able to still get
it to crash - that one looks a little more interesting and still needs
some investigation.

/D

diff --git a/dives/test21.xml b/dives/test21.xml
index 5f5f6c9..ce6b82f 100644
--- a/dives/test21.xml
+++ b/dives/test21.xml
@@ -1,6 +1,6 @@
 <dives>
 <program name='subsurface' version='1'></program>
-<trip date='2011-12-02' />
+<trip date='2011-12-02' time='14:00:00' />
 <dive number='20' tripflag='INTRIP' date='2011-12-02' time='14:00:00' duration='30:00 min'>
   <depth max='20.0 m' mean='15.0 m' />
   <location>20th test dive - this should be in a trip with same location</location>
diff --git a/dives/test22.xml b/dives/test22.xml
index a610323..e811228 100644
--- a/dives/test22.xml
+++ b/dives/test22.xml
@@ -1,6 +1,6 @@
 <dives>
 <program name='subsurface' version='1'></program>
-<trip date='2011-12-02' location='trip location' />
+<trip date='2011-12-02' location='trip location' time='15:00:00' />
 <dive number='21' tripflag='INTRIP' date='2011-12-02' time='15:00:00' duration='30:00 min'>
   <depth max='20.0 m' mean='15.0 m' />
   <location>21st test dive - this should be in a trip with a trip location</location>
diff --git a/dives/test23.xml b/dives/test23.xml
index c61ad2d..e0a4783 100644
--- a/dives/test23.xml
+++ b/dives/test23.xml
@@ -1,6 +1,6 @@
 <dives>
 <program name='subsurface' version='1'></program>
-<trip date='2011-12-02' location='trip location' />
+<trip date='2011-12-02' time='6:00:00' location='trip location' />
 <dive number='22' tripflag='NOTRIP' date='2011-12-09' time='6:00:00' duration='30:00 min'>
   <depth max='20.0 m' mean='15.0 m' />
   <location>22nd test dive - this should not be in a trip</location>


More information about the subsurface mailing list