Another Subsurface crash

Dirk Hohndel dirk at hohndel.org
Sun Jul 12 06:36:58 PDT 2015


On Sun, Jul 12, 2015 at 07:19:53PM +1000, Rick Walsh wrote:
> I've finally been catching up on assigning locations to my last 150 odd
> dives in Subsurface.  Wow that's a huge effort, but I've got there.

That is huge - especially as location management right now is not where it
should be. It sort of almost works, but not really.

> I've been working with the latest master (commit
> d8ca04626589221c5f7c178e882cfaa4c095ce2a, Author: Dirk Hohndel <
> dirk at hohndel.org>, Date:   Fri Jul 10 13:28:28 2015 -0700), and built
> everything in a clean directory with build.sh a few hours ago.
> 
> Most things are working great, including really useful features I have
> barely tested before, such as the filtering (awesome), editing multiple
> dives at once, and location management.

I'm glad you are finding things you enjoy. Subsurface is quite feature
rich already, and more things are under way.

> I have a couple of annoyances with the Marble behaviour.
> Firstly, it keeps zooming out when I right-click to edit the location of a
> site that doesn't yet have coordinates.

Yes, picking a GPS location with the globe is currently not really
supported. That's supposed to be done on a different screen that isn't
implemented, yet.

> Secondly, I repeatedly try to use Marble to set coordinates for a dive that
> doesn't have a location set.  It allows me to right-click and select 'edit
> location', but then it won't let me double click to choose a new location.
> I worked out that it's because I haven't yet named the site, which makes
> some sense, but it would be good if there were a message in Marble
> prompting me to name the site first.  Especially because once I work out my
> mistake, it inevitably zooms out to somewhere over Africa, so I have to
> zoom and pan to find my way back to whatever little site I'd carefully
> zoomed to previously in Australia/Asia/New Zealand.

As I said, this isn't supposed to work right now. I should have removed
the right click menu with the edit button...

> But the real problem is I'm getting crashes as seemingly random intervals.

Indeed, that is a real problem. And we are having a hell of a time
tracking some of them down.

> It seems to happen when I'm either selecting a different site from the
> list, merging dives, or editing multiple dives.  Most of the time it
> doesn't crash, so it's hard to repeat.  Backtrace (copied below in full)
> and memory map (first few lines copied) are helpfully printed to the
> command terminal.  It doesn't mean much to me, but it hopefully it does to
> someone.

The crashes are caused by memory corruptions (somewhere we are writing to
the wrong locations) that are painfully hard to track down. Your stack
trace shows that you are running a release build of Subsurface, which
makes things even harder to debug as it doesn't give line numners in the
stack trace...

> [rick at localhost build]$ ./subsurface
> Map theme file does not exist: ""
> QInotifyFileSystemWatcherEngine::addPaths: inotify_add_watch failed: No
> such file or directory
> *** Error in `./subsurface': free(): invalid size: 0x00000000034d3e30 ***

Definitely once again a memory corruption

> ======= Backtrace: =========
> /lib64/libc.so.6(+0x77e9d)[0x7fec7ba06e9d]
> /lib64/libc.so.6(+0x7f53c)[0x7fec7ba0e53c]
> /lib64/libc.so.6(cfree+0x4c)[0x7fec7ba12e9c]
> ./subsurface(free_taxonomy+0x45)[0x6ca9df]

So while this is where the bug was triggered, that's not where it
happened. Where it happened is some time earlier when we wrote all over
the wrong part of memory - it just doesn't trigger until we try to free
memory or try to allocate more memory and glibc finally runs into the
corrupted data and crashes.

/D


More information about the subsurface mailing list