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
Using foreach on threads::shared array crashes perl #7544
Comments
From sroy@search-box.comThis is a bug report for perl from sroy@searchbox.parc.xerox.com, The folllowing test program crashes perl: use threads; package A; Additional observations: 1) Replacing the foreach loop with a for loop seems to work for ($i = 0; $i < @list; $i++) { 2) Removing the bless eliminates the crash but generates some Scott Flags: Site configuration information for perl v5.8.5: Configured by sroy at Mon Oct 18 11:06:57 PDT 2004. Summary of my perl5 (revision 5 version 8 subversion 5) configuration: Locally applied patches: @INC for perl v5.8.5: Environment for perl v5.8.5: |
From @rgssroy@search-box.com (via RT) wrote:
$a is aliased to the element of @list; @list being shared, its
With a debugging threaded bleadperl, your program gives this output : __ANON__=HASH(0x8246e44) showing where the crash occurs (with non-debugging perls). But using &share to bypass prototype checking is evil, as share is
Because aliasing is no longer involved.
|
The RT System itself - Status changed from 'new' to 'open' |
From hsr@cs.stanford.edu| It still crashes even when I get rid of share() and try to declare everything in the variable declarations. For example, the following still crashes: #!/usr/bin/perl use threads; my @list : shared; Is there no way, then, to have a shared list of references? Am I simply missing something in my syntax? Scott |
From @schwernOn Mon, Oct 18, 2004 at 09:10:06PM -0000, sroy @ search-box. com wrote:
Additional, additional observations. 5.8.1RC3 (that which ships with OS X) does not crash. Changing $a to $c still crashes (thinking maybe it had to do with the Making $a lexical still crashes. Copying $a to $d and then using $d does not crash. foreach $a (@list) { Conclusion: Its got something to do with the aliasing nature of foreach. -- |
From @iabynOn Thu, Oct 21, 2004 at 10:22:48AM -0700, Scott Roy wrote:
Fixed in bleedperl by the change below. -- Change 23438 by davem@davem-splatty on 2004/10/30 23:25:37 [perl #32033] Using foreach on threads::shared array crashes perl Affected files ... ... //depot/perl/ext/threads/shared/shared.xs#47 edit Differences ... ==== //depot/perl/ext/threads/shared/shared.xs#47 (text) ==== @@ -639,8 +639,18 @@ |
@iabyn - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#32033 (status was 'resolved')
Searchable as RT32033$
The text was updated successfully, but these errors were encountered: