Bug#787493: FTBFS with GCC 5 and Perl 5.22

Roderich Schupp roderich.schupp at gmail.com
Tue Jun 2 08:43:02 UTC 2015


Source: libapache2-mod-perl2
Version: 2.0.9~rc2-1
Severity: serious
Justification: fails to build from source (but built successfully in the past)

Building with GCC 5 and Perl 5.22 (also built with GCC 5) from experimental.
Build stops with

....
[warning] setting ulimit to allow core files
ulimit -c unlimited; /usr/bin/perl /raid/build/work/libapache2-mod-
perl2-2.0.9~rc2/t/TEST -httpd_conf '/raid/build/work/libapache2-mod-
perl2-2.0.9~rc2/debian/apache2.conf' -bugreport -verbose=1
AH00558: apache2: Could not reliably determine the server's fully qualified
doma
in name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress
this message
(2)No such file or directory: AH02291: Cannot access directory
'/raid/build/work/libapache2-mod-perl2-2.0.9~rc2/t/logs/' for main error log
AH00014: Configuration check failed
/usr/sbin/apache2  -d /raid/build/work/libapache2-mod-perl2-2.0.9~rc2/t -f
/raid/build/work/libapache2-mod-perl2-2.0.9~rc2/t/conf/httpd.conf -D APACHE2 -D
APACHE2_4 -D PERL_USEITHREADS
using Apache/2.4.12

waiting 300 seconds for server to start: .[Mon Jun 01 22:31:36.041661 2015]
[env:warn] [pid 15692:tid 140437197727616] AH01506: PassEnv variable
LD_LIBRARY_PATH was undefined
Segmentation fault (core dumped)
[  error] oh golly, server dumped core

Running under gdb shows:

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff35f89ce in modperl_env_init () at modperl_env.c:639
639         StructCopy(&MP_vtbl_env, &PL_vtbl_env, MGVTBL);
(gdb) b modperl_env_init
Breakpoint 1 at 0x7ffff35f88e0: file modperl_env.c, line 635.
(gdb) l
634         /* save originals */
635         StructCopy(&PL_vtbl_env, &MP_PERL_vtbl_env, MGVTBL);
636         StructCopy(&PL_vtbl_envelem, &MP_PERL_vtbl_envelem, MGVTBL);
637
638         /* replace with our versions */
639         StructCopy(&MP_vtbl_env, &PL_vtbl_env, MGVTBL);
640         StructCopy(&MP_vtbl_envelem, &PL_vtbl_envelem, MGVTBL);
641     }
642
643     void modperl_env_unload(void)

StructCopy(src, dst, type) from Perl API essentially does *dst = *src.
In line 639 the destination is PL_vtbl_env which is #define'd
as some element of the array PL_magic_vtables from Perl internals
(I checked that it's index is well within the bounds of the array)

(gdb) whatis PL_magic_vtables
type = const MGVTBL [31]

Note the "const" here!

(gdb) info symbol PL_magic_vtables
PL_magic_vtables in section .data.rel.ro of /usr/lib/x86_64-linux-
gnu/libperl.so.5.22

So, GCC has put PL_magic_vtables into a read-only section,
hence trying to write to it deservedly produces a segfault.

Cheers, Roderich





-- Package-specific info:

-- System Information:
Debian Release: stretch/sid
  APT prefers wily
  APT policy: (500, 'wily'), (500, 'buildd-unstable'), (500, 'unstable'), (1, 'buildd-experimental'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.1.0-rc6 (SMP w/4 CPU cores)
Locale: LANG=en_US.utf8, LC_CTYPE=en_US.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

-- no debconf information



More information about the pkg-perl-maintainers mailing list