Raspbian can not be update properly - raspberry-pi

Suddenly my RaspberryPi can not be upgrade properly. The apt gives following error message. Is there anyone could me how to fix this problem.
Following is the error message
dpkg-deb: error: subprocess tar was killed by signal (Segmentation fault)
Traceback (most recent call last):
File "/usr/bin/apt-listchanges", line 250, in <module>
main()
File "/usr/bin/apt-listchanges", line 108, in main
pkg = DebianFiles.Package(deb)
File "/usr/share/apt-listchanges/DebianFiles.py", line 134, in __init__
self.binary = pkgdata.Package
AttributeError: ControlStanza instance has no attribute 'Package'

i have already found the reason and fixed the problem.
step
1) use this command to catch the trace log.
sudo strace -f -e trace=execve apt-get -y upgrade > execlist 2>&1
2) check the execlist file and notice following error message
[pid 27534] execve("/usr/local/sbin/tar", ["tar", "-x", "-m", "-f", "-", "--warning=no-timestamp"], [/* 17 vars */]) = -1 ENOENT (No such file or directory)
[pid 27534] execve("/usr/local/bin/tar", ["tar", "-x", "-m", "-f", "-", "--warning=no-timestamp"], [/* 17 vars */]) = -1 ENOENT (No such file or directory)
[pid 27534] execve("/usr/sbin/tar", ["tar", "-x", "-m", "-f", "-", "--warning=no-timestamp"], [/* 17 vars */]) = -1 ENOENT (No such file or directory)
[pid 27534] execve("/usr/bin/tar", ["tar", "-x", "-m", "-f", "-", "--warning=no-timestamp"], [/* 17 vars */]) = -1 ENOENT (No such file or directory)
[pid 27534] execve("/sbin/tar", ["tar", "-x", "-m", "-f", "-", "--warning=no-timestamp"], [/* 17 vars */]) = -1 ENOENT (No such file or directory)
[pid 27534] execve("/bin/tar", ["tar", "-x", "-m", "-f", "-", "--warning=no-timestamp"], [/* 17 vars */]) = 0
[pid 27533] +++ exited with 0 +++
[pid 27532] +++ exited with 0 +++
[pid 27531] --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=27533, si_uid=0, si_status=0, si_utime=0, si_stime=0} ---
[pid 27534] --- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=0x638aa} ---
[pid 27534] +++ killed by SIGSEGV +++
3) it seems something wrong with the program tar.
4) download a new tar program on another server and replace it.
the problem solved.

Related

perl compilation: 'Too many levels of symbolic links'

In Linux, installation of perl is failing while running make test command
t/op/exec ...................................................... # Failed test 17 - at op/exec.t line 114
# $! eq 40, 'Too many levels of symbolic links'
FAILED at test 17
Error is not indicating for which symbolic link it is failing.
Steps Followed:
- Download perl archive from https://www.cpan.org/src/
- [user#hostname perl-5.28.3]$ tar -xvzf perl-5.28.3.tar.gz
- [user#hostname perl-5.28.3]$ cd perl-5.28.3
- [user#hostname perl-5.28.3]$ ./Configure -des -Dinstallprefix=<installation directory>
- [user#hostname perl-5.28.3]$ make
- [user#hostname perl-5.28.3]$ make test
Failed 2 tests out of 2464, 99.92% okay.
../cpan/Time-Local/t/Local.t
op/exec.t
Elapsed: 1317 sec
u=12.87 s=34.02 cu=548.85 cs=488.76 scripts=2464 tests=1158447
make: *** [test] Error 1
[user#hostname perl-5.28.3]$ t/TEST op/exec.t
t/op/exec ... # Failed test 17 - at op/exec.t line 114
# $! eq 40, 'Too many levels of symbolic links'
FAILED at test 17
Failed 1 test out of 1, 0.00% okay.
op/exec.t
Verified same behavior is happening for other perl version also, this is indicating some issue with my installation environment.
Any pointer can be helpful.
Thank you for the pointer #choroba.
Following was the root cause.
In <perl-5.28.3>/t/op/exec.t file, we find the following around line 114:
$rc = system { "lskdfj" } "lskdfj";
unless( ok($rc == 255 << 8 or $rc == -1 or $rc == 256 or $rc == 512) ) {
print "# \$rc == $rc\n";
}
unless ( ok( $! == 2 or $! =~ /\bno\b.*\bfile/i or
$! == 13 or $! =~ /permission denied/i or
$! == 22 or $! =~ /invalid argument/i ) ) {
diag sprintf "\$! eq %d, '%s'\n", $!, $!;
}
In my environment PATH env variable value was
[user#hostname perl-5.28.3]$ echo $PATH
/bin:/usr/lib64/qt-3.3/bin:/bin:/usr/bin:/usr/dev_infra/platform/bin:/usr/dev_infra/generic/bin:/usr/local/bin:/usr/local/ade/bin
Within this PATH, for following paths ls attempt is throwing error 'Too many levels of symbolic links'
[user#hostname perl-5.28.3]$ ls -i /usr/local/bin /usr/local/ade/bin
ls: cannot access /usr/local/bin: Too many levels of symbolic links
ls: cannot access /usr/local/ade/bin: Too many levels of symbolic links
[user#hostname perl-5.28.3]$ ls -ltr /usr/local
lrwxrwxrwx. 1 root root 20 Mar 30 2017 bin -> ./packages/local/bin
lrwxrwxrwx. 1 root root 18 Mar 30 2017 ade -> /usr/local/nde/ade
After removing offending paths from PATH, make test is running successfully
[user#hostname perl-5.28.3]$ export PATH=/bin:/usr/lib64/qt-3.3/bin:/bin:/usr/bin:/usr/dev_infra/platform/bin:/usr/dev_infra/generic/bin
[user#hostname perl-5.28.3]$ make test
All tests successful.
Elapsed: 1611 sec
u=14.47 s=44.63 cu=731.82 cs=575.84 scripts=2474 tests=1209537

How can I fix uninitialized value in numeric eq (==)

How can I fix this error:
[Fri Dec 11 12:07:24.417565 2015] [cgi:error] [pid 10838] [client 24.32.36.240:54536] AH01215: [Fri Dec 11 12:07:24 2015]
uu_upload.pl: Use of uninitialized value in numeric eq (==) at uu_upload.pl line 350.: /home/public_html/cgi-bin/uu_upload.pl,
referer: http://www.....com/uploader.php
Line 349 - Line 353 shows:
# Force 'redirect_using_location' if user does not have a javascript capable browser or using embedded_upload_results
if($query->param('no_script') || $query->param('embedded_upload_results') == 1){
$main::config->{redirect_using_js_html} = 0;
$main::config->{redirect_using_location} = 1;
}
Any assistance will be appreciated.
Using the defined function you can check the variable is defined.
if ( defined($variable) && $variable == 10 ) {
...
}

What goes under the hood of `mkvirtualenv` command?

I am curious about what happens under the hood of the mkvirtualenv command and so I am trying to understand how it calls virtualenv.
The lowest hanging fruit is to figure where the virtualenv program is located after installation and where the mkvirtualenv program is located after installation. So:-
Calvins-MacBook-Pro.local ttys006 Mon Apr 23 12:31:07 |~|
calvin$ which mkvirtualenv
Calvins-MacBook-Pro.local ttys006 Mon Apr 23 12:31:10 |~|
calvin$ which virtualenv
/opt/local/library/Frameworks/Python.framework/Versions/2.7/bin/virtualenv
So the strange thing I see here is that which mkvirtualenv does not give any result. Why?
Digging further, in the virtualenvwrapper directory after installing it, I see only 3 python files:-
Calvins-MacBook-Pro.local ttys004 Mon Apr 23 12:28:05 |/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/virtualenvwrapper|
calvin$ ls -la
total 88
drwxr-xr-x 8 root wheel 272 Apr 13 15:07 .
drwxr-xr-x 29 root wheel 986 Apr 15 00:55 ..
-rw-r--r-- 1 root wheel 5292 Apr 13 15:05 hook_loader.py
-rw-r--r-- 1 root wheel 4810 Apr 13 15:07 hook_loader.pyc
-rw-r--r-- 1 root wheel 1390 Apr 13 15:05 project.py
-rw-r--r-- 1 root wheel 2615 Apr 13 15:07 project.pyc
-rw-r--r-- 1 root wheel 7381 Apr 13 15:05 user_scripts.py
-rw-r--r-- 1 root wheel 11472 Apr 13 15:07 user_scripts.pyc
And I suppose that the only reason why mkvirtualenv is now available in my terminal is because I have added in a source/opt/local/library/Frameworks/Python.framework/Versions/2.7/bin/virtualenvwrapper.sh. So answering the question I asked earlier, this is simply because mkvirtualenv is expressed as a bash function and is available in my terminal because I have sourced virtualenvwrapper.sh in my .bashrc or .bash_profile files.
Digging into the virtualenvwrapper.sh script, I see
# Create a new environment, in the WORKON_HOME.
#
# Usage: mkvirtualenv [options] ENVNAME
# (where the options are passed directly to virtualenv)
#
function mkvirtualenv {
typeset -a in_args
typeset -a out_args
typeset -i i
typeset tst
typeset a
typeset envname
typeset requirements
typeset packages
in_args=( "$#" )
if [ -n "$ZSH_VERSION" ]
then
i=1
tst="-le"
else
i=0
tst="-lt"
fi
while [ $i $tst $# ]
do
a="${in_args[$i]}"
# echo "arg $i : $a"
case "$a" in
-a)
i=$(( $i + 1 ));
project="${in_args[$i]}";;
-h)
mkvirtualenv_help;
return;;
-i)
i=$(( $i + 1 ));
packages="$packages ${in_args[$i]}";;
-r)
i=$(( $i + 1 ));
requirements="${in_args[$i]}";;
*)
if [ ${#out_args} -gt 0 ]
then
out_args=( "${out_args[#]-}" "$a" )
else
out_args=( "$a" )
fi;;
esac
i=$(( $i + 1 ))
done
set -- "${out_args[#]}"
eval "envname=\$$#"
virtualenvwrapper_verify_workon_home || return 1
virtualenvwrapper_verify_virtualenv || return 1
(
[ -n "$ZSH_VERSION" ] && setopt SH_WORD_SPLIT
\cd "$WORKON_HOME" &&
"$VIRTUALENVWRAPPER_VIRTUALENV" $VIRTUALENVWRAPPER_VIRTUALENV_ARGS "$#" &&
[ -d "$WORKON_HOME/$envname" ] && \
virtualenvwrapper_run_hook "pre_mkvirtualenv" "$envname"
)
typeset RC=$?
[ $RC -ne 0 ] && return $RC
# If they passed a help option or got an error from virtualenv,
# the environment won't exist. Use that to tell whether
# we should switch to the environment and run the hook.
[ ! -d "$WORKON_HOME/$envname" ] && return 0
# If they gave us a project directory, set it up now
# so the activate hooks can find it.
if [ ! -z "$project" ]
then
setvirtualenvproject "$WORKON_HOME/$envname" "$project"
fi
# Now activate the new environment
workon "$envname"
if [ ! -z "$requirements" ]
then
pip install -r "$requirements"
fi
for a in $packages
do
pip install $a
done
virtualenvwrapper_run_hook "post_mkvirtualenv"
}
Here's where I don't understand yet - I don't seem to see any direct reference to virtualenv in this bash function. So how exactly does this bash function mkvirtualenv pass the arguments from command line (e.g. mkvirtualenv -p python2.7 --no-site-packages mynewproject) to the python virtualenv program?
So this is the line that does the trick.
(
[ -n "$ZSH_VERSION" ] && setopt SH_WORD_SPLIT
\cd "$WORKON_HOME" &&
"$VIRTUALENVWRAPPER_VIRTUALENV" $VIRTUALENVWRAPPER_VIRTUALENV_ARGS "$#" &&
[ -d "$WORKON_HOME/$envname" ] && \
virtualenvwrapper_run_hook "pre_mkvirtualenv" "$envname"
)
$VIRTUALENVWRAPPER_VIRTUALENV is in fact the location of where the current virtualenv program resides.
In terminal,
Calvins-MacBook-Pro.local ttys004 Mon Apr 23 13:24:14 |~|
calvin$ which $VIRTUALENVWRAPPER_VIRTUALENV
/opt/local/library/Frameworks/Python.framework/Versions/2.7/bin/virtualenv
Mytsery solved.

Perl Cygwin fun. Module is loaded, but not being found by the program

Okay a few rules:
No, I cannot install Strawberry Perl on this system. I have to use Cygwin.
This is Perl 5.8.7. I cannot update it.
This is not my system. This is a customer's system, and I cannot modify it to my hearts content.
Now, we've gotten that out of the way...
I have installed Spreadsheet::Read, Spreadsheet::ParseExcel, and Spreadsheet::XLSX on this system. This installed a little Perl script called xlscat. We've done this before on a development box and the UAT box. Now this is the production box.
I am getting the following error:
Parser for XLSX is not installed at /usr/bin/xlscat line 185
I've traced this to Spreadsheet::Read. The relevant code is:
my #parsers = (
[ csv => "Text::CSV_XS" ],
[ csv => "Text::CSV_PP" ], # Version 1.05 and up
[ csv => "Text::CSV" ], # Version 1.00 and up
[ ods => "Spreadsheet::ReadSXC" ],
[ sxc => "Spreadsheet::ReadSXC" ],
[ xls => "Spreadsheet::ParseExcel" ],
[ xlsx => "Spreadsheet::XLSX" ],
[ prl => "Spreadsheet::Perl" ],
# Helper modules
[ ios => "IO::Scalar" ],
);
my %can = map { $_->[0] => 0 } #parsers;
for (#parsers) {
my ($flag, $mod) = #$_;
print STDERR qq(DEBUG: Flag = "$flag" Mod = "$mod"\n);
$can{$flag} and next;
eval "require $mod; \$can{\$flag} = '$mod'";
}
print STDERR Dumper(\%can); #DEBUG:
The lines that start contain the string DEBUG: are mine.
A dump of #parsers shows that everything is loaded correctly. The first debug prints out the value of $flag and $mod correctly.
The problem seems to come from the eval statement. From what I can see, it runs require against a module, and then sets the $can{$flag} variable to $mod if the require succeeds. Apparently, require Spreadsheet::XLSX fails. Here's the relevant output from my debug statements:
DEBUG: Flag = "csv" Mod = "Text::CSV_XS"
DEBUG: Flag = "csv" Mod = "Text::CSV_PP"
DEBUG: Flag = "csv" Mod = "Text::CSV"
DEBUG: Flag = "ods" Mod = "Spreadsheet::ReadSXC"
DEBUG: Flag = "sxc" Mod = "Spreadsheet::ReadSXC"
DEBUG: Flag = "xls" Mod = "Spreadsheet::ParseExcel"
DEBUG: Flag = "xlsx" Mod = "Spreadsheet::XLSX"
DEBUG: Flag = "prl" Mod = "Spreadsheet::Perl"
DEBUG: Flag = "ios" Mod = "IO::Scalar"
$VAR1 = {
'csv' => 'Text::CSV_XS',
'sxc' => 0,
'xlsx' => 0,
'xls' => 'Spreadsheet::ParseExcel',
'ios' => 'IO::Scalar',
'prl' => 0,
'ods' => 0
};
Hmmm... Maybe the module isn't installed?
$ perldoc -l Spreadsheet::XLSX
/usr/lib/perl5/site_perl/5.8/Spreadsheet/XLSX.pm
It shows up in perldoc. Let's write a quick test program:
#! /usr/bin/env perl
use Spreadsheet::Read;
use Spreadsheet::XLSX;
print "It works\n";
And...
$ ./test.pl
DEBUG: Flag = "csv" Mod = "Text::CSV_XS"
DEBUG: Flag = "csv" Mod = "Text::CSV_PP"
DEBUG: Flag = "csv" Mod = "Text::CSV"
DEBUG: Flag = "ods" Mod = "Spreadsheet::ReadSXC"
DEBUG: Flag = "sxc" Mod = "Spreadsheet::ReadSXC"
DEBUG: Flag = "xls" Mod = "Spreadsheet::ParseExcel"
DEBUG: Flag = "xlsx" Mod = "Spreadsheet::XLSX"
DEBUG: Flag = "prl" Mod = "Spreadsheet::Perl"
DEBUG: Flag = "ios" Mod = "IO::Scalar"
$VAR1 = {
'csv' => 'Text::CSV_XS',
'sxc' => 0,
'xlsx' => 0,
'xls' => 'Spreadsheet::ParseExcel',
'ios' => 'IO::Scalar',
'prl' => 0,
'ods' => 0
};
It works
I can pick up Spreadsheet::XLSX via the use Spreadsheet::XLSX in my test program, yet the require in Spreadsheet::Read doesn't seem to see it.
Why?
Addendum
What do you get if you print Dumper( \%INC ) ? – friedo 2 mins ago
I actually did one better. I added the following line in the loop:
require $mod if ($mod eq "Spreadsheet::XLSX"); #DEBUG
And that produced the error message:
Can't locate Spreadsheet::XLSX in #INC (#INC contains:
/usr/lib/perl5/5.8/cygwin /usr/lib/perl5/5.8
/usr/lib/perl5/site_perl/5.8/cygwin
/usr/lib/perl5/site_perl/5.8
/usr/lib/perl5/site_perl/5.8/cygwin
/usr/lib/perl5/site_perl/5.8
/usr/lib/perl5/vendor_perl/5.8/cygwin
/usr/lib/perl5/vendor_perl/5.8
/usr/lib/perl5/vendor_perl/5.8/cygwin
/usr/lib/perl5/vendor_perl/5.8 .) at
/usr/lib/perl5/site_perl/5.8/Spreadsheet/Read.pm line 57.
Compilation failed in require at ./test.pl line 3.
BEGIN failed--compilation aborted at ./test.pl line 3.
(NOTE: I reformatted the output, so it wouldn't be 1000+ characters long, and it's easier to see the #INC path).
The module is in /usr/lib/perl5/site_perl/5.8/Spreadsheet/XLSX.pm.
Oh, take a look at this too:
$ pwd
/usr/lib/perl5/site_perl/5.8/Spreadsheet
$ ls -la
total 152
drwxr-xr-x+ 4 phalder Domain Users 0 Nov 1 21:51 .
drwxrwxrw-+ 11 twinborne Users 0 Nov 1 22:28 ..
drwxr-xr-x+ 3 phalder Domain Users 0 Nov 1 20:48 ParseExcel
-rwxr-xr-x 1 phalder Domain Users 107773 Apr 6 2011 ParseExcel.pm
-rwxrwxrwx 1 phalder Domain Users 29142 Nov 2 12:53 Read.pm
drwxr-xr-x+ 2 phalder Domain Users 0 Nov 1 21:51 XLSX
-rwxr-xr-x 1 phalder Domain Users 8411 May 16 2010 XLSX.pm
$ ls -la XLSX
total 48
drwxr-xr-x+ 2 phalder Domain Users 0 Nov 1 21:51 .
drwxr-xr-x+ 4 phalder Domain Users 0 Nov 1 21:51 ..
-rwxr-xr-x 1 phalder Domain Users 5487 May 16 2010 Fmt2007.pm
-rwxr-xr-x 1 phalder Domain Users 37046 May 16 2010 Utility2007.pm
The permissions seem okay.
Another Addendum:
When I did a CPAN reinstall, I got this:
Result: PASS
/usr/bin/make test -- OK
Running make install
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
ERROR: Can't create '/usr/lib/perl5/site_perl/5.8/cygwin/auto/Spreadsheet/Read'
Do not have write permissions on
'/usr/lib/perl5/site_perl/5.8/cygwin/auto/Spreadsheet/Read'
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
at -e line 1
Installing /usr/lib/perl5/site_perl/5.8/Spreadsheet/Read.pm
Installing /usr/share/man/man3/Spreadsheet.Read.3pm
make: *** [pure_site_install] Error 255
/usr/bin/make install -- NOT OK
Oops! I didn't check the permission of the /usr/lib/perl5/site_perl/5.8/cygwin directory tree.
Did a chmod -R a+rx * on the whole /usr/lib/perl5 directory. We'll see if it works again.
Found the Problem
I took a slightly different tact. I modified Spreadsheet::Read to print out $# after the eval. That way, I could see what error it was getting. Here's the results:
$ ./test.pl
DEBUG: ""DEBUG: "Can't locate Spreadsheet/ReadSXC.pm in #INC
(#INC contains:
/usr/lib/perl5/5.8/cygwin
/usr/lib/perl5/5.8
/usr/lib/perl5/site_perl/5.8/cygwin
/usr/lib/perl5/site_perl/5.8
/usr/lib/perl5/site_perl/5.8/cygwin
/usr/lib/perl5/site_perl/5.8
/usr/lib/perl5/vendor_perl/5.8/cygwin
/usr/lib/perl5/vendor_perl/5.8
/usr/lib/perl5/vendor_perl/5.8/cygwin
/usr/lib/perl5/vendor_perl/5.8 .) at (eval 8) line 1.
"DEBUG: "Can't locate Spreadsheet/ReadSXC.pm in #INC
(#INC contains: /usr/lib/perl5/5.8/cygwin [...]) at (eval 9) line 1.
"DEBUG: ""DEBUG: "Can't locate Compress/Raw/Zlib.pm in #INC
(#INC contains: /usr/lib/perl5/5.8/cygwin [...]) at (eval 15) line 1.
"DEBUG: "Can't locate Spreadsheet/Perl.pm in #INC
(#INC contains: /usr/lib/perl5/5.8/cygwin [...]) at (eval 18) line 1.
Did you see that? The problem isn't Spreadsheet::XLSX, but Compress::Raw::Zlib. I set the entire permissions on /usr/lib/perl to 777, and then installed Compress::Raw::Zlib and Spreadsheet::ReadSXC.
This must have been a problem when these modules were initially installed. I wasn't the one doing the cpan install, but helping the person over the phone, so I didn't get a chance to see these errors if they popped up. CPAN tends to be really, really noisy, and I've learned to catch the random error message as CPAN runs by.
The problem may have been /usr/lib/perl5/site_perl/5.8/cygwin not having the correct permissions all along.
The program now works.
Thanks for all of your help. Somehow, it lead me down the right trail.

Why is this line of Perl code throwing a numeric gt warning?

I have the following conditional:
if ($self->path ne 'contact_us' && !grep { $status == $_ } 2, 3, 8) {
And it is throwing this warning:
Use of uninitialized value in numeric gt (>)
Of course, there's no numeric gt at all on the surface. $self->path is a Moose attribute accessor, so the only under-the-hood magic would be coming from that. But I can't see how that would be making a numeric gt comparison, especially since path is defined as follows:
has 'path' => (is => 'rw', isa => 'Str');
Any ideas on how this warning is getting thrown? I'm using Perl v5.8.8 built for i386-linux-thread-multi, if it matters in this case.
Update: Even more mysteriously, I've rewritten the conditional as follows:
my $cond1 = $self->path ne 'contact_us';
my $cond2 = !grep { $status == $_ } 2, 3, 8;
if ($cond1 && $cond2) {
And it's the third line that throws the warning. Carp::Always's stack trace isn't sufficiently informative. Some further disclosure, as I'm feeling utterly clueless now: The base file is a FastCGI script being called up by Apache's mod_fcgi.
Last update:
$status was getting set by a call to a method found in another module (My::Session). Here was line generating the warning in that module's method (note the errant >):
my $disputes => dbh('b')->selectrow_hashref($query);
What's confusing to me is why the warning didn't reference the module containing the offending line (it referenced the module making the method call, My::Page). Here's the full output from Carp::Always; there is an utter lack of mention of My::Session:
[Wed Feb 23 17:44:29 2011] [warn]
[client ---.---.94.159] mod_fcgid:
stderr: Use of uninitialized value in
numeric gt (>) at /path/to/My/Page.pm
line 65, referer:
https://testserver.domain.tld/help
[Wed Feb 23 17:44:29 2011] [warn]
[client ---.---.94.159] mod_fcgid:
stderr:
\tPage::BUILD('My::Page::Help=HASH(0xa7ce788)',
'HASH(0xa327904)') called at
/usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/Class/MOP/Method.pm
line 123, referer:
https://testserver.domain.tld/help
[Wed Feb 23 17:44:29 2011] [warn]
[client ---.---.94.159] mod_fcgid:
stderr:
\tClass::MOP::Method::execute('Moose::Meta::Method=HASH(0x9fa357c)',
'My::Page::Help=HASH(0xa7ce788)',
'HASH(0xa327904)') called at
/usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/Moose/Object.pm
line 57, referer:
https://testserver.domain.tld/help
[Wed Feb 23 17:44:29 2011] [warn]
[client ---.---.94.159] mod_fcgid:
stderr: \tMoose::Object::BUI, referer:
https://testserver.domain.tld/help
[Wed Feb 23 17:44:29 2011] [warn]
[client ---.---.94.159] mod_fcgid:
stderr:
LDALL('My::Page::Help=HASH(0xa7ce788)',
'HASH(0xa327904)') called at
/usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/Moose/Meta/Class.pm
line 278, referer:
https://testserver.domain.tld/help
[Wed Feb 23 17:44:29 2011] [warn]
[client ---.---.94.159] mod_fcgid:
stderr:
\tMoose::Meta::Class::new_object('Class::MOP::Class::ANON::SERIAL::1=HASH(0xa3397c8)',
'HASH(0xa327904)') called at
/usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/Moose/Object.pm
line 26, referer:
https://testserver.domain.tld/help
[Wed Feb 23 17:44:29 2011] [warn]
[client ---.---.94.159] mod_fcgid:
stderr:
\tMoose::Object::new('My::Page::Help',
'HASH(0xa339d38)') called at generated
method (unknown origin) line 3,
referer:
https://testserver.domain.tld/help
[Wed Feb 23 17:44:29 2011] [warn]
[client ---.---.94.159] mod_fcgid:
stderr:
\tMy::Page::new('My::Page::Suppo,
referer:
https://testserver.domain.tld/help
[Wed Feb 23 17:44:29 2011] [warn]
[client ---.---.94.159] mod_fcgid:
stderr: rt', 'HASH(0xa339d38)') called
at /path/to/My.pm line 44, referer:
https://testserver.domain.tld/help
[Wed Feb 23 17:44:29 2011] [warn]
[client ---.---.94.159] mod_fcgid:
stderr: \tMy::start() called at
index.fcgi line 9, referer:
https://testserver.domain.tld/help
My guess is that one of your arguments is an overloaded object, and that overloading is throwing the error. Check to see exactly what your arguments are:
print "$_: ", ref, $/ for $self, $self->path, $status;
Which should print something like:
HASH(0x12341234)=Self::Object: Self::Object
some/path:
4:
If instead you are getting:
HASH(0x12341234)=Self::Object: Self::Object
some/path: Some::Object
4: Some::Other::Object
Then you should look at each of those packages to see if there is overloading present.
You can also write a bool function which will force a value into a non-overloaded bool:
sub bool {$_[0] ? 1 : 0}
And then:
my $cond1 = bool $self->path ne 'contact_us';
my $cond2 = bool !grep { $status == $_ } 2, 3, 8;
if ($cond1 && $cond2) {
If that fixes the problem, chances are at least one of your arguments is an overloaded object that is misbehaving.
This also could possibly be caused by one of the autoboxing pragmas like use bigint; or use bignum; which convert literal numbers like 2, 3, 8 into overloaded objects. Are any pragmas like this in effect?
I'm pretty sure that you're not getting $status set properly somewhere above the code that you've pasted. You're probably also on an older version of Perl, since in ActiveState 5.12 on my MBP, it will print out the variable name which has failed, as it does in 5.10 under FreeBSD. Under 5.8.8 on my Linux-based VPS, the variable name isn't part of the fail message.
It would be easier to help with more than just a couple of lines of code, since usually the root cause of this sort of error isn't going to be found on the line where the program is dying, but due to a variable not really holding what you think it holds.