Segfault when trying to edit cylinder information

Lubomir I. Ivanov neolit123 at gmail.com
Tue Jun 13 15:19:27 PDT 2017


On 14 June 2017 at 01:01, Pedro Neves <nevesdiver at gmail.com> wrote:
> On 13-06-2017 22:43, Lubomir I. Ivanov wrote:
>
> replace it with the following:
> const int test_row = index.row();
> fprintf(stderr, "TEST_ROW: %d\n", test_row); // include <stdio.h> if needed
> struct tank_info_t *info = &tank_info[test_row];
>
> Lubomir:
>
> This is what I get now:
>
>

<snip>

> TEST_ROW: 100
> TEST_ROW: 101
> Segmentation fault (core dumped)
>

row values seem to go above 99.
please try reseting the tankinfomodel.cpp changes and apply the attached patch

(git apply test_tank_info_model_fix.patch)

and rebuild / retest.

if it works we have a "clamp" solution, but the real cause is unknown.
the QModelIndex should not return row values above the maximum size of
our tank_info buffer.

lubomir
--
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test_tank_info_model_fix.patch
Type: text/x-patch
Size: 1347 bytes
Desc: not available
URL: <http://lists.subsurface-divelog.org/pipermail/subsurface/attachments/20170614/6da4d337/attachment.bin>


More information about the subsurface mailing list