Home > Archive > PERL Beginners > January 2008 > compile perl
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
|
|
| Diego . 2008-01-16, 8:01 am |
| Hi every one!!
First of all i'm new on this list. I'm sorry if this is not the
correct place to ask my questions...
I got a program running with a custom-compiled perl version ( 5.6.2 )
on fedora core 4. The program works correcty with threads, and when i
send a sigterm to the parent thread it kills all child threads. Now
i'm trying to compile perl 5.8.8 ( and i tried also 5.6.2 and 5.10.0 )
on a fedora core 6. All goes fine, but my problem comes when i start
threads with its childs and i could not get this childs threads killed
when the parent thread receives SIGTERM signal. I'm using "-15" as
signal becouse with SIGTERM i get "unrecognized signal name
SIGTERM...." error.
Cheking perl doc, i saw this page: http://perldoc.perl.org/threads.html
I compiled a multithread perl, and "kill -l" shows me SIGTERM as a
recognized name. Still the same error.
That's what i do:
$BIN = $HOME/perl
sh Configure -de -Dlocincpth="$BIN" -Dloclibpth="$BIN"
-Dprefix="$BIN/perl5" -Dusethreads
make
make install
Thanks for all
| |
| Tom Phoenix 2008-01-16, 7:02 pm |
| On Jan 16, 2008 4:47 AM, Diego . <eljedi@gmail.com> wrote:
> i'm trying to compile perl 5.8.8
Does it pass all tests, when you run 'make test'?
Cheers!
--Tom Phoenix
Stonehenge Perl Training
| |
| Diego . 2008-01-16, 7:02 pm |
| yes, make test reports all tests passed when compiling 5.8.8 on both (
fedora 4 and 6 ) but when i compible 5.6.2 on fedora 6 y get some
errors on test but threads works fine even with some tests failed.
On Jan 16, 2008 4:50 PM, Tom Phoenix <tom@stonehenge.com> wrote:
> On Jan 16, 2008 4:47 AM, Diego . <eljedi@gmail.com> wrote:
>
>
> Does it pass all tests, when you run 'make test'?
>
> Cheers!
>
> --Tom Phoenix
> Stonehenge Perl Training
>
| |
| Tom Phoenix 2008-01-16, 7:02 pm |
| On Jan 16, 2008 8:23 AM, Diego . <eljedi@gmail.com> wrote:
> yes, make test reports all tests passed when compiling 5.8.8 on both (
> fedora 4 and 6 ) but when i compible 5.6.2 on fedora 6 y get some
> errors on test but threads works fine even with some tests failed.
Well, "works fine" is good for so long as it lasts. Still, I wonder:
How do you know your Perl programs do what they should, when you know
your perl binary doesn't do what it should? Could the test that failed
have been trying to do the same thing that you're having trouble
doing?
In any case, your original trouble was that SIGTERM wasn't being
recognized as a signal. How were you using it?
If you're still having trouble with SIGTERM, check out the diagnostic
program I've appended to this message. Do your various perl binaries
say anything interesting when you have them run it?
Hope this helps!
--Tom Phoenix
Stonehenge Perl Training
#!/usr/bin/perl
use strict;
use warnings;
use Config;
my @names = qw{
SIGTERM SIGZERO SIGMUNDFREUD SIGWINCH
SIGCHLD SIGCHILD SIGNAGE SIGUSR1 SIGSEGV
SIGSTOP SIG INT HUP ZERO HALT QUIT
sigterm hup 42 7 -9 3.14159 2001 90210
};
my(@good, @bad);
for my $signame (@names) {
if (eval { kill $signame; 1 }) {
push @good, $signame;
} else {
push @bad, $signame;
}
}
print "These seem to be usable signals: @good\n\n";
print "These are bad signals: @bad\n\n";
print "Perl version: $]\n";
print "Config's list of signals: $Config{sig_name}\n\n";
__END__
| |
| Diego . 2008-01-17, 4:01 am |
| Hi Tom.
> Well, "works fine" is good for so long as it lasts. Still, I wonder:
> How do you know your Perl programs do what they should, when you know
> your perl binary doesn't do what it should? Could the test that failed
> have been trying to do the same thing that you're having trouble
> doing?
Well, if i compile on fedora 4 it works.. i mean: parent process when
receive a sigterm kills child processes. On fedora 6 not. Sorry if i
call it wrong
Here i have your tests results:
---- For perl 5.10.0 ----------------------------------
This is the output of test:
These seem to be usable signals: SIGTERM SIGZERO SIGWINCH SIGCHLD
SIGUSR1 SIGSEGV SIGSTOP INT HUP ZERO QUIT 42 7 -9 3.14159 2001 90210
These are bad signals: SIGMUNDFREUD SIGCHILD SIGNAGE SIG HALT sigterm hup
Perl version: 5.010000
Config's list of signals: ZERO HUP INT QUIT ILL TRAP ABRT BUS FPE KILL
USR1 SEGV USR2 PIPE ALRM TERM STKFLT CHLD CONT STOP TSTP TTIN TTOU URG
XCPU XFSZ VTALRM PROF WINCH IO PWR SYS NUM32 NUM33 RTMIN NUM35 NUM36
NUM37 NUM38 NUM39 NUM40 NUM41 NUM42 NUM43 NUM44 NUM45 NUM46 NUM47
NUM48 NUM49 NUM50 NUM51 NUM52 NUM53 NUM54 NUM55 NUM56 NUM57 NUM58
NUM59 NUM60 NUM61 NUM62 NUM63 RTMAX IOT CLD POLL UNUSED
-----------------------------------------
-----------------For perl 5.8.8 --------------------------------------
These seem to be usable signals: SIGTERM SIGZERO SIGWINCH SIGCHLD
SIGUSR1 SIGSEGV SIGSTOP INT HUP ZERO QUIT 42 7 -9 3.14159 2001 90210
These are bad signals: SIGMUNDFREUD SIGCHILD SIGNAGE SIG HALT sigterm hup
Perl version: 5.008008
Config's list of signals: ZERO HUP INT QUIT ILL TRAP ABRT BUS FPE KILL
USR1 SEGV USR2 PIPE ALRM TERM STKFLT CHLD CONT STOP TSTP TTIN TTOU URG
XCPU XFSZ VTALRM PROF WINCH IO PWR SYS NUM32 NUM33 RTMIN NUM35 NUM36
NUM37 NUM38 NUM39 NUM40 NUM41 NUM42 NUM43 NUM44 NUM45 NUM46 NUM47
NUM48 NUM49 NUM50 NUM51 NUM52 NUM53 NUM54 NUM55 NUM56 NUM57 NUM58
NUM59 NUM60 NUM61 NUM62 NUM63 RTMAX IOT CLD POLL UNUSED
--------------------------------------------
That's my code:
$self->{log}->info("Sending SIGTERM a $pid");
kill '-15' => $pid;
$cont = $self->{kill};
do {
sleep 1;
$ret = waitpid( $pid, &POSIX::WNOHANG );
#$self->{log}->verbose("waitpid $cont ret=$ret");
$cont --;
} until ( ($ret == -1) || (! $cont) );
Thanks!!!
On Jan 16, 2008 6:25 PM, Tom Phoenix <tom@stonehenge.com> wrote:
> On Jan 16, 2008 8:23 AM, Diego . <eljedi@gmail.com> wrote:
>
>
> Well, "works fine" is good for so long as it lasts. Still, I wonder:
> How do you know your Perl programs do what they should, when you know
> your perl binary doesn't do what it should? Could the test that failed
> have been trying to do the same thing that you're having trouble
> doing?
>
> In any case, your original trouble was that SIGTERM wasn't being
> recognized as a signal. How were you using it?
>
> If you're still having trouble with SIGTERM, check out the diagnostic
> program I've appended to this message. Do your various perl binaries
> say anything interesting when you have them run it?
>
> Hope this helps!
>
> --Tom Phoenix
> Stonehenge Perl Training
>
> #!/usr/bin/perl
>
> use strict;
> use warnings;
> use Config;
>
> my @names = qw{
> SIGTERM SIGZERO SIGMUNDFREUD SIGWINCH
> SIGCHLD SIGCHILD SIGNAGE SIGUSR1 SIGSEGV
> SIGSTOP SIG INT HUP ZERO HALT QUIT
> sigterm hup 42 7 -9 3.14159 2001 90210
> };
>
> my(@good, @bad);
>
> for my $signame (@names) {
> if (eval { kill $signame; 1 }) {
> push @good, $signame;
> } else {
> push @bad, $signame;
> }
> }
>
> print "These seem to be usable signals: @good\n\n";
>
> print "These are bad signals: @bad\n\n";
>
> print "Perl version: $]\n";
> print "Config's list of signals: $Config{sig_name}\n\n";
>
> __END__
>
| |
|
| On Jan 16, 6:47 am, elj...@gmail.com (Diego .) wrote:
> That's what i do:
> $BIN = $HOME/perl
> sh Configure -de -Dlocincpth="$BIN" -Dloclibpth="$BIN"
> -Dprefix="$BIN/perl5" -Dusethreads
> make
> make install
>
> Thanks for all
Is this exactly what the shell interprets? If so, there is a simple
solution. Setting variables in the shell environment won't work (or
rather it works screwy) if there's a leading dollar sign. Try this:
Replace the first line ("$BIN = $HOME/perl") with this:
BIN=$HOME/perl
Also, if you want some better solidarity with the script, try quoting:
BIN="$HOME/perl"
But the first one should work under 99.9% of circumstances.
| |
| Diego . 2008-01-17, 8:01 am |
| sorry it was a typo!!
I wrote on shell: BIN = $HOME/perl without $
On Jan 17, 2008 4:57 AM, h3xx <amphetamachine@gmail.com> wrote:
> On Jan 16, 6:47 am, elj...@gmail.com (Diego .) wrote:
>
> Is this exactly what the shell interprets? If so, there is a simple
> solution. Setting variables in the shell environment won't work (or
> rather it works screwy) if there's a leading dollar sign. Try this:
>
> Replace the first line ("$BIN = $HOME/perl") with this:
>
> BIN=$HOME/perl
>
> Also, if you want some better solidarity with the script, try quoting:
>
> BIN="$HOME/perl"
>
> But the first one should work under 99.9% of circumstances.
>
>
> --
> To unsubscribe, e-mail: beginners-unsubscribe@perl.org
> For additional commands, e-mail: beginners-help@perl.org
> http://learn.perl.org/
>
>
>
|
|
|
|
|