Package: perl
Version: 5.8.7-9
Severity: important

Im write small test script to check how many threads can be run.
this script segfault,  i check on sarge i386 and etch and64, in all cases
kernel is 2.6 whith  nptl ( on sarge i386 package libc6-i686 is installed)

before running test, set vm.overcommit_memory=2 and vm.overcommit_ratio=100
otherwise system can be unresponsible due to swapping.

also setting "ulimit -s unlimited" only increase number of threads before
segfault



begin test script
#####################################################################
#!/usr/bin/perl -w

#sysctl -w vm.overcommit_memory=2
#sysctl -w vm.overcommit_ratio=100

use threads;
use threads::shared;
use strict;
use warnings;


my $a : shared;
my $n : shared;

sub incn {
   lock($n);
   $n++;
}

$a = 1;
$n = 0;

sub my_function {
   incn( $n);
   while ($a) {
      my $child_thread = threads->new(\&my_function);
      if($child_thread) {
         $child_thread->detach;
      }
      else {
         $a = 0;
      }
   }
}

#my_function();
my $c = threads->new(\&my_function);
$c->detach;
while( $a ) {
   print "$n\n";
   sleep( 1);
}
print "--$n--\n";
for( my $i=0; $i<10; $i++) {
  sleep(1);
  print "$n\n";
}
#####################################################################
end test script




-- System Information:
Debian Release: testing/unstable
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: amd64 (x86_64)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.12-1-amd64-k8
Locale: LANG=bg_BG.UTF-8, LC_CTYPE=bg_BG.UTF-8 (charmap=UTF-8)

Versions of packages perl depends on:
ii  libc6                         2.3.5-8.1  GNU C Library: Shared libraries an
ii  libdb4.3                      4.3.28-2   Berkeley v4.3 Database Libraries [
ii  libgdbm3                      1.8.3-2    GNU dbm database routines (runtime
ii  perl-base                     5.8.7-9    The Pathologically Eclectic Rubbis
ii  perl-modules                  5.8.7-9    Core Perl modules

Versions of packages perl recommends:
ii  perl-doc                      5.8.7-9    Perl documentation

-- no debconf information


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to