You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Adam Griffiths <ne...@adam-griffiths.co.uk> on 2003/11/06 21:31:44 UTC
mod_perl large file support
Hi All,
How can I get a definitive answer as to whether mod_perl was compiled with
Large File Support?
I have a shell login account but not root.
Regards
Adam
--
Reporting bugs: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
Re: mod_perl large file support
Posted by Adam Griffiths <ne...@adam-griffiths.co.uk>.
Thanks Stas for your detailed reply.
I have apache 1.3. apxs -q cflags does not show any mention of
LARGEFILE_SOURCE neither does ap_config_auto.h, I guess that's definitive
answer...
Perl -V indicates USE_LARGE_FILES as a compile time option.
I'm not sure what mod_perl was compiled with but Apache::MyConfig indicates
'PERL_USELARGEFILES' => 0.
The reason I ask is that i'm trying to install AxKit, a mod_perl handeler.
AxKit is giving me errors that I believe are associated with large file
support.
Thanks for the help
Adam
"Stas Bekman" <st...@stason.org> wrote in message
news:3FAABB86.9080401@stason.org...
> Adam Griffiths wrote:
> > Hi All,
> >
> > How can I get a definitive answer as to whether mod_perl was compiled
with
> > Large File Support?
> >
> > I have a shell login account but not root.
>
> It's complicated. Because Apache and Perl need to be compiled with LFS to
> really "have" it under mod_perl. Many times you get Perl compiled with LFS
but
> not Apache, or the other way around. Depending on what you do it could be
> enough to have Perl compiled with LFS. e.g. if you call a perl function
which
> doesn't interact with Apache guts it'll work just fine. If perl needs to
> interact with Apache (e.g. passing some non-zero offset to an Apache API)
> there is a problem. If your Apache log file grows beyong 2G and have
Apache
> with LFS, but not Perl you are fine too, since Apache will do the right
thing.
>
> It's easy to check perl:
>
> % perl -V | grep USE_LARGE_FILES
> Compile-time options: MULTIPLICITY USE_ITHREADS USE_LARGE_FILES
> PERL_IMPLICIT_CONTEXT
>
> It's harder with Apache, since you need to grep its include files (which
may
> be unavailable). I don't know which Apache you are using, each version has
it
> in a different way:
>
> 2) for Apache2 it's an APR issue, so you do:
>
> % grep APR_HAS_LARGE_FILES /home/stas/httpd/prefork/include/apr.h
> #define APR_HAS_LARGE_FILES 0
>
> As you can see on linux APR builds with no LFS, which sucks. And this is a
> hardcoded setting, you can't change it via config options. Here is the
> explanation of that reasoning:
> http://marc.theaimsgroup.com/?l=apr-dev&m=105277560530754&w=2
>
>
> 1) Apache 1.3 has a different define in include/ap_config_auto.h:
> #define _LARGEFILE_SOURCE 1
>
> which gets defined if you pass -D_LARGEFILE_SOURCE, when building Apache.
>
> If you have a dynamic build you could also use apxs:
>
> /home/stas/httpd/1.3-dynamic/bin/apxs -q cflags
> -DLINUX=22 -I/usr/include/db1 -DMOD_PERL -DUSE_HSREGEX -D_REENTRANT
> -DTHREADS_HAVE_PIDS -DDEBUGGING -fno-strict-aliasing -I/usr/local/include
> -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm -g
> -DPERL_DESTRUCT_LEVEL=2/home/stas
>
> As you can see -D_LARGEFILE_SOURCE is on
> __________________________________________________________________
> Stas Bekman JAm_pH ------> Just Another mod_perl Hacker
> http://stason.org/ mod_perl Guide ---> http://perl.apache.org
> mailto:stas@stason.org http://use.perl.org http://apacheweek.com
> http://modperlbook.org http://apache.org http://ticketmaster.com
>
>
> --
> Reporting bugs: http://perl.apache.org/bugs/
> Mail list info: http://perl.apache.org/maillist/modperl.html
>
>
--
Reporting bugs: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
Re: mod_perl large file support
Posted by Stas Bekman <st...@stason.org>.
Adam Griffiths wrote:
> In terms of mod_perl is it an error to have Perl compiled with LFS but not
> Apache, or the other way around? In otherwords should LFS for the two
> programs always mach? Or should mod_perl aplications be able to handle a
> mismatch in LFS between Apache and Perl?
I guess I've failed to explain that in my original reply. I'll try again.
The answer is: it depends
In the tables below + indicated has LSF support, - indicates the lack of.
1) Using pure Perl APIs
If your mod_perl code does:
print $log "foo";
which crosses 2GB limits
| Apache+ Apache-
------+----------------
Perl+ | V V
Perl- | X X
Notice that Apache is not involved here at all.
2) Using pure Apache APIs
If your mod_perl code does:
$r->log_error("foo");
which cross 2GB limit.
| Apache+ Apache-
------+----------------
Perl+ | V X
Perl- | V X
Notice that here Perl doesn't affect Apache API log_error() it merely passes a
string to that C API.
3) Using mixed APIs
I can't think at the moment of a good mp1 example since I haven't done that
for a while, but I'll use an example from APR::PerlIO (mp2) where the APIs mix.
If you open a file and seek on its $fh like so:
open my $fh, "<:APR", $filename or die $";
seek $fh, 10, 0;
If the file is < 2GB:
| Apache+ Apache-
------+----------------
Perl+ | V X
Perl- | X V
here it will work only if either both have or both don't have LFS, because the
sizes of the types must match. If they don't match, seek will die (because
check that condition).
If the file is >= 2GB:
| Apache+ Apache-
------+----------------
Perl+ | V X
Perl- | X X
it'll work only if both support LFS.
This 3rd case is the most complicated because if there is a mismatch between
Perl and Apache, and the code where the two has to co-operate is not checking
for that mismatch you may get random failures, just like we had with the seek
in APR::PerlIO which now will die if a non-zero POSITION is used when the two
don't agree.
Hope that this makes things clear. And if it doesn't please ask more specific
questions regarding specific APIs.
__________________________________________________________________
Stas Bekman JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org http://ticketmaster.com
--
Reporting bugs: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
Re: mod_perl large file support
Posted by Adam Griffiths <ne...@adam-griffiths.co.uk>.
In terms of mod_perl is it an error to have Perl compiled with LFS but not
Apache, or the other way around? In otherwords should LFS for the two
programs always mach? Or should mod_perl aplications be able to handle a
mismatch in LFS between Apache and Perl?
"Stas Bekman" <st...@stason.org> wrote in message
news:3FAABB86.9080401@stason.org...
> Adam Griffiths wrote:
> > Hi All,
> >
> > How can I get a definitive answer as to whether mod_perl was compiled
with
> > Large File Support?
> >
> > I have a shell login account but not root.
>
> It's complicated. Because Apache and Perl need to be compiled with LFS to
> really "have" it under mod_perl. Many times you get Perl compiled with LFS
but
> not Apache, or the other way around. Depending on what you do it could be
> enough to have Perl compiled with LFS. e.g. if you call a perl function
which
> doesn't interact with Apache guts it'll work just fine. If perl needs to
> interact with Apache (e.g. passing some non-zero offset to an Apache API)
> there is a problem. If your Apache log file grows beyong 2G and have
Apache
> with LFS, but not Perl you are fine too, since Apache will do the right
thing.
>
> It's easy to check perl:
>
> % perl -V | grep USE_LARGE_FILES
> Compile-time options: MULTIPLICITY USE_ITHREADS USE_LARGE_FILES
> PERL_IMPLICIT_CONTEXT
>
> It's harder with Apache, since you need to grep its include files (which
may
> be unavailable). I don't know which Apache you are using, each version has
it
> in a different way:
>
> 2) for Apache2 it's an APR issue, so you do:
>
> % grep APR_HAS_LARGE_FILES /home/stas/httpd/prefork/include/apr.h
> #define APR_HAS_LARGE_FILES 0
>
> As you can see on linux APR builds with no LFS, which sucks. And this is a
> hardcoded setting, you can't change it via config options. Here is the
> explanation of that reasoning:
> http://marc.theaimsgroup.com/?l=apr-dev&m=105277560530754&w=2
>
>
> 1) Apache 1.3 has a different define in include/ap_config_auto.h:
> #define _LARGEFILE_SOURCE 1
>
> which gets defined if you pass -D_LARGEFILE_SOURCE, when building Apache.
>
> If you have a dynamic build you could also use apxs:
>
> /home/stas/httpd/1.3-dynamic/bin/apxs -q cflags
> -DLINUX=22 -I/usr/include/db1 -DMOD_PERL -DUSE_HSREGEX -D_REENTRANT
> -DTHREADS_HAVE_PIDS -DDEBUGGING -fno-strict-aliasing -I/usr/local/include
> -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm -g
> -DPERL_DESTRUCT_LEVEL=2/home/stas
>
> As you can see -D_LARGEFILE_SOURCE is on
> __________________________________________________________________
> Stas Bekman JAm_pH ------> Just Another mod_perl Hacker
> http://stason.org/ mod_perl Guide ---> http://perl.apache.org
> mailto:stas@stason.org http://use.perl.org http://apacheweek.com
> http://modperlbook.org http://apache.org http://ticketmaster.com
>
>
> --
> Reporting bugs: http://perl.apache.org/bugs/
> Mail list info: http://perl.apache.org/maillist/modperl.html
>
>
--
Reporting bugs: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
Re: mod_perl large file support
Posted by Stas Bekman <st...@stason.org>.
Adam Griffiths wrote:
> Hi All,
>
> How can I get a definitive answer as to whether mod_perl was compiled with
> Large File Support?
>
> I have a shell login account but not root.
It's complicated. Because Apache and Perl need to be compiled with LFS to
really "have" it under mod_perl. Many times you get Perl compiled with LFS but
not Apache, or the other way around. Depending on what you do it could be
enough to have Perl compiled with LFS. e.g. if you call a perl function which
doesn't interact with Apache guts it'll work just fine. If perl needs to
interact with Apache (e.g. passing some non-zero offset to an Apache API)
there is a problem. If your Apache log file grows beyong 2G and have Apache
with LFS, but not Perl you are fine too, since Apache will do the right thing.
It's easy to check perl:
% perl -V | grep USE_LARGE_FILES
Compile-time options: MULTIPLICITY USE_ITHREADS USE_LARGE_FILES
PERL_IMPLICIT_CONTEXT
It's harder with Apache, since you need to grep its include files (which may
be unavailable). I don't know which Apache you are using, each version has it
in a different way:
2) for Apache2 it's an APR issue, so you do:
% grep APR_HAS_LARGE_FILES /home/stas/httpd/prefork/include/apr.h
#define APR_HAS_LARGE_FILES 0
As you can see on linux APR builds with no LFS, which sucks. And this is a
hardcoded setting, you can't change it via config options. Here is the
explanation of that reasoning:
http://marc.theaimsgroup.com/?l=apr-dev&m=105277560530754&w=2
1) Apache 1.3 has a different define in include/ap_config_auto.h:
#define _LARGEFILE_SOURCE 1
which gets defined if you pass -D_LARGEFILE_SOURCE, when building Apache.
If you have a dynamic build you could also use apxs:
/home/stas/httpd/1.3-dynamic/bin/apxs -q cflags
-DLINUX=22 -I/usr/include/db1 -DMOD_PERL -DUSE_HSREGEX -D_REENTRANT
-DTHREADS_HAVE_PIDS -DDEBUGGING -fno-strict-aliasing -I/usr/local/include
-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm -g
-DPERL_DESTRUCT_LEVEL=2/home/stas
As you can see -D_LARGEFILE_SOURCE is on
__________________________________________________________________
Stas Bekman JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org http://ticketmaster.com
--
Reporting bugs: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html