Closed p5pRT closed 22 years ago
The following script reaches the 'ERROR' part on a multi-processor box. It doesn't fail on a uni-proc box.
#!/opt/perl5.005_57/bin/perl
use Thread;
my $msg = 'aaa'; my @thrds; my $cnt=100; foreach my $n ( 0..$cnt ) { $thrds[$n] = new Thread \&loop\, $msg; } foreach $thrd ( @thrds ) { $thrd->join; }
sub loop { my $string = shift; while ( 1 ) { my ( $i ) = ( $string =~ /^.(.).$/ ); unless ( $i ) { print "ERROR: string: '$string'\t\ti: '$i'.\n"; kill 9 => $$; } } }
It usually takes less than a second to die. Looks like $1..$9 aren't sufficiently protected between threads.
Tested under IRIX and Solaris.
bl
Hi\,
in my search for 'the bug' in our code\, I stumbled upon the "real" problem ... which was identified as bug 19990707.008. as far as I can see this problem doesn't seem to be fixed. can anyone tell me wrong ? or what's the status on this one ?
the original msg : http://bugs.perl.org/perlbug.cgi?req=tidmids&tidmids=19990707.008&range=32405&format=h
a proposed solution : http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/1999-11/msg00809.html
Christophe VG
On Mon\, 03 Jul 2000 18:08:48 +0200\, Christophe VG wrote: [about the match-variables-aren't-thread-safe issue]
in my search for 'the bug' in our code\, I stumbled upon the "real" problem ... which was identified as bug 19990707.008. as far as I can see this problem doesn't seem to be fixed. can anyone tell me wrong ? or what's the status on this one ?
Harry Wolfson \HarryWolfson@​ll\.mit\.edu worked on an implementation\, but had to give up on it for lack of time. IIRC\, his partial implementation still had problems with the rather seriously broken implementation of (?{}) and (??{}) (which uses a fake PL_curpad without ensuring that it is a proper clone of the real pad).
Please talk to Harry to find out more if you're interested in working on this.
Sarathy gsar@ActiveState.com
@gbarr - Status changed from 'open' to 'resolved'
Bug was with 5.005 threads which are no longer supported
Migrated from rt.perl.org#974 (status was 'resolved')
Searchable as RT974$