Segfault when trying to edit cylinder information

Lubomir I. Ivanov neolit123 at gmail.com
Tue Jun 13 14:46:45 PDT 2017


On 13 June 2017 at 23:58, Thiago Macieira <thiago at macieira.org> wrote:
> On terça-feira, 13 de junho de 2017 13:16:21 PDT Lubomir I. Ivanov wrote:
>> i cannot reproduce the problem, but also the above should not happen
>> as we allocate the cylinder "type" (tank_info_t->name) on the heap and
>> it's address cannot be so low (0x1770).
>
> It comes from:
>
>                 struct tank_info_t *info = &tank_info[index.row()];
>
> which is a global variable in core/equipment.c:
>
> struct tank_info_t tank_info[100] = {
> ...
> };
>
> and has been so since 2013. I don't see how
>  a) tank_info could be wrong (unless it's a major compilation problem)
>  and
>  b) how index.row() could have been so exactly wrong to produce a pointer in
>     the second memory page (it's too much of a coincidence)

hmm, both are possible.
i would be bet on b) as i haven't seen anything like a) in recent GCC
- not that it's bug free.

lubomir
--


More information about the subsurface mailing list