Re: Custom variable class segmentation fault
От | Bruce Momjian |
---|---|
Тема | Re: Custom variable class segmentation fault |
Дата | |
Msg-id | 200608131538.k7DFc9A20932@momjian.us обсуждение исходный текст |
Ответ на | Custom variable class segmentation fault (Michael Fuhr <mike@fuhr.org>) |
Список | pgsql-hackers |
Michael Fuhr wrote: > The latest HEAD is segfaulting on startup if I have the following > lines in postgresql.conf: > > custom_variable_classes = 'plperl' > plperl.use_strict = on > > If I comment out the second line then the server starts successfully. > Platform is Solaris 9/sparc. > > (gdb) bt > #0 0xff0340a0 in strcmp () from /usr/lib/libc.so.1 > #1 0x00257504 in verify_config_option (name=0x0, value=0x397258 "on", context=PGC_POSTMASTER, source=PGC_S_FILE, isNewEqual=0xffbff2cb"\001", > isContextOK=0xffbff2ca "\001\001") at guc.c:5513 > #2 0x0025d3b4 in ProcessConfigFile (context=PGC_POSTMASTER) at guc-file.l:152 > #3 0x0025d80c in SelectConfigFiles (userDoption=0x1 <Address 0x1 out of bounds>, progname=0x390610 "postgres") at guc.c:2867 > #4 0x0019a450 in PostmasterMain (argc=5, argv=0x391240) at postmaster.c:602 > #5 0x001518c8 in main (argc=5, argv=0x391240) at main.c:187 Thanks for the report. This attached, applied patch fixes it. The problem was that custom variables have _no_ default value for strings on startup, and the checking code was being too agressive. -- Bruce Momjian bruce@momjian.us EnterpriseDB http://www.enterprisedb.com + If your life is a hard drive, Christ can be your backup. + Index: src/backend/utils/misc/guc.c =================================================================== RCS file: /cvsroot/pgsql/src/backend/utils/misc/guc.c,v retrieving revision 1.339 diff -c -c -r1.339 guc.c *** src/backend/utils/misc/guc.c 13 Aug 2006 02:22:24 -0000 1.339 --- src/backend/utils/misc/guc.c 13 Aug 2006 15:34:13 -0000 *************** *** 5512,5518 **** { struct config_string *conf = (struct config_string *) record; ! return strcmp(*conf->variable, newvalue) == 0; } } --- 5512,5521 ---- { struct config_string *conf = (struct config_string *) record; ! if (!*conf->variable) /* custom variable with no value yet */ ! return false; ! else ! return strcmp(*conf->variable, newvalue) == 0; } }
В списке pgsql-hackers по дате отправления: