Re: plperl segfault in plperl_trusted_init() on kfreebsd - Mailing list pgsql-hackers

From Christoph Berg
Subject Re: plperl segfault in plperl_trusted_init() on kfreebsd
Date
Msg-id 20130516051514.GA16404@msgid.df7cb.de
Whole thread Raw
In response to Re: plperl segfault in plperl_trusted_init() on kfreebsd  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: plperl segfault in plperl_trusted_init() on kfreebsd  (Stephen Frost <sfrost@snowman.net>)
List pgsql-hackers
Re: Tom Lane 2013-05-15 <244.1368675320@sss.pgh.pa.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/zoneinfoCFLAGS='-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
-oplperl.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@df7cb.de | http://www.df7cb.de/



pgsql-hackers by date:

Previous
From: Boszormenyi Zoltan
Date:
Subject: Re: commit fest schedule for 9.4
Next
From: Amit Langote
Date:
Subject: Re: Logging of PAM Authentication Failure