Re: plperl segfault in plperl_trusted_init() on kfreebsd

From: Christoph Berg <cb(at)df7cb(dot)de>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: plperl segfault in plperl_trusted_init() on kfreebsd
Date: 2013-05-16 05:15:16
Message-ID: 20130516051514.GA16404@msgid.df7cb.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Re: Tom Lane 2013-05-15 <244(dot)1368675320(at)sss(dot)pgh(dot)pa(dot)us>
> You sure that wholesale override of CFLAGS is a good idea?
> This report doesn't show what flags the rest of your system was built
> with, but seems like there could be a compatibility issue. Or maybe
> you prevented plperl from being built with -fpic, or something like
> that.

That was because the plain "./configure" version (for a minimal way to
reproduce) didn't built with debug symbols. The original gcc line from the
Debian build log is:

cd build && ../configure \
--with-tcl \
--with-perl \
--with-python \
--with-pam \
--with-krb5 \
--with-gssapi \
--with-openssl \
--with-libxml \
--with-libxslt \
--with-ldap \
--with-tclconfig=/usr/lib/tcl8.5 \
--with-tkconfig=/usr/lib/tk8.5 \
--with-includes=/usr/include/tcl8.5 \
PYTHON=/usr/bin/python \
--mandir=/usr/share/postgresql/9.3/man --docdir=/usr/share/doc/postgresql-doc-9.3 --sysconfdir=/etc/postgresql-common --datarootdir=/usr/share/ --datadir=/usr/share/postgresql/9.3 --bindir=/usr/lib/postgresql/9.3/bin --libdir=/usr/lib/ --libexecdir=/usr/lib/postgresql/ --includedir=/usr/include/postgresql/ --enable-nls --enable-integer-datetimes --enable-thread-safety --enable-debug --disable-rpath --with-ossp-uuid --with-gnu-ld --with-pgport=5432 --with-system-tzdata=/usr/share/zoneinfo CFLAGS='-g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -fPIC -pie -I/usr/include/mit-krb5' LDFLAGS='-Wl,-z,relro -Wl,-z,now -Wl,--as-needed -L/usr/lib/mit-krb5 -L/usr/lib/x86_64-kfreebsd-gnu/mit-krb5'

/usr/bin/make -C plperl all
make[5]: Entering directory `/build/buildd-postgresql-9.3_9.3~beta1-2-kfreebsd-amd64-3i_y9K/postgresql-9.3-9.3~beta1/build/src/pl/plperl'
msgfmt -o po/cs.mo /build/buildd-postgresql-9.3_9.3~beta1-2-kfreebsd-amd64-3i_y9K/postgresql-9.3-9.3~beta1/build/../src/pl/plperl/po/cs.po
[...]
'/usr/bin/perl' /build/buildd-postgresql-9.3_9.3~beta1-2-kfreebsd-amd64-3i_y9K/postgresql-9.3-9.3~beta1/build/../src/pl/plperl/text2macro.pl --strip='^(\#.*|\s*)$' /build/buildd-postgresql-9.3_9.3~beta1-2-kfreebsd-amd64-3i_y9K/postgresql-9.3-9.3~beta1/build/../src/pl/plperl/plc_perlboot.pl /build/buildd-postgresql-9.3_9.3~beta1-2-kfreebsd-amd64-3i_y9K/postgresql-9.3-9.3~beta1/build/../src/pl/plperl/plc_trusted.pl > perlchunks.h
'/usr/bin/perl' /build/buildd-postgresql-9.3_9.3~beta1-2-kfreebsd-amd64-3i_y9K/postgresql-9.3-9.3~beta1/build/../src/pl/plperl/plperl_opmask.pl plperl_opmask.h
gcc -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -fPIC -pie -I/usr/include/mit-krb5 -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -g -fpic -I. -I/build/buildd-postgresql-9.3_9.3~beta1-2-kfreebsd-amd64-3i_y9K/postgresql-9.3-9.3~beta1/build/../src/pl/plperl -I../../../src/include -I/build/buildd-postgresql-9.3_9.3~beta1-2-kfreebsd-amd64-3i_y9K/postgresql-9.3-9.3~beta1/build/../src/include -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -I/usr/include/libxml2 -I/usr/include/tcl8.5 -I/usr/lib/perl/5.14/CORE -c -o plperl.o /build/buildd-postgresql-9.3_9.3~beta1-2-kfreebsd-amd64-3i_y9K/postgresql-9.3-9.3~beta1/build/../src/pl/plperl/plperl.c
'/usr/bin/perl' /usr/share/perl/5.14/ExtUtils/xsubpp -typemap /usr/share/perl/5.14/ExtUtils/typemap /build/buildd-postgresql-9.3_9.3~beta1-2-kfreebsd-amd64-3i_y9K/postgresql-9.3-9.3~beta1/build/../src/pl/plperl/SPI.xs >SPI.c
gcc -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -fPIC -pie -I/usr/include/mit-krb5 -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -g -fpic -I. -I/build/buildd-postgresql-9.3_9.3~beta1-2-kfreebsd-amd64-3i_y9K/postgresql-9.3-9.3~beta1/build/../src/pl/plperl -I../../../src/include -I/build/buildd-postgresql-9.3_9.3~beta1-2-kfreebsd-amd64-3i_y9K/postgresql-9.3-9.3~beta1/build/../src/include -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -I/usr/include/libxml2 -I/usr/include/tcl8.5 -I/usr/lib/perl/5.14/CORE -c -o SPI.o SPI.c
'/usr/bin/perl' /usr/share/perl/5.14/ExtUtils/xsubpp -typemap /usr/share/perl/5.14/ExtUtils/typemap /build/buildd-postgresql-9.3_9.3~beta1-2-kfreebsd-amd64-3i_y9K/postgresql-9.3-9.3~beta1/build/../src/pl/plperl/Util.xs >Util.c
gcc -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -fPIC -pie -I/usr/include/mit-krb5 -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -g -fpic -I. -I/build/buildd-postgresql-9.3_9.3~beta1-2-kfreebsd-amd64-3i_y9K/postgresql-9.3-9.3~beta1/build/../src/pl/plperl -I../../../src/include -I/build/buildd-postgresql-9.3_9.3~beta1-2-kfreebsd-amd64-3i_y9K/postgresql-9.3-9.3~beta1/build/../src/include -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -I/usr/include/libxml2 -I/usr/include/tcl8.5 -I/usr/lib/perl/5.14/CORE -c -o Util.o Util.c
gcc -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -fPIC -pie -I/usr/include/mit-krb5 -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -g -fpic -shared -o plperl.so plperl.o SPI.o Util.o -L../../../src/port -L../../../src/common -Wl,-z,relro -Wl,-z,now -Wl,--as-needed -L/usr/lib/mit-krb5 -L/usr/lib/x86_64-kfreebsd-gnu/mit-krb5 -L/usr/lib -Wl,--as-needed -fstack-protector -L/usr/local/lib -L/usr/lib/perl/5.14/CORE -lperl -ldl -lm -lpthread -lc -lcrypt
make[5]: Leaving directory `/build/buildd-postgresql-9.3_9.3~beta1-2-kfreebsd-amd64-3i_y9K/postgresql-9.3-9.3~beta1/build/src/pl/plperl'

It segfaults on kfreebsd, too (and works fine elsewhere).

> I tend to use
> make PROFILE="-g"
> for this sort of tweak to the compile flags --- that adds the flags
> you specify, without removing any.

Good to know, thanks.

Christoph
--
cb(at)df7cb(dot)de | http://www.df7cb.de/

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Langote 2013-05-16 05:20:48 Re: Logging of PAM Authentication Failure
Previous Message Boszormenyi Zoltan 2013-05-16 04:28:05 Re: commit fest schedule for 9.4