Crash when editing trip summary

Linus Torvalds torvalds at linux-foundation.org
Tue Dec 4 09:14:28 PST 2012


Looks sane for what it is, so..

Acked-by: Linus Torvalds <torvalds at linux-foundation.org>

That said, this is exactly the kind of code that would be better off
*not* messing with the gtk tree structure at all, and instead just
cause the whole gtk tree to be re-generated (see for example commit
544a8b9d7742: "Rewrite 'remove_autogen_trips()' without the gtk tree
model walking").

Then you just have to call dive_list_update_dives() afterwards, which
re-generated the whole tree from our own data structures.

In addition, often you'd want to also do
remember_tree_state()/restore_tree_state() around the whole thing, so
that it remembers which dive trips were expanded and which were not,
so that when it re-generates the tree it also makes it look the same
rather than collapse all trips.

But that's a different patch entirely. Would you be willing to look at that?

                      Linus

On Tue, Dec 4, 2012 at 6:22 AM, Lubomir I. Ivanov <neolit123 at gmail.com> wrote:
> On 4 December 2012 07:59, Miika Turkia <miika.turkia at gmail.com> wrote:
>> Hello,
>>
>> I just got a crash when editing trip summary.  Steps to reproduce:
>> - Have the auto-grouping turned on
>> - Start subsurface with the test dives
>> - Merge the two dive trips together
>> - Edit trip summary
>
> here is a patch that i think solves that.
>
> commit message:
> ---------
> On trip merge, call gtk_tree_store_set() to update the remaining trip row
>
> divelist.c:merge_trips_cb():
> It seems that when merging two trips, add_dive_to_trip() can modify the "when"
> flag of the remaining trip. However the trip row DIVE_DATE column has to
> be updated as well, since searching trough the linked (trip) list depends on it
> when a trip will be edited.
>
> To update it, we call gtk_tree_store_set() and pass the new properties from
> the remaining trip.
>
> This prevents a crash when trying to edit a freshly merged trip, yet based
> on its "when" flag, find_matching_trip() may return no matches.
> ---------
>
> lubomir
> --
>
> _______________________________________________
> subsurface mailing list
> subsurface at hohndel.org
> http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface
>


More information about the subsurface mailing list