[sqlsmith] OOM crash in plpgsql_extra_checks_check_hook
[sqlsmith] OOM crash in plpgsql_extra_checks_check_hook
От:
Andreas Seltenreich <seltenreich@gmx.de>
Дата:
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=, extra=0x7fff7fe31a58, source=) at pl_handler.c:113 113 *myextra = extrachecks; (gdb) bt #0 plpgsql_extra_checks_check_hook (newvalue=, extra=0x7fff7fe31a58, source=) at pl_handler.c:113 #1 0x000000000080173f in call_string_check_hook (newval=0x7fff7fe31a50, extra=, source=, elevel=15, conf=, conf=) 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 , bootValue=bootValue@entry=0x7f803cbfdf78 "none", context=context@entry=PGC_USERSET, flags=1, check_hook=0x7f803cbe9700 , assign_hook=0x7f803cbe96e0 , 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 ) at dfmgr.c:276 #7 0x00000000007f2738 in RestoreLibraryState (start_address=0x7f8040cee14d ) at dfmgr.c:741 #8 0x00000000004e61c0 in ParallelWorkerMain (main_arg=) 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=) at postmaster.c:4971 #13 #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
Re: [sqlsmith] OOM crash in plpgsql_extra_checks_check_hook
От:
Tom Lane <tgl@sss.pgh.pa.us>
Дата:
Andreas Seltenreich writes: > 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: Good catch, will fix. Thanks! regards, tom lane