develooper Front page | perl.perl5.porters | Postings from November 2008

[perl #31838] utf8 threading crash

Thread Previous
From:
Steve Peters via RT
Date:
November 25, 2008 05:06
Subject:
[perl #31838] utf8 threading crash
Message ID:
rt-3.6.HEAD-19229-1227588478-924.31838-15-0@perl.org
On Mon Oct 04 17:42:10 2004, jgmyers@proofpoint.com wrote:
> This is a bug report for perl from jgmyers@proofpoint.com,
> generated with the help of perlbug 1.35 running under perl v5.8.5.
> 
> 
> -----------------------------------------------------------------
> [Please enter your report here]
> 
> The following test program crashes on a multiprocessor box.
> 
> Removing either the line that sets $g_bar or the call to
> utf8:upgrade() makes the crash go away.
> 
> use threads;
> 
> my $g_foo = "abcd\n";
> 
> my $g_bar;
> ($g_bar) = $g_foo =~ /(.*)/;
> 
> sub init {
>     my $thr;
> 
>     for (my $i = 0; $i < 8; $i++) {
>         $thr = threads->new(\&task);
>     }
> 
>     foreach $thr (threads->list) {
>         if ($thr->tid && !threads::equal($thr, threads->self)) {
>             $thr->join;
>         }
>     }
> }
> 
> sub task {
>     print "task starting\n";
>     for (my $i = 1; $i < 10000; $i++) {
>         my $str = "foo=bar baz\n";
>         utf8::upgrade($str);
>         if ($str =~ /^([^=]+)=(.*)$/) {
>             my $a = $1;
>         }
>         if ($str =~ /^(foo)(\w*)/) {
>             my $a = $1;
>         }
>     }
> }
> 
> init();
> 
> 
I'm no longer seeing this failure with threaded 5.8.8 or bleadperl.  Can anyone else see this 
problem anymore?

Steve Peters

Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About