X
xhoster
Taint seems to nearly double the amount of memory my program takes. I
haven't see this side effect discussed in perldoc perlsec. This is
inconvenient, as sometimes I just don't have that much memory to spare.
Does anyone know of a work around for this (or of some more detailed
discussion about why it occurs).
This is under various subversions of 5.8, both 32 and 64 bit, for Linux.
$ perl taint_mem.pl
6768
$ perl -T taint_mem.pl
11884
$ cat taint_mem.pl
use strict;
use warnings;
{
## This step is not needed to show effect. if foo already
## exists you can skip it.
open my $fh, ">foo" or die $!;
foreach (1..10000) { print $fh join (",", ("asdadssdf")x10), "\n"};
close $fh;
}
my @x;
open my $fh, "<foo" or die $!;
while (<$fh>) {
push @x, [split /,/];
};
$ENV{PATH}="/bin";
warn +(`ps -p $$ -o rss `)[1];
Thanks,
Xho
haven't see this side effect discussed in perldoc perlsec. This is
inconvenient, as sometimes I just don't have that much memory to spare.
Does anyone know of a work around for this (or of some more detailed
discussion about why it occurs).
This is under various subversions of 5.8, both 32 and 64 bit, for Linux.
$ perl taint_mem.pl
6768
$ perl -T taint_mem.pl
11884
$ cat taint_mem.pl
use strict;
use warnings;
{
## This step is not needed to show effect. if foo already
## exists you can skip it.
open my $fh, ">foo" or die $!;
foreach (1..10000) { print $fh join (",", ("asdadssdf")x10), "\n"};
close $fh;
}
my @x;
open my $fh, "<foo" or die $!;
while (<$fh>) {
push @x, [split /,/];
};
$ENV{PATH}="/bin";
warn +(`ps -p $$ -o rss `)[1];
Thanks,
Xho