SEGFAULT trying to edit planned dive

Dirk Hohndel dirk at hohndel.org
Thu Jan 31 03:38:58 PST 2013


Sergey,

Thanks for the report! 

This was an interesting case where we ended up having no selected dive
(which is why the dive wasn't shown in the profile while you constructed
it, either). And the edit function tried to make a copy of the selected
dive which now was a NULL pointer. Kaboom.

I think this may have been caused by the changes to the selection code
but I honestly didn't bisect it but simply fixed it instead :-)

Please verify that the latest master does not exhibit this problem
anymore.

Thanks

/D


Sergey Starosek <sergey.starosek at gmail.com> writes:

> Hi,
>
> Got SEGFAULT today while testing. Step to reproduce:
>
> 1. Start with clean data file (close previous one)
> 2. Plan new simple dive (10m - 10min, 5 m - 5 min, 0m)
> 3. Press OK
> 4. Right click and choose Edit dive
> 5. SEGFAULT
>
> backtrace attached.
>
> Sergey
> (gdb) r
> Starting program: /home/star/src/Subsurface/subsurface 
> warning: Could not load shared library symbols for linux-vdso.so.1.
> Do you need "set solib-search-path" or "set sysroot"?
> [Thread debugging using libthread_db enabled]
> Using host libthread_db library "/lib64/libthread_db.so.1".
> [New Thread 0x7fffec309700 (LWP 17062)]
> invalid depth for row 3
>
> Program received signal SIGSEGV, Segmentation fault.
> 0x000000000041a932 in edit_multi_dive_info (single_dive=0x0) at info.c:927
> 927		memcpy(&edit_dive, master, sizeof(struct dive));
> (gdb) bt
> #0  0x000000000041a932 in edit_multi_dive_info (single_dive=0x0) at info.c:927
> #1  0x00000000004232cc in edit_selected_dives_cb (menuitem=0x8f2420, data=0x0) at divelist.c:1529
> #2  0x00007ffff50052d2 in g_closure_invoke () from /usr/lib64/libgobject-2.0.so.0
> #3  0x00007ffff5016421 in ?? () from /usr/lib64/libgobject-2.0.so.0
> #4  0x00007ffff501e684 in g_signal_emit_valist () from /usr/lib64/libgobject-2.0.so.0
> #5  0x00007ffff501e8a3 in g_signal_emit () from /usr/lib64/libgobject-2.0.so.0
> #6  0x00007ffff6d4b71e in gtk_widget_activate () from /usr/lib64/libgtk-x11-2.0.so.0
> #7  0x00007ffff6c43afd in gtk_menu_shell_activate_item () from /usr/lib64/libgtk-x11-2.0.so.0
> #8  0x00007ffff6c43e97 in ?? () from /usr/lib64/libgtk-x11-2.0.so.0
> #9  0x00007ffff6c30478 in ?? () from /usr/lib64/libgtk-x11-2.0.so.0
> #10 0x00007ffff50052d2 in g_closure_invoke () from /usr/lib64/libgobject-2.0.so.0
> #11 0x00007ffff5016a4d in ?? () from /usr/lib64/libgobject-2.0.so.0
> #12 0x00007ffff501e3c2 in g_signal_emit_valist () from /usr/lib64/libgobject-2.0.so.0
> #13 0x00007ffff501e8a3 in g_signal_emit () from /usr/lib64/libgobject-2.0.so.0
> #14 0x00007ffff6d4c52f in ?? () from /usr/lib64/libgtk-x11-2.0.so.0
> #15 0x00007ffff6c2e5c3 in gtk_propagate_event () from /usr/lib64/libgtk-x11-2.0.so.0
> #16 0x00007ffff6c2e973 in gtk_main_do_event () from /usr/lib64/libgtk-x11-2.0.so.0
> #17 0x00007ffff689b5ac in ?? () from /usr/lib64/libgdk-x11-2.0.so.0
> #18 0x00007ffff4d1a643 in g_main_context_dispatch () from /usr/lib64/libglib-2.0.so.0
> #19 0x00007ffff4d1a988 in ?? () from /usr/lib64/libglib-2.0.so.0
> #20 0x00007ffff4d1ad7a in g_main_loop_run () from /usr/lib64/libglib-2.0.so.0
> #21 0x00007ffff6c2d977 in gtk_main () from /usr/lib64/libgtk-x11-2.0.so.0
> #22 0x0000000000441971 in run_ui () at gtk-gui.c:1626
> #23 0x000000000040dca5 in main (argc=1, argv=0x7fffffffd758) at main.c:367
> (gdb) p master
> $3 = (struct dive *) 0x0
> (gdb) p edit_dive
> $4 = {number = 0, tripflag = TF_NONE, divetrip = 0x0, next = 0x0, pprev = 0x0, selected = 0, downloaded = 0, start = 0, end = 0, when = 0, location = 0x0, notes = 0x0, divemaster = 0x0, 
>   buddy = 0x0, rating = 0, latitude = {udeg = 0}, longitude = {udeg = 0}, visibility = 0, cylinder = {{type = {size = {mliter = 0}, workingpressure = {mbar = 0}, description = 0x0}, 
>       gasmix = {o2 = {permille = 0}, he = {permille = 0}}, start = {mbar = 0}, end = {mbar = 0}, sample_start = {mbar = 0}, sample_end = {mbar = 0}}, {type = {size = {mliter = 0}, 
>         workingpressure = {mbar = 0}, description = 0x0}, gasmix = {o2 = {permille = 0}, he = {permille = 0}}, start = {mbar = 0}, end = {mbar = 0}, sample_start = {mbar = 0}, sample_end = {
>         mbar = 0}}, {type = {size = {mliter = 0}, workingpressure = {mbar = 0}, description = 0x0}, gasmix = {o2 = {permille = 0}, he = {permille = 0}}, start = {mbar = 0}, end = {
>         mbar = 0}, sample_start = {mbar = 0}, sample_end = {mbar = 0}}, {type = {size = {mliter = 0}, workingpressure = {mbar = 0}, description = 0x0}, gasmix = {o2 = {permille = 0}, he = {
>           permille = 0}}, start = {mbar = 0}, end = {mbar = 0}, sample_start = {mbar = 0}, sample_end = {mbar = 0}}, {type = {size = {mliter = 0}, workingpressure = {mbar = 0}, 
>         description = 0x0}, gasmix = {o2 = {permille = 0}, he = {permille = 0}}, start = {mbar = 0}, end = {mbar = 0}, sample_start = {mbar = 0}, sample_end = {mbar = 0}}, {type = {size = {
>           mliter = 0}, workingpressure = {mbar = 0}, description = 0x0}, gasmix = {o2 = {permille = 0}, he = {permille = 0}}, start = {mbar = 0}, end = {mbar = 0}, sample_start = {
>         mbar = 0}, sample_end = {mbar = 0}}, {type = {size = {mliter = 0}, workingpressure = {mbar = 0}, description = 0x0}, gasmix = {o2 = {permille = 0}, he = {permille = 0}}, start = {
>         mbar = 0}, end = {mbar = 0}, sample_start = {mbar = 0}, sample_end = {mbar = 0}}, {type = {size = {mliter = 0}, workingpressure = {mbar = 0}, description = 0x0}, gasmix = {o2 = {
>           permille = 0}, he = {permille = 0}}, start = {mbar = 0}, end = {mbar = 0}, sample_start = {mbar = 0}, sample_end = {mbar = 0}}}, weightsystem = {{weight = {grams = 0}, 
>       description = 0x0}, {weight = {grams = 0}, description = 0x0}, {weight = {grams = 0}, description = 0x0}, {weight = {grams = 0}, description = 0x0}}, suit = 0x0, sac = 0, otu = 0, 
>   cns = 0, maxcns = 0, mintemp = {mkelvin = 0}, maxtemp = {mkelvin = 0}, dc = {when = 0, duration = {seconds = 0}, surfacetime = {seconds = 0}, maxdepth = {mm = 0}, meandepth = {mm = 0}, 
>     airtemp = {mkelvin = 0}, watertemp = {mkelvin = 0}, surface_pressure = {mbar = 0}, salinity = 0, model = 0x0, deviceid = 0, diveid = 0, samples = 0, alloc_samples = 0, sample = 0x0, 
>     events = 0x0, next = 0x0}}
> (gdb) 
> _______________________________________________
> subsurface mailing list
> subsurface at hohndel.org
> http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface

-- 
Dirk Hohndel
Intel Open Source Technology Center


More information about the subsurface mailing list