[sqlsmith] OOM crash in plpgsql_extra_checks_check_hook

From: Andreas Seltenreich <seltenreich(at)gmx(dot)de>
To: pgsql-hackers(at)postgresql(dot)org
Subject: [sqlsmith] OOM crash in plpgsql_extra_checks_check_hook
Date: 2016-06-20 19:06:36
Message-ID: 874m8nn0hv.fsf@elite.ansel.ydns.eu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-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(at)entry=0x7f803cbfe011 "plpgsql.extra_warnings", short_desc=short_desc(at)entry=0x7f803cbfe1f8 "List of programming constructs that should produce a warning.", long_desc=long_desc(at)entry=0x0, valueAddr=valueAddr(at)entry=0x7f803ce070d8 <plpgsql_extra_warnings_string>, bootValue=bootValue(at)entry=0x7f803cbfdf78 "none", context=context(at)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(at)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(at)entry=4, argv=argv(at)entry=0x2c8c620) at postmaster.c:1301
#17 0x000000000046d96d in main (argc=4, argv=0x2c8c620) at main.c:228

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Gražvydas Valeika 2016-06-20 19:07:34 Re: 10.0
Previous Message Vik Fearing 2016-06-20 18:34:35 Re: primary_conninfo missing from pg_stat_wal_receiver