[sqlsmith] Crash in pg_get_viewdef_name_ext()

Started by Andreas Seltenreichover 9 years ago3 messageshackers
Jump to latest
#1Andreas Seltenreich
seltenreich@gmx.de

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=<optimized out>) at execQual.c:2041
[...]

Attachments:

ruleutils.patchtext/x-diffDownload+7-1
#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Andreas Seltenreich (#1)
Re: [sqlsmith] Crash in pg_get_viewdef_name_ext()

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

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#3Michael Paquier
michael@paquier.xyz
In reply to: Tom Lane (#2)
Re: [sqlsmith] Crash in pg_get_viewdef_name_ext()

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

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers