如何在 mod_perl2 下运行 Devel::Cover?

发布于 2024-08-21 09:20:39 字数 5774 浏览 5 评论 0原文

不幸的是,Devel:: Cover 尚不适用于线程。

它也不适用于 prefork。

startup.pl使用Devel::Cover 发布了

Not a CODE reference.
END failed--call queue aborted.

perl 5.8.9、Apache 2.2.13。我的操作系统是 FreeBSD,如果这很重要的话。 针对 win32 报告了同样的问题。

更新:这是PerlTrace all的输出

copying config
restarting apache
mod_perl trace flags dump:
 a On  (Apache API interaction)
 c On  (configuration for directive handlers)
 d On  (directive processing)
 e On  (environment variables)
 f On  (filters)
 g On  (globals management)
 h On  (handlers)
 i On  (interpreter pool management)
 m On  (memory allocations)
 o On  (I/O)
 r On  (Perl runtime interaction)
 s On  (Perl sections)
 t On  (benchmark-ish timings)
modperl_cmd_requires: push PerlRequire /usr/local/www/apache22/data/startup.pl
modperl_cmd_switches: arg = -I/usr/local/www/apache22/data/PMs
modperl_cmd_switches: arg = -I/usr/local/www/apache22/data/project/lib_core
modperl_cmd_modules: push PerlModule Apache::DBI
modperl_config_dir_new: new dcfg: 0x284d3d48
modperl_config_dir_create: dir \.(cgi|pl)$
modperl_cmd_response_handlers: push @PerlResponseHandler, ModPerl::Registry
modperl_handler_new: [47836] new handler ModPerl::Registry
modperl_cmd_push_handlers: created handler stack
modperl_cmd_push_handlers: pushed handler: ModPerl::Registry
modperl_cmd_options: arg = +ParseHeaders
httpd not running, trying to start
modperl_hook_init: mod_perl hook init
modperl_sys_init: mod_perl sys init
MpSrv flags dump (cdev01.project.local):
 Access On 
 Authen On 
 Authz On 
 Autoload Off
 ChildExit On 
 ChildInit On 
 Cleanup On 
 Clone Off
 Enable On 
 Fixup On 
 HeaderParser On 
 InheritSwitches Off
 InputFilter On 
 Log On 
 MapToStorage On 
 MergeHandlers Off
 OpenLogs On 
 OutputFilter On 
 Parent Off
 PostConfig On 
 PostReadRequest On 
 PreConnection On 
 ProcessConnection On 
 Response On 
 Trans On 
 Type On 
 Unset On 
modperl_startup: starting the parent perl for the base server
modperl_config_srv_argv_init =>
   0 = /usr/local/sbin/httpd
   1 = -I/usr/local/www/apache22/data/PMs
   2 = -I/usr/local/www/apache22/data/project/lib_core
   3 = -e;0
modperl_env_clear: [0x28f2a000] %ENV = ();
modperl_env_default_populate: $ENV{MOD_PERL} = "mod_perl/2.0.4";
modperl_env_default_populate: $ENV{MOD_PERL_API_VERSION} = "2";
modperl_env_configure_server:   [47836/0x28f2a000/cdev01.project.local:80]
    @ENV{keys scfg->SetEnv} = values scfg->SetEnv;
modperl_env_configure_server:   [47836/0x28f2a000/cdev01.project.local:80]
    @ENV{keys scfg->PassEnv} = values scfg->PassEnv;
modperl_env_table_populate: $ENV{PATH} = "/usr/local/www/apache22/data/testing/bin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin";
modperl_interp_init: server=cdev01.project.local:80
modperl_interp_new: 0x28f47480 / perl: 0x0 / parent perl: 0x0
modperl_startup: constructed interpreter=0x28f2a000
modperl_handler_anon_init: init $PL_modglobal{ANONSUB} = []
Devel::Cover 0.65: Collecting coverage data for branch, condition, pod, statement, subroutine and time.
    Collecting under mod_perl/2.0.4
Selecting packages matching:
Ignoring packages matching:
    /Devel/Cover[./]
    /Net/OpenSSH[./]
Ignoring packages in:
    .
    /usr/local/lib/perl5/5.8.9
    /usr/local/lib/perl5/5.8.9/BSDPAN
    /usr/local/lib/perl5/5.8.9/mach
    /usr/local/lib/perl5/site_perl/5.8.9
    /usr/local/lib/perl5/site_perl/5.8.9/mach
modperl_config_apply_PerlRequire: loaded Perl file: /usr/local/www/apache22/data/startup.pl for server cdev01.project.local:80
modperl_config_apply_PerlModule: loaded Perl module Apache::DBI for server cdev01.project.local:80
modperl_init_vhost: Init vhost cdev01.project.local:4443: s=0x284d8500, base_s=0x28413a40
modperl_init_vhost: server cdev01.project.local:4443 already initialized
modperl_init_vhost: Init vhost cdev01.project.local:443: s=0x284d5c78, base_s=0x28413a40
modperl_init_vhost: server cdev01.project.local:443 already initialized
modperl_callback_run_handlers: no PerlOpenLogsHandler handlers configured ()
modperl_callback_run_handlers: no PerlPostConfigHandler handlers configured ()
modperl_env_hash_keys: [0x28f2a000] PERL_HASH: MOD_PERL (len: 8)
modperl_env_hash_keys: [0x28f2a000] PERL_HASH: MOD_PERL_API_VERSION (len: 20)
modperl_init_clones: no clones created for non-threaded mpm
modperl_interp_pool_destroy: parent == 0x28f47480
modperl_interp_destroy: interp == 0x28f47480 / perl: 0x28f2a000
modperl_xs_dl_handles_get: B dl handle == 0x28ca9600
modperl_xs_dl_handles_get: Cwd dl handle == 0x28ca9800
modperl_xs_dl_handles_get: List::Util dl handle == 0x28ca9a00
modperl_xs_dl_handles_get: Digest::MD5 dl handle == 0x28ca9c00
modperl_xs_dl_handles_get: IO dl handle == 0x28ca9e00
modperl_xs_dl_handles_get: Fcntl dl handle == 0x28caa000
modperl_xs_dl_handles_get: Storable dl handle == 0x28caa200
modperl_xs_dl_handles_get: File::Glob dl handle == 0x28caa400
modperl_xs_dl_handles_get: Data::Dumper dl handle == 0x28caa600
modperl_xs_dl_handles_get: Devel::Cover dl handle == 0x28caa800
modperl_xs_dl_handles_get: Apache2::Module dl handle == 0x28caaa00
modperl_xs_dl_handles_get: Apache2::RequestUtil dl handle == 0x28caac00
modperl_xs_dl_handles_get: Apache2::ServerUtil dl handle == 0x28caae00
modperl_xs_dl_handles_get: DBI dl handle == 0x28cac000
modperl_perl_call_list: pid 47836/tid 0x28401040/perl id 0x28f2a000 running 4 END subs
Not a CODE reference.
END failed--call queue aborted.

Unfortunately, Devel::Cover does not yet work with threads.

It doesn't work with prefork either.

Being use'd in startup.pl, Devel::Cover issues

Not a CODE reference.
END failed--call queue aborted.

perl 5.8.9, Apache 2.2.13. My OS is FreeBSD, if that matters. The same problem is reported for win32.

Update: Here's output for PerlTrace all

copying config
restarting apache
mod_perl trace flags dump:
 a On  (Apache API interaction)
 c On  (configuration for directive handlers)
 d On  (directive processing)
 e On  (environment variables)
 f On  (filters)
 g On  (globals management)
 h On  (handlers)
 i On  (interpreter pool management)
 m On  (memory allocations)
 o On  (I/O)
 r On  (Perl runtime interaction)
 s On  (Perl sections)
 t On  (benchmark-ish timings)
modperl_cmd_requires: push PerlRequire /usr/local/www/apache22/data/startup.pl
modperl_cmd_switches: arg = -I/usr/local/www/apache22/data/PMs
modperl_cmd_switches: arg = -I/usr/local/www/apache22/data/project/lib_core
modperl_cmd_modules: push PerlModule Apache::DBI
modperl_config_dir_new: new dcfg: 0x284d3d48
modperl_config_dir_create: dir \.(cgi|pl)$
modperl_cmd_response_handlers: push @PerlResponseHandler, ModPerl::Registry
modperl_handler_new: [47836] new handler ModPerl::Registry
modperl_cmd_push_handlers: created handler stack
modperl_cmd_push_handlers: pushed handler: ModPerl::Registry
modperl_cmd_options: arg = +ParseHeaders
httpd not running, trying to start
modperl_hook_init: mod_perl hook init
modperl_sys_init: mod_perl sys init
MpSrv flags dump (cdev01.project.local):
 Access On 
 Authen On 
 Authz On 
 Autoload Off
 ChildExit On 
 ChildInit On 
 Cleanup On 
 Clone Off
 Enable On 
 Fixup On 
 HeaderParser On 
 InheritSwitches Off
 InputFilter On 
 Log On 
 MapToStorage On 
 MergeHandlers Off
 OpenLogs On 
 OutputFilter On 
 Parent Off
 PostConfig On 
 PostReadRequest On 
 PreConnection On 
 ProcessConnection On 
 Response On 
 Trans On 
 Type On 
 Unset On 
modperl_startup: starting the parent perl for the base server
modperl_config_srv_argv_init =>
   0 = /usr/local/sbin/httpd
   1 = -I/usr/local/www/apache22/data/PMs
   2 = -I/usr/local/www/apache22/data/project/lib_core
   3 = -e;0
modperl_env_clear: [0x28f2a000] %ENV = ();
modperl_env_default_populate: $ENV{MOD_PERL} = "mod_perl/2.0.4";
modperl_env_default_populate: $ENV{MOD_PERL_API_VERSION} = "2";
modperl_env_configure_server:   [47836/0x28f2a000/cdev01.project.local:80]
    @ENV{keys scfg->SetEnv} = values scfg->SetEnv;
modperl_env_configure_server:   [47836/0x28f2a000/cdev01.project.local:80]
    @ENV{keys scfg->PassEnv} = values scfg->PassEnv;
modperl_env_table_populate: $ENV{PATH} = "/usr/local/www/apache22/data/testing/bin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin";
modperl_interp_init: server=cdev01.project.local:80
modperl_interp_new: 0x28f47480 / perl: 0x0 / parent perl: 0x0
modperl_startup: constructed interpreter=0x28f2a000
modperl_handler_anon_init: init $PL_modglobal{ANONSUB} = []
Devel::Cover 0.65: Collecting coverage data for branch, condition, pod, statement, subroutine and time.
    Collecting under mod_perl/2.0.4
Selecting packages matching:
Ignoring packages matching:
    /Devel/Cover[./]
    /Net/OpenSSH[./]
Ignoring packages in:
    .
    /usr/local/lib/perl5/5.8.9
    /usr/local/lib/perl5/5.8.9/BSDPAN
    /usr/local/lib/perl5/5.8.9/mach
    /usr/local/lib/perl5/site_perl/5.8.9
    /usr/local/lib/perl5/site_perl/5.8.9/mach
modperl_config_apply_PerlRequire: loaded Perl file: /usr/local/www/apache22/data/startup.pl for server cdev01.project.local:80
modperl_config_apply_PerlModule: loaded Perl module Apache::DBI for server cdev01.project.local:80
modperl_init_vhost: Init vhost cdev01.project.local:4443: s=0x284d8500, base_s=0x28413a40
modperl_init_vhost: server cdev01.project.local:4443 already initialized
modperl_init_vhost: Init vhost cdev01.project.local:443: s=0x284d5c78, base_s=0x28413a40
modperl_init_vhost: server cdev01.project.local:443 already initialized
modperl_callback_run_handlers: no PerlOpenLogsHandler handlers configured ()
modperl_callback_run_handlers: no PerlPostConfigHandler handlers configured ()
modperl_env_hash_keys: [0x28f2a000] PERL_HASH: MOD_PERL (len: 8)
modperl_env_hash_keys: [0x28f2a000] PERL_HASH: MOD_PERL_API_VERSION (len: 20)
modperl_init_clones: no clones created for non-threaded mpm
modperl_interp_pool_destroy: parent == 0x28f47480
modperl_interp_destroy: interp == 0x28f47480 / perl: 0x28f2a000
modperl_xs_dl_handles_get: B dl handle == 0x28ca9600
modperl_xs_dl_handles_get: Cwd dl handle == 0x28ca9800
modperl_xs_dl_handles_get: List::Util dl handle == 0x28ca9a00
modperl_xs_dl_handles_get: Digest::MD5 dl handle == 0x28ca9c00
modperl_xs_dl_handles_get: IO dl handle == 0x28ca9e00
modperl_xs_dl_handles_get: Fcntl dl handle == 0x28caa000
modperl_xs_dl_handles_get: Storable dl handle == 0x28caa200
modperl_xs_dl_handles_get: File::Glob dl handle == 0x28caa400
modperl_xs_dl_handles_get: Data::Dumper dl handle == 0x28caa600
modperl_xs_dl_handles_get: Devel::Cover dl handle == 0x28caa800
modperl_xs_dl_handles_get: Apache2::Module dl handle == 0x28caaa00
modperl_xs_dl_handles_get: Apache2::RequestUtil dl handle == 0x28caac00
modperl_xs_dl_handles_get: Apache2::ServerUtil dl handle == 0x28caae00
modperl_xs_dl_handles_get: DBI dl handle == 0x28cac000
modperl_perl_call_list: pid 47836/tid 0x28401040/perl id 0x28f2a000 running 4 END subs
Not a CODE reference.
END failed--call queue aborted.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

恬淡成诗 2024-08-28 09:20:39

邪恶之源似乎是 Apache::DBI。我从配置文件中将其注释掉,然后 httpd 启动了。

不幸的是,更多的障碍即将到来 :( Devel 没有覆盖运行时::Cover 和 ModPerl::Registry

The source of evil appeared to be Apache::DBI. I commented it out from the config file, and httpd started.

Unfortunately, more obstacles are here to come :( No coverage for runtime with Devel::Cover and ModPerl::Registry

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文