fork and taint

A

Asterbing

Hello. This script below crashes perl.exe when in taint mode. I've not
any message in error log.

#!/usr/bin/perl -T
print "Content-type: text/html\n\n";
my $pid = fork();
die "fork: $!\n" unless defined $pid;
if (!$pid){
print "son ok<br>";
exit 0;}
print "daddy ok<br>";
exit 0;

It seems like the problem happen on line "my $pid = fork();" because if
I stop the script just below using an "exit 0;", it crashes the same
way.
 
G

Gunnar Hjalmarsson

Asterbing said:
Hello. This script below crashes perl.exe when in taint mode. I've not
any message in error log.

#!/usr/bin/perl -T
print "Content-type: text/html\n\n";
my $pid = fork();
die "fork: $!\n" unless defined $pid;
if (!$pid){
print "son ok<br>";
exit 0;}
print "daddy ok<br>";
exit 0;

It seems like the problem happen on line "my $pid = fork();" because if
I stop the script just below using an "exit 0;", it crashes the same
way.

Have you considered to ask Perl for help?

use strict;
use warnings;
use CGI::Carp 'fatalsToBrowser';
 
A

Asterbing

Have you considered to ask Perl for help?

use strict;
use warnings;
use CGI::Carp 'fatalsToBrowser';

Yes, I've done it and not any explicit error message is shown. Here is
the last script test I've used and it crashes the same way.

I only get the "before fork ok" in browser and perl.exe crashes, nothing
more. The only more thing I know, debugging the crash using Visual
Studio is that the exception occurs in PERL58.DLL.

#!/usr/bin/perl -T
use strict;
use warnings;
use CGI::Carp qw/fatalsToBrowser/;
print "Content-type: text/html\n\n";
print "before fork ok<br>";
my $pid = fork();
die "fork: $!\n" unless defined $pid;
if (!$pid){
print "son ok<br>";
exit 0;}
print "daddy ok<br>";
exit 0;
 
G

Gunnar Hjalmarsson

Asterbing said:
Yes, I've done it and not any explicit error message is shown. Here is
the last script test I've used and it crashes the same way.

I only get the "before fork ok" in browser and perl.exe crashes, nothing
more. The only more thing I know, debugging the crash using Visual
Studio is that the exception occurs in PERL58.DLL.

#!/usr/bin/perl -T
use strict;
use warnings;
use CGI::Carp qw/fatalsToBrowser/;
print "Content-type: text/html\n\n";
print "before fork ok<br>";
my $pid = fork();
die "fork: $!\n" unless defined $pid;
if (!$pid){
print "son ok<br>";
exit 0;}
print "daddy ok<br>";
exit 0;

That script runs fine with my IndigoPerl build of Perl (5.8.6).
 
A

Asterbing

That script runs fine with my IndigoPerl build of Perl (5.8.6).

Well, on my side, I'm using ActivePerl 5.8.7 build 815 and this script
works fine if not in taint mode only :-(
 
A

Asterbing

Well, on my side, I'm using ActivePerl 5.8.7 build 815 and this script
works fine if not in taint mode only :-(

Goog news : just updated to ActiveState ActivePerl 5.8.7.817 for Win32
and the problem is gone using the test script (not tested alsewhere at
this time). So, maybe a build 815's bug.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

crash on fork in taint mode 5
fork/exec question 6
fork it 11
fork and hanging 1
crash on async in taint mode 4
Fork (and exec) in a threaded script. 4
problem with fork 8
How to taint a variable (for testing) 3

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top