New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Data::Dumper + threads + recursion = segfault #6782
Comments
From DavidBuckley@bigfoot.comCreated by DavidBuckley@bigfoot.com<Apologies if this is duplicated; the mail daemon on my other machine The following code illustrates the issue nicely: use threads; This produces a short pause, then a segfault. I'm guessing it's due use threads; Gives: ARRAY(0x813bbc4)ARRAY(0x813babc) Which, of course, is going to confuse anything that checks There appears to be no obvious way of checking equivalence of shared Perl Info
|
From perl_dummy@bloodgate.com-----BEGIN PGP SIGNED MESSAGE----- Moin,
Interesting, does it give a different value each time you print it, or does it Best wishes, Tels - -- "Where shall I put you? Under H, like Hot, Sexy Mama?" -----BEGIN PGP SIGNATURE----- iQEVAwUBP2/L3ncLPEOTuEwVAQECkQf+Jsi/3oiKKK4uox1Ckm/PUypxW+UuU6cI |
From DavidBuckley@bigfoot.comOn 23 Sep 2003, Tels wrote:
<snip> It seems to just alternate. Different threads can, however, appear to [11:34:29] bucko(tank) ~$ perl -Mthreads -Mthreads::shared -e 'my $a : shared = &share({}); for(1..2){async{for(1..5) {print threads->tid()."$a\n"}}}sleep 2' (Apologies for messy code) My original code was using 5 processing threads, hence giving a Oddly enough, this kinda crushes my theory on Data::Dumper hitting an Another interesting case: [11:40:10] bucko(tank) ~$ perl -Mthreads -Mthreads::shared -e 'my $a : Creating a third value, and note how they run cyclically still. This Finally, this one appears to have some /immense/ number of possible [11:43:56] bucko(tank) ~$ perl -Mthreads -Mthreads::shared -e 'my $a : shared = &share({}); $a->{a} = $a; $a->{b} = "f"; for(1..5){print "$_ $a $a->{a} $a->{b}\n" for (1..3); $a = $a->{a}}' Note how there however /are/ patterns in the apparent mess. A simple hash based unique value finder tells me there's 12 values here, my %count; (Run through perl -Mthreads -Mthreads::shared) Bizarrely, when I reformatted the code like this: my %count; I got 20000 values. Removing the my qualifier on $temp does nothing $count{ $temp = "$a" }++; Brings me back to 10002, however. Perhaps scarily, the following body gives 20 unique values for the same $count{ $temp = "$a" }++; Even more worrying, the following body gives /11/ unique values: $count{ $temp = "$a" }++; Adding a further deference brings it up to 14. Combining the two lines So, yes, I think I'll leave this up to someone who actually knows what Apologies for the somewhat inconsistent code etc. I was basically just HTH -- |
From perl_dummy@bloodgate.com-----BEGIN PGP SIGNED MESSAGE----- Moin David,
Strange. But an idea particle suddenly hit me while reading this. There _was_ http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2003-09/msg01289.html there or the latest bleadperl. If you could give these a spin and see if the Best wishes, Te"Armchair Debugger Extraordinaire"ls - -- "Naturally the parameter and boundary of their respective position and -----BEGIN PGP SIGNATURE----- iQEVAwUBP3BwgHcLPEOTuEwVAQHD1Af+NoJPeXhQoKXHAdurrCgC2VVocXfnChnF |
From DavidBuckley@bigfoot.comOn 23 Sep 2003, Tels wrote:
Just did so, but the bug remains. I'm attaching configuration info Inspired by your comments on the memory leak, I did some stats. Using Sample low-iteration run: [18:49:29] bucko(tank) ~/perl_5.8.1-RC5/bin$ ./perl -Mthreads -Mthreads::shared Summary of my perl5 (revision 5.0 version 8 subversion 1) configuration: Characteristics of this binary (from libperl): -- |
From @iabynOn Mon, Sep 22, 2003 at 05:01:19PM -0000, David Buckley wrote:
The segfault is due to stack or memory exhaustion caused by infinite In the case of $a = \$a, the real SV is 'correct': it's an RV which points Note that this is a bug in the shared var implementation, not in use threads; my $a : shared; $a = \$a; my $x = $a; outputs: scalar(0x81a3b08) I don't know whether the other parts of the bug report are related. And no, I don't know how to fix it. Dave. -- |
From @schwern
This is still an issue in bleadperl@25129. |
From @iabynOn Thu, Jul 14, 2005 at 01:58:08AM -0700, Michael G Schwern via RT wrote:
Fixed in bleed by change #26695 -- |
@iabyn - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#23965 (status was 'resolved')
Searchable as RT23965$
The text was updated successfully, but these errors were encountered: