crash with master when plotting the profile

Dirk Hohndel dirk at hohndel.org
Mon Jan 7 15:28:09 PST 2013


Linus Torvalds <torvalds at linux-foundation.org> writes:

> On Mon, Jan 7, 2013 at 2:54 PM, Linus Torvalds
> <torvalds at linux-foundation.org> wrote:
>>
>> Will look at it.
>
> Ok, I see why it happens: we create too few plot entries for the
> samples and the maxtime. I think it has to do with time going
> backwards in the samples: the magic is your time choice of time
> samples of 5, 10 and _3_ minutes. Not "+3".

brilliant, eh?

> So what happens is that time goes backwards, we continue using up more
> plot entries, and our "number of plot entries needed" estimation
> (maxtime/10+1) turns out to be too small.
>
> Now, how to *fix* it is another matter. Do we really want to be able
> to plot dives that go back-and-forth in time? If so, we need to make
> that plot info entry allocation much more intelligent.

No, we don't. That's just plain silly.

> Of course, it would probably be better if the planner just didn't
> allow segments that go backwards in time.

Yes, that's the fix.

> In the meantime, here's a patch to the profile code that just says "if
> the sample time goes backwards, just stay where you are". That fixes
> the memory corruption by not allowing the plot entries to be
> exhausted.
>
> It's more of a bandaid than anything, but I guess it's a good
> band-aid. Feel free to add my sign-off..

I'll apply that and then proceed to fix the actual bug by considering
time travel unlikely in the planner code.

I think what I'll do is "if number is smaller than last time, assume
'is_rel'")

/D


More information about the subsurface mailing list