Bug report: Crash on adding dive
Dirk Hohndel
dirk at hohndel.org
Mon Sep 10 11:18:12 PDT 2012
Henrik Brautaset Aronsen <subsurface at henrik.synth.no> writes:
> 1) Open Subsurface
> 2) Open or Import test1.xml
> 3) Add dive
> 4) Select OK twice
> 5) Boom boom boom:
>
> Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
> 0 libgtk-quartz-2.0.0.dylib 0x000000010faa52a7
> gtk_tree_model_get_valist + 407
> 1 libgtk-quartz-2.0.0.dylib 0x000000010faa50ef
> gtk_tree_model_get + 319
> 2 org.hohndel.subsurface 0x000000010f5ff37a
> merge_dive_into_trip_above_cb + 426 (divelist.c:1410)
> 3 org.hohndel.subsurface 0x000000010f5fe206 fill_dive_list
> + 2198 (divelist.c:1117)
> 4 org.hohndel.subsurface 0x000000010f5fe3a7
> dive_list_update_dives + 71 (divelist.c:1144)
> 5 org.hohndel.subsurface 0x000000010f5ea1ee report_dives +
> 638 (main.c:149)
> 6 org.hohndel.subsurface 0x000000010f5fe704 add_dive_cb +
> 68 (divelist.c:1246)
> 7 libgobject-2.0.0.dylib 0x000000011024f104
> g_closure_invoke + 308
> 8 libgobject-2.0.0.dylib 0x000000011025e859
> signal_emit_unlocked_R + 1641
>
Ok, I root-caused this and it showed a corner case in my existing
algorithm to assign new dives to existing trips. I'll admit that this
was a corner case that was embarrassingly easy to hit but that was
actually quite hacky to work around. So I reconsidered my initial design
decision and went back to a single pass through the dive_list and to
figuring out if there is a matching trip while walking that list the
first time.
As it happens, the new code seems much more straight forward and
certainly much more readable to me :-)
Henrik and/or Miika, would you please test and send an ACK if you could?
Thanks
/D
The following changes since commit 3febfb74fa092b12b7f0a3e8d05b11b6ab6da397:
Merge branch 'ui-work' of git://git.hohndel.org/subsurface (2012-09-11 00:57:15 +0800)
are available in the git repository at:
git://git.hohndel.org/subsurface.git trip-fixes
for you to fetch changes up to 38d49bf0411acb67f3623a813d912c07025f474a:
Improve trip assignment for new dives (2012-09-10 11:04:58 -0700)
----------------------------------------------------------------
Dirk Hohndel (1):
Improve trip assignment for new dives
divelist.c | 118 +++++++++++++++++++++++++++++++++++++++++++--------------------------------------
1 file changed, 62 insertions(+), 56 deletions(-)
More information about the subsurface
mailing list