in reply to Do XS-components require special considerations with CGI? [SOLVED]
After what was (to me...) an extraordinary, week-long fight, I now conclude that this is, in fact, a memory-size problem. But finding the problem was a rather gruesome experience, as I would now like to briefly relate for the edification of anyone who may follow. I shall try to relate both epiphanies and mistakes ... and not to bore you.
Stave One: the initial symptom
So I went right in to my local CPAN-module repository for this web-site, found the module, and wrapped the bootstrap call to become:
This yielded the “unable to load” messages aforementioned, along with the first real clue (at least to poor me...) that it might somehow be memory-related.eval { ... bootstrap ... }; print STDERR "bootstrap result: $@\n";
A serious problem in a shared-hosting environment is that you don't get to see the Apache error logs. (And, as I discovered, any tools that they might provide to help diagnose server-errors might not actually provide the same environment.) I was able to force the STDERR output to go to a place I could actually use by employing use CGI::Carp qw(carpout). With this routine, in a BEGIN{} block, I could actually see the messages.
In order to actually discover what DynaLoader was doing ... I did this:
$ENV{PERL_DL_DEBUG} = 1;Stave Two: red herrings...
The program itself threw a herring at me because it didn't “flop over and die.” Instead, it caught the error and kept going. And yet, it might be said that it didn't catch the right error, because the bootstrap failure did not immediately reveal itself... only the consequences thereof.
Stave three: zeroing-in on memory
print STDERR "Ulimit is:\n\t" . `bash -c "ulimit -a"` . "\nnow you know...\n";
The output (also listed earlier...) shows that the basic limit is 32meg, which I erroneously supposed must be “plenty.” Although I stumbled-upon the ulimit command (described in man bash ...) fairly early-on, I wasn't using it correctly.
There are two resource-limits that you can impose... “soft” and “hard.” But only the “soft” limit matters. So I wound up doing this:
bash # ... to give myself a nested shell ulimit -Sl32 # ... for example ulimit -a # ... to see what else I needed to change strace -ologfile perl spe-cgi.pl # to run the program with tracing # now review the "logfile" file that has magically appeared
When the program was sufficiently constrained, it finally began to fail, although it still does not do so in exactly the same way. (Right now it falls-dead.)
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Do XS-components require special considerations with CGI? [SOLVED]
by Anonymous Monk on Mar 04, 2009 at 07:48 UTC | |
by locked_user sundialsvc4 (Abbot) on Mar 04, 2009 at 16:30 UTC | |
by hbm (Hermit) on Mar 04, 2009 at 16:41 UTC | |
by Anonymous Monk on Mar 06, 2009 at 11:16 UTC |