Re: Improve pg_re_throw: check if sigjmp_buf is valid and report error - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Improve pg_re_throw: check if sigjmp_buf is valid and report error
Date
Msg-id 1461089.1724125443@sss.pgh.pa.us
Whole thread Raw
In response to Re: Improve pg_re_throw: check if sigjmp_buf is valid and report error  (Xiaoran Wang <fanfuxiaoran@gmail.com>)
Responses Re: Improve pg_re_throw: check if sigjmp_buf is valid and report error
List pgsql-hackers
Xiaoran Wang <fanfuxiaoran@gmail.com> writes:
>> Yeah, that's the big problem.  I don't have any confidence at all
>> that this would detect misuse.  It'd require that the old stack
>> frame gets overwritten, which might not happen for a long time,
>> and it'd require that somebody eventually do a longjmp, which again
>> might not happen for a long time --- and when those did happen, the
>> error would be detected in someplace far away from the actual bug,
>> with little evidence remaining to help you localize it.

> Exactly, it cannot tell you which PG_TRY left the invalid sigjmp_buf,
> but to implement that is easy I think, recording the line num maybe.

I don't think you get to assume that the canary word gets overwritten
but debug data a few bytes away survives.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Xiaoran Wang
Date:
Subject: Re: Improve pg_re_throw: check if sigjmp_buf is valid and report error
Next
From: Ashutosh Bapat
Date:
Subject: Re: define PG_REPLSLOT_DIR