crash with master when plotting the profile

Dirk Hohndel dirk at
Mon Jan 7 14:44:32 PST 2013

Hey Linus,

you changed a lot of this code...

Here's the sequence:

No dives loaded (Ctrl-W). Start planner.

50m   5  20/30
50m  10  20/30
20m   3  TAB-> CRASH

#0  0x0000000000413aac in populate_pressure_information (dive=0x6197800, dc=0x6197a20, pi=0x680468) at profile.c:1788
#1  0x00000000004141bb in create_plot_info (dive=0x6197800, dc=0x6197a20, gc=0x680400) at profile.c:1911
#2  0x00000000004144c2 in plot (gc=0x680400, dive=0x6197800, scale=SC_SCREEN) at profile.c:2020

		/* track the segments per cylinder and their pressure/time integral */
		if (!entry->same_cylinder) {
			current = pr_track_alloc(SENSOR_PRESSURE(entry), entry->sec);
--->			track_pr[cylinderindex] = list_add(track_pr[cylinderindex], current);
		} else { /* same cylinder */

(gdb) p cylinderindex
$82 = 20910

(wow... that's a LOT of cylinders you are carrying...)

Valgrind seems to think that your new code may be doing something bad:

==1534== Invalid write of size 8
==1534==    at 0x4134FB: populate_plot_entries (profile.c:1648)
==1534==    by 0x41416E: create_plot_info (profile.c:1902)
==1534==    by 0x4144C1: plot (profile.c:2020)
==1534==  Address 0xc15b200 is 0 bytes after a block of size 15,200 alloc'd
==1534==    at 0x4A06B0F: calloc (vg_replace_malloc.c:593)
==1534==    by 0x41340C: populate_plot_entries (profile.c:1625)
==1534==    by 0x41416E: create_plot_info (profile.c:1902)
==1534==    by 0x4144C1: plot (profile.c:2020)

and there are a ton more of those below that...

At this point I decided to report this instead of digging into it - so
the actual bug could of course be elsewhere, but maybe it's obvious to
you once you recreate it...


More information about the subsurface mailing list