Thread: [sqlsmith] Crash in pg_get_viewdef_name_ext()

[sqlsmith] Crash in pg_get_viewdef_name_ext()

From
Andreas Seltenreich
Date:
Hi,

sqlsmith just triggered a crash in pg_get_viewdef_name_ext().  Looks
like commit 976b24fb4 failed to update this caller of
pg_get_viewdef_worker().  Backtrace below.  Patch attached.

regards,
Andreas

Program terminated with signal SIGSEGV, Segmentation fault.
(gdb) bt
#0  strlen () at ../sysdeps/x86_64/strlen.S:106
#1  0x00000000007cdf09 in cstring_to_text (s=s@entry=0x0) at varlena.c:152
#2  0x00000000007a3409 in string_to_text (str=0x0) at ruleutils.c:10083
#3  pg_get_viewdef_name_ext (fcinfo=<optimized out>) at ruleutils.c:681
#4  0x00000000005dfae2 in ExecMakeFunctionResultNoSets (fcache=0x403ed80, econtext=0x3fb0eb8, isNull=0x403e0a1 "",
isDone=<optimizedout>) at execQual.c:2041 
[...]


Attachment

Re: [sqlsmith] Crash in pg_get_viewdef_name_ext()

From
Tom Lane
Date:
Andreas Seltenreich <seltenreich@gmx.de> writes:
> sqlsmith just triggered a crash in pg_get_viewdef_name_ext().  Looks
> like commit 976b24fb4 failed to update this caller of
> pg_get_viewdef_worker().  Backtrace below.  Patch attached.

Pushed, thanks.

(For the record, you can trigger this by passing a name that is
a valid relation, but not a view.)
        regards, tom lane



Re: [sqlsmith] Crash in pg_get_viewdef_name_ext()

From
Michael Paquier
Date:
On Mon, Aug 8, 2016 at 6:57 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Andreas Seltenreich <seltenreich@gmx.de> writes:
>> sqlsmith just triggered a crash in pg_get_viewdef_name_ext().  Looks
>> like commit 976b24fb4 failed to update this caller of
>> pg_get_viewdef_worker().  Backtrace below.  Patch attached.
>
> Pushed, thanks.
>
> (For the record, you can trigger this by passing a name that is
> a valid relation, but not a view.)

Oops. Thanks for the fix!
-- 
Michael