Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mouse fails under ModPerl::Registry #60

Open
guimard opened this issue May 3, 2016 · 10 comments
Open

Mouse fails under ModPerl::Registry #60

guimard opened this issue May 3, 2016 · 10 comments

Comments

@guimard
Copy link

guimard commented May 3, 2016

Hi,
I'm using Mouse (2.4.5) under Debian testing (mod_perl 2.0.9, Perl 5.22.1). This simple test fails:

  • CGI:

    package main;
    use CGI;
    require '/tmp/test.pm';
    my $q = CGI->new();
    print $q->header( -type => 'text/html' );
    print 'OK';

  • Mouse package (/tmp/test.pm):

    package My;
    use strict;
    use Mouse;
    has a => ( is => 'rw' );
    1;

  • Result in Apache logs when trying to load CGI: No package name defined at /usr/lib/x86_64-linux-gnu/perl5/5.22/Mouse.pm line 137.\nBEGIN failed--compilation aborted at /tmp/test.pm line 4

@syohex
Copy link
Collaborator

syohex commented May 3, 2016

I cannot reproduce this issue on Debian stable with Perl 5.20.2(libapache2-mod-perl2 2.0.9).
Could you show us how to reproduce this issue in more detail(reproducing steps, Apache configuration etc) ?

@guimard
Copy link
Author

guimard commented May 3, 2016

It works with Debian stable and Ubuntu 15.10 but fails with Debian testing (mod_perl 2.0.9 and Perl 5.22.1). My Apache config is very simple:

<VirtualHost *:80>
ServerName test.example.com
# DocumentRoot
DocumentRoot /var/www/test
<Directory /var/www/test>
    Require all granted
    Options +ExecCGI +FollowSymLinks
</Directory>
# Perl script
<Files *.pl>
    SetHandler perl-script
    PerlResponseHandler ModPerl::Registry
</Files>
</VirtualHost>

@syohex
Copy link
Collaborator

syohex commented May 8, 2016

Hmm, I cannot reproduce on Debian testing(Perl 5.22.2, Apache 2.4.18-2, mod_perl, 2.0.9-4+b1).

@guimard
Copy link
Author

guimard commented May 10, 2016

Hello, it's a bit more complex (some Perl code was loaded). Here is an example that reproduce the problem:

Apache.conf:

PerlModule My
<VirtualHost *:80>
ServerName test.example.com
# DocumentRoot
DocumentRoot /var/www/test
<Directory /var/www/test>
    Require all granted
    Options +ExecCGI +FollowSymLinks
</Directory>
# Perl script
<Files *.pl>
    SetHandler perl-script
    PerlResponseHandler ModPerl::Registry
</Files>
</VirtualHost>

test. pl:

package main;
use CGI;
use My2;
my $q = CGI->new();
print $q->header( -type => 'text/html' );
print '<html><body>OK</body></html>';

My.pm:

package My;
use strict;
use Mouse;
has a => ( is => 'rw' );
1;

My2.pm:

package My2;
use strict;
use Mouse;
has b => ( is => 'rw' );
1;

@guimard
Copy link
Author

guimard commented May 16, 2016

Hi,
did you succeed to reproduce the bug ?

@syohex
Copy link
Collaborator

syohex commented May 16, 2016

No. Could you give us Dockerfile which reproduces this issue ?

@guimard
Copy link
Author

guimard commented May 16, 2016

Hi,
here is a Dockerfile with files mentioned above:
mouse-bug-with-modperl.tar.gz

@syohex
Copy link
Collaborator

syohex commented May 16, 2016

I can reproduce this issue with your Dockerfile. However is this Mouse issue ? I suppose this is ModPerl::Registry namespace handling issue. (However I don't understand namespace handling of ModPerl::Registry)

@guimard
Copy link
Author

guimard commented May 17, 2016

But it works with Moose... This error is generated by XS part of Mouse (xs-src/Mouse.xs, line 507). I don't understand why it doesn't find the Perl namespace here (My2) since it is well found by Moose.

I found this problem during Debian packaging of Lemonldap::NG.

@guimard
Copy link
Author

guimard commented May 22, 2016

Bug confirmed by Debian Perl Group

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants