apache2-mod-perl crashes out of the box
Below is a transcript of spawning an Alpine Linux edge container, in which I try to get Apache’s mod_perl to work:
$ docker run --cap-add=SYS_PTRACE -ti alpine:edge /bin/sh
/ # echo http://dl-cdn.alpinelinux.org/alpine/edge/testing >> /etc/apk/repositories
/ # apk update
fetch http://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/edge/testing/x86_64/APKINDEX.tar.gz
v3.7.0_rc1-92-g51636f3dca [http://dl-cdn.alpinelinux.org/alpine/edge/main]
v3.7.0_rc1-94-gedc7d52f27 [http://dl-cdn.alpinelinux.org/alpine/edge/community]
v3.7.0_rc1-95-g58c2060efd [http://dl-cdn.alpinelinux.org/alpine/edge/testing]
OK: 11743 distinct packages available
/ # apk upgrade
Upgrading critical system libraries and apk-tools:
(1/5) Installing libressl2.6-libcrypto (2.6.3-r0)
(2/5) Installing libressl2.6-libssl (2.6.3-r0)
(3/5) Upgrading apk-tools (2.8.0-r1 -> 2.8.1-r1)
(4/5) Purging libressl2.5-libssl (2.5.5-r3)
(5/5) Purging libressl2.5-libcrypto (2.5.5-r3)
Executing busybox-1.27.2-r2.trigger
Continuing the upgrade transaction with new apk-tools:
(1/3) Upgrading musl (1.1.17-r1 -> 1.1.18-r2)
(2/3) Upgrading busybox (1.27.2-r2 -> 1.27.2-r4)
Executing busybox-1.27.2-r4.post-upgrade
NOTE: /usr/sbin/udhcpd has been moved to the package 'busybox-extras'
(3/3) Upgrading musl-utils (1.1.17-r1 -> 1.1.18-r2)
Executing busybox-1.27.2-r4.trigger
OK: 4 MiB in 11 packages
/ # apk add apache2-mod-perl
(1/9) Installing libuuid (2.31-r0)
(2/9) Installing apr (1.6.3-r0)
(3/9) Installing expat (2.2.5-r0)
(4/9) Installing apr-util (1.6.1-r1)
(5/9) Installing pcre (8.41-r1)
(6/9) Installing apache2 (2.4.29-r1)
Executing apache2-2.4.29-r1.pre-install
(7/9) Installing libbz2 (1.0.6-r6)
(8/9) Installing perl (5.26.1-r1)
(9/9) Installing apache2-mod-perl (2.0.10-r0)
Executing busybox-1.27.2-r4.trigger
OK: 47 MiB in 20 packages
/ # apk add gdb
(1/5) Installing ncurses-terminfo-base (6.0_p20170930-r0)
(2/5) Installing ncurses-terminfo (6.0_p20170930-r0)
(3/5) Installing ncurses-libs (6.0_p20170930-r0)
(4/5) Installing readline (7.0.003-r0)
(5/5) Installing gdb (8.0.1-r3)
Executing busybox-1.27.2-r4.trigger
OK: 61 MiB in 25 packages
/ # gdb `which httpd`
[...]
(gdb) run -e debug -DFOREGROUND
Starting program: /usr/sbin/httpd -e debug -DFOREGROUND
[...]
[Mon Nov 27 11:24:08.816606 2017] [so:debug] [pid 39] mod_so.c(266): AH01575: loaded module perl_module from /var/www/modules/mod_perl.so
AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using 172.17.0.2. Set the 'ServerName' directive globally to suppress this message
Program received signal SIGBUS, Bus error.
0x00007fd2683bd367 in Perl_hfree_next_entry () from /usr/lib/perl5/core_perl/CORE/libperl.so
(gdb) bt
#0 0x00007fd2683bd367 in Perl_hfree_next_entry () from /usr/lib/perl5/core_perl/CORE/libperl.so
#1 0x00007fd2683bd534 in ?? () from /usr/lib/perl5/core_perl/CORE/libperl.so
#2 0x00007fd2683bfb0b in Perl_hv_clear () from /usr/lib/perl5/core_perl/CORE/libperl.so
#3 0x00007fd2686dbf6a in modperl_env_clear () from /var/www/modules/mod_perl.so
#4 0x00007fd2686ced04 in ?? () from /var/www/modules/mod_perl.so
#5 0x00007fd2683f32a8 in Perl_leave_scope () from /usr/lib/perl5/core_perl/CORE/libperl.so
#6 0x00007fd26835cc2b in perl_parse () from /usr/lib/perl5/core_perl/CORE/libperl.so
#7 0x00007fd2686cf3af in modperl_startup () from /var/www/modules/mod_perl.so
#8 0x00007fd2686cf35c in modperl_startup () from /var/www/modules/mod_perl.so
#9 0x00007fd2686cf735 in modperl_init () from /var/www/modules/mod_perl.so
#10 0x00007fd2686cf894 in modperl_hook_init () from /var/www/modules/mod_perl.so
#11 0x000055dca7bb5780 in ap_run_open_logs ()
#12 0x000055dca7b9909f in main ()
As you can see, it crashes with the default configuration in place, trying to initialize Perl.
(from redmine: issue id 8204, created on 2017-11-27, closed on 2017-11-29)