different segfault with lastest master

2015-07-11 Thread Linus Torvalds
Hmm. I'm not sure how to reproduce this, because I was just moving around between the dives, checking out how the globe moved, and occasionally pressing the dive site quick-edit button. And suddenly I get *** Error in `/home/torvalds/src/install-root/bin/subsurface': malloc(): memory corruption (

Re: different segfault with lastest master

2015-07-11 Thread Tomaz Canabrava
On Sat, Jul 11, 2015 at 7:00 PM, Linus Torvalds < torva...@linux-foundation.org> wrote: > Hmm. I'm not sure how to reproduce this, because I was just moving > around between the dives, checking out how the globe moved, and > occasionally pressing the dive site quick-edit button. > > And suddenly I

Re: different segfault with lastest master

2015-07-11 Thread Dirk Hohndel
Compile with no Facebook, no user manual which stops the crash. You still get two bazillion errors from marble which mostly seem bogus to me but occasionally one can spot an actual bug in the midst of all that crap. Or compile with no marble as well to see if you can make something interesting s

Re: different segfault with lastest master

2015-07-11 Thread Linus Torvalds
On Sat, Jul 11, 2015 at 3:45 PM, Dirk Hohndel wrote: > Compile with no Facebook, no user manual which stops the crash. You still get > two bazillion errors from marble which mostly seem bogus to me but > occasionally one can spot an actual bug in the midst of all that crap. > Or compile with no

Re: different segfault with lastest master

2015-07-11 Thread Linus Torvalds
On Sat, Jul 11, 2015 at 4:29 PM, Linus Torvalds wrote: > > Anyway, that makes things runnable with valgrind, although very slow. > I'm not seeing anything suspicious. I'll play with it some more. .. and immediately after sending that, I played some more with the quick-edit button (but no actual e

Re: different segfault with lastest master

2015-07-11 Thread Thiago Macieira
On Saturday 11 July 2015 19:28:42 Tomaz Canabrava wrote: > On Sat, Jul 11, 2015 at 7:00 PM, Linus Torvalds < > > torva...@linux-foundation.org> wrote: > > #0 0x7fffefa67a98 in raise () at /lib64/libc.so.6 > > #1 0x7fffefa6972a in abort () at /lib64/libc.so.6 > > #2 0x7fffefaaaea2 in

Re: different segfault with lastest master

2015-07-13 Thread Linus Torvalds
On Sat, Jul 11, 2015 at 4:39 PM, Linus Torvalds wrote: > > which is just the taxonomy.category writes. Looks like it writes past > the end of the allocation. Ok, looking at this, the problem seems to be pretty clear. When the code does the taxonomy lookup in ReverseGeoLookupThread::run(), it kee

Re: different segfault with lastest master

2015-07-13 Thread Tomaz Canabrava
On Mon, Jul 13, 2015 at 3:46 PM, Linus Torvalds < torva...@linux-foundation.org> wrote: > On Sat, Jul 11, 2015 at 4:39 PM, Linus Torvalds > wrote: > > > > which is just the taxonomy.category writes. Looks like it writes past > > the end of the allocation. > > Ok, looking at this, the problem seem

Re: different segfault with lastest master

2015-07-13 Thread Dirk Hohndel
On Mon, Jul 13, 2015 at 11:46:28AM -0700, Linus Torvalds wrote: > On Sat, Jul 11, 2015 at 4:39 PM, Linus Torvalds > wrote: > > > > which is just the taxonomy.category writes. Looks like it writes past > > the end of the allocation. > > Ok, looking at this, the problem seems to be pretty clear. >

Re: different segfault with lastest master

2015-07-13 Thread Linus Torvalds
On Mon, Jul 13, 2015 at 1:10 PM, Dirk Hohndel wrote: > > I still don't see how this can overflow. If you put a printf or qDebug() > or something at this line > > ds->taxonomy.nr = ri; You missed the part where I pointed out that that store is conditional. It's inside the if (geo

Re: different segfault with lastest master

2015-07-13 Thread Dirk Hohndel
On Mon, Jul 13, 2015 at 01:27:54PM -0700, Linus Torvalds wrote: > On Mon, Jul 13, 2015 at 1:10 PM, Dirk Hohndel wrote: > > > > I still don't see how this can overflow. If you put a printf or qDebug() > > or something at this line > > > > ds->taxonomy.nr = ri; > > You missed the part where

Re: different segfault with lastest master

2015-07-13 Thread Linus Torvalds
On Mon, Jul 13, 2015 at 1:39 PM, Dirk Hohndel wrote: > > The idea is that the taxomony should always be consistent. NULL pointer > and nothing there, or .nr in sync with the number of valid pointers. Yes, yes. But if that initialization never happens, then you may have several *old* taxonomy valu

Re: different segfault with lastest master

2015-07-13 Thread Linus Torvalds
On Mon, Jul 13, 2015 at 1:58 PM, Linus Torvalds wrote: > > The problem is that "nr" is not necessarily 0 or 1, because we may > have *previous* taxonomy data, and we keep potentially growing it. So I'm testing the attached patch, but so far I haven't seen anything. As mentioned, I'm not sure wha

Re: different segfault with lastest master

2015-07-13 Thread Dirk Hohndel
On Mon, Jul 13, 2015 at 01:58:25PM -0700, Linus Torvalds wrote: > On Mon, Jul 13, 2015 at 1:39 PM, Dirk Hohndel wrote: > > > > The idea is that the taxomony should always be consistent. NULL pointer > > and nothing there, or .nr in sync with the number of valid pointers. > > Yes, yes. But if that

Re: different segfault with lastest master

2015-07-13 Thread Linus Torvalds
On Mon, Jul 13, 2015 at 2:37 PM, Linus Torvalds wrote: > > I'm wondering if maybe your "Fix memory handling for taxonomy data" > commit fixed it. I ended up recompiling due to the debug patch, so I'm > now running a different version of subsurface than I was when I saw it > originally. That said,

Re: different segfault with lastest master

2015-07-13 Thread Linus Torvalds
On Mon, Jul 13, 2015 at 2:25 PM, Linus Torvalds wrote: > > So I'm testing the attached patch, but so far I haven't seen anything. > > As mentioned, I'm not sure what triggers it. I've been clicking on the dive edit thing and the dive list like a deranged monkey on amphetamines for several minutes

Re: different segfault with lastest master

2015-07-13 Thread Dirk Hohndel
On Mon, Jul 13, 2015 at 02:40:03PM -0700, Linus Torvalds wrote: > On Mon, Jul 13, 2015 at 2:37 PM, Linus Torvalds > wrote: > > > > I'm wondering if maybe your "Fix memory handling for taxonomy data" > > commit fixed it. I ended up recompiling due to the debug patch, so I'm > > now running a differ

Re: different segfault with lastest master

2015-07-13 Thread Dirk Hohndel
On Mon, Jul 13, 2015 at 02:51:24PM -0700, Dirk Hohndel wrote: > That said, I would appreciate a code review of that patch once it's > pushed. I went out of my way to try to capture all corner cases here. Pushed. /D ___ subsurface mailing list subsurface