More dive-site-management goodies.

Linus Torvalds torvalds at linux-foundation.org
Mon Jun 1 15:18:03 PDT 2015


Current git version of subsurface doesn't work for me at all, and gets
a SIGSEGV in the dive site management code.

Am I the only one seeing this? SIGSEGV in dive_site_less_then().

[ Side note, the horrible syntax failure of that function name annoys
me too. "less than", not "less then". It hurts ]

   Program received signal SIGSEGV, Segmentation fault.
  0x0000000000651f08 in dive_site_less_then (a=0x3cbc340, b=0xc41) at
/home/torvalds/src/subsurface/qt-models/divelocationmodel.cpp:6
  6 return QString(a->name) <= QString(b->name);

because 'b' is an invalid pointer (that 0xc41 is not valid).

I'm now running Fedora-22, I'm wondering if that's the issue. New
compiler showing new bugs? The call chain implies this comes from the
sort() function and the iterators, called from

    LocationInformationModel::update()

Anybody?

gdb is being singularly unhelpful, because gdb is a buggy piece of
shit, and we have "struct dive_site_table" and a variable called
"dive_site_table", and when I ask gdb to show "dive_site_table" (no
"struct" anywhere), gdb gets all pissy and thinks I'm asking for the
_type_. Christ, what a horrible nasty piece of software. I've seen
this before, I think it's some gdb C++ name confusion.

Hackign things up a bit, I see

   (gdb) p *(struct dive_site_table *)0x0000000000a2b250
   $2 = {nr = 281, allocated = 390, dive_sites = 0x3c009c0}

so I have 281 of those dive_sites, but I'm wondering whether the issue
is that we've done "beginInsertRows()" earlier, and it has perhaps
already incremented the nr of entries? That would explain the "-1" in
the std::sort() call, and might also explain why it SIGSEGV's (we're
trying to sort things in between the beginInsertRows/endInsertRows, is
the array perhaps not in a stable form there?

              Linus


More information about the subsurface mailing list