我们的应用程序是一个整体 Perl 应用程序,当前在 RHEL 6 上运行,我正在尝试将其构建在 RHEL 7 上。我们在 Perl 5.18.2 线程上使用 perlbrew 运行。它安装到我们的 /opt/prism 目录中,但符号链接到 /usr/local/bin/perl 因此,如果您看到它链接到那里,那就是原因。我已经正确设置了大部分内容,但是当我尝试编译 libapreq2 时,我遇到了奇怪的问题。
配置运行正常并且 make 运行没有问题。但是, make test 会引发有关 Apache::TestSSLCA 的错误
以下是我以非 root 用户身份运行的命令,但首先是 perl 版本信息
bash# perl -v
This is perl 5, version 18, subversion 2 (v5.18.2) built for x86_64-linux-thread-multi
(with 1 registered patch, see perl -V for more detail)
./configure --prefix=/opt/prism/work --enable-perl-glue --with-apache2-apxs=/opt/prism/work/bin/apxs --with-perl=/usr/local/bin/perl
make
make test
我收到此错误:
ulimit -c unlimited; /opt/prism/perl5/perlbrew/perls/threaded-perl-5.18.2/bin/perl /opt/PEC.longshot/libapreq2-2.13/module/t/TEST
[ debug] configuring httpd
[ debug] Using httpd: /opt/prism/work/bin/httpd
[ debug] isolated httpd_info VERSION = Apache/2.2.27 (Unix)
[ debug] isolated httpd_info BUILT = May 7 2020 10:37:33
[ debug] isolated httpd_info MODULE_MAGIC_NUMBER = 20051115:33
[ debug] isolated httpd_info SERVER_MPM = Prefork
[ debug] isolated httpd_defines APACHE_MPM_DIR = server/mpm/prefork
[ debug] isolated httpd_defines APR_HAS_SENDFILE = 1
[ debug] isolated httpd_defines APR_HAS_MMAP = 1
[ debug] isolated httpd_defines APR_HAVE_IPV6 (IPv4-mapped addresses enabled) = 1
[ debug] isolated httpd_defines APR_USE_SYSVSEM_SERIALIZE = 1
[ debug] isolated httpd_defines APR_USE_PTHREAD_SERIALIZE = 1
[ debug] isolated httpd_defines SINGLE_LISTEN_UNSERIALIZED_ACCEPT = 1
[ debug] isolated httpd_defines APR_HAS_OTHER_CHILD = 1
[ debug] isolated httpd_defines AP_HAVE_RELIABLE_PIPED_LOGS = 1
[ debug] isolated httpd_defines DYNAMIC_MODULE_LIMIT = 128
[ debug] isolated httpd_defines HTTPD_ROOT = /opt/prism/work
[ debug] isolated httpd_defines SUEXEC_BIN = /opt/prism/work/bin/suexec
[ debug] isolated httpd_defines DEFAULT_PIDLOG = logs/httpd.pid
[ debug] isolated httpd_defines DEFAULT_SCOREBOARD = logs/apache_runtime_status
[ debug] isolated httpd_defines DEFAULT_LOCKFILE = logs/accept.lock
[ debug] isolated httpd_defines DEFAULT_ERRORLOG = logs/error_log
[ debug] isolated httpd_defines AP_TYPES_CONFIG_FILE = conf/mime.types
[ debug] isolated httpd_defines SERVER_CONFIG_FILE = conf/httpd.conf
[ debug] inheriting config file: /opt/prism/work/conf/httpd.conf
[ debug] using httpd.conf inherited ServerRoot to resolve conf/mime.types
[ debug] conf/mime.types successfully resolved to existing file /opt/prism/work/conf/mime.types
[ debug] Matched Apache revision Apache/2.2.27 2
[ error] configure() has failed:
Use of each() on hash after insertion without resetting hash iterator results in undefined behavior, Perl interpreter: 0x18a2010 at /opt/prism/perl5/perlbrew/perls/threaded-perl-5.18.2/lib/site_perl/5.18.2/x86_64-linux-thread-multi/Apache/TestSSLCA.pm line 103.
Compilation failed in require at /opt/prism/perl5/perlbrew/perls/threaded-perl-5.18.2/lib/site_perl/5.18.2/x86_64-linux-thread-multi/Apache/TestConfig.pm line 1474.
如果我查看 TestSSLCA.pm 第 103 行,它有
#generate DSA versions of the server certs/keys
while (my($key, $val) = each %$cert_dn) {
next unless $key =~ /^server/;
my $name = join '_', $key, 'dsa';
$cert_dn->{$name} = { %$val }; #copy
$cert_dn->{$name}->{OU} =~ s/rsa/dsa/;
}
TestConfig.pm 第 1474 行刚刚有
require Apache::TestSSLCA;
任何帮助将不胜感激
答案1
您引用的代码似乎是%cert_dn
在迭代的循环中写入的%cert_dn
。您用来编译的 Perl 版本告诉您这是不允许的。
在 RHEL 6 上,您是使用较旧的 Perl 进行构建的吗?
我怀疑如果你升级 mod_perl 或降级 Perl 你将能够成功构建。
在里面当前 mod_perl 主干有问题的片段如下所示:
#generate DSA versions of the server certs/keys
for my $key (keys %$cert_dn) {
next unless $key =~ /^server/;
my $val = $$cert_dn{$key};
my $name = join '_', $key, 'dsa';
$cert_dn->{$name} = { %$val }; #copy
$cert_dn->{$name}->{OU} =~ s/rsa/dsa/;
}
如果您将其复制到您的 mod_perl 版本中,结果也可能会构建。