From: Andreas Seltenreich <seltenreich@gmx.de>
To: pgsql-hackers@postgresql.org
Subject: [sqlsmith] OOM crash in plpgsql_extra_checks_check_hook
Date: Mon, 20 Jun 2016 21:06:36 +0200
Message-ID: <874m8nn0hv.fsf@elite.ansel.ydns.eu> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>
Just had a parallel worker of a memory-starved instance of sqlsmith
crash. plpgsql_extra_checks_check_hook forgot to check the result of
its malloc call here:
Core was generated by `postgres: bgworker: parallel worker for PID 5905 '.
Program terminated with signal SIGSEGV, Segmentation fault.
#0 plpgsql_extra_checks_check_hook (newvalue=<optimized out>, extra=0x7fff7fe31a58, source=<optimized out>) at pl_handler.c:113
113 *myextra = extrachecks;
(gdb) bt
#0 plpgsql_extra_checks_check_hook (newvalue=<optimized out>, extra=0x7fff7fe31a58, source=<optimized out>) at pl_handler.c:113
#1 0x000000000080173f in call_string_check_hook (newval=0x7fff7fe31a50, extra=<optimized out>, source=<optimized out>, elevel=15, conf=<optimized out>, conf=<optimized out>) at guc.c:9779
#2 0x00000000008029b8 in InitializeOneGUCOption (gconf=0x4) at guc.c:4546
#3 0x0000000000804dbc in define_custom_variable (variable=0x2cb6ef0) at guc.c:7466
#4 0x0000000000805862 in DefineCustomStringVariable (name=name@entry=0x7f803cbfe011 "plpgsql.extra_warnings", short_desc=short_desc@entry=0x7f803cbfe1f8 "List of programming constructs that should produce a warning.", long_desc=long_desc@entry=0x0, valueAddr=valueAddr@entry=0x7f803ce070d8 <plpgsql_extra_warnings_string>, bootValue=bootValue@entry=0x7f803cbfdf78 "none", context=context@entry=PGC_USERSET, flags=1, check_hook=0x7f803cbe9700 <plpgsql_extra_checks_check_hook>, assign_hook=0x7f803cbe96e0 <plpgsql_extra_warnings_assign_hook>, show_hook=0x0) at guc.c:7733
#5 0x00007f803cbe99ea in _PG_init () at pl_handler.c:173
#6 0x00000000007f1bcb in internal_load_library (libname=libname@entry=0x7f8040cee14d <error: Cannot access memory at address 0x7f8040cee14d>) at dfmgr.c:276
#7 0x00000000007f2738 in RestoreLibraryState (start_address=0x7f8040cee14d <error: Cannot access memory at address 0x7f8040cee14d>) at dfmgr.c:741
#8 0x00000000004e61c0 in ParallelWorkerMain (main_arg=<optimized out>) at parallel.c:985
#9 0x0000000000684072 in StartBackgroundWorker () at bgworker.c:726
#10 0x000000000068f142 in do_start_bgworker (rw=0x2cb5230) at postmaster.c:5535
#11 maybe_start_bgworker () at postmaster.c:5709
#12 0x000000000068fb96 in sigusr1_handler (postgres_signal_arg=<optimized out>) at postmaster.c:4971
#13 <signal handler called>
#14 0x00007f8040091ac3 in __select_nocancel () at ../sysdeps/unix/syscall-template.S:81
#15 0x000000000046c31f in ServerLoop () at postmaster.c:1657
#16 0x0000000000690fc7 in PostmasterMain (argc=argc@entry=4, argv=argv@entry=0x2c8c620) at postmaster.c:1301
#17 0x000000000046d96d in main (argc=4, argv=0x2c8c620) at main.c:228
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-hackers@postgresql.org
Cc: seltenreich@gmx.de
Subject: Re: [sqlsmith] OOM crash in plpgsql_extra_checks_check_hook
In-Reply-To: <874m8nn0hv.fsf@elite.ansel.ydns.eu>
References: <874m8nn0hv.fsf@elite.ansel.ydns.eu>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox