Re: Computer VARSIZE_ANY(PTR) during debugging - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: Computer VARSIZE_ANY(PTR) during debugging
Date
Msg-id 20130626150259.GF5940@eldon.alvh.no-ip.org
Whole thread Raw
In response to Computer VARSIZE_ANY(PTR) during debugging  (Amit Langote <amitlangote09@gmail.com>)
Responses Re: Computer VARSIZE_ANY(PTR) during debugging
Re: Computer VARSIZE_ANY(PTR) during debugging
List pgsql-hackers
Amit Langote escribió:

> The segfault in question happens at line 1141:
> 
> off = att_align_pointer(off, thisatt->attalign, -1, tp + off);
> 
> char       *tp;                         /* ptr to tuple data */
> long        off;                    /* offset in tuple data */
> 
> Disassembling seems to suggest (tp + off) is the faulting address.
> Apparently, the segfault happens when 5th text column is being
> extracted from a tuple (char(n), char(n), int4, char(n), text, ...).
> Since, tp is fixed for the whole duration of loop and only off is
> subject to change over iterations, it may have happened due to wrong
> offset in this iteration.
> 
> Has anything of this kind been encountered/reported before?

Yes, I vaguely recall I have seen this in cases where tuples contain
corrupt data.  I think you just need the length word of the fourth datum
to be wrong.

-- 
Álvaro Herrera                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: LATERAL quals revisited
Next
From: Markus Wanner
Date:
Subject: Re: Hash partitioning.