# New Ticket Created by  Sverre Eldøy 
# Please include the string:  [perl #131364]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org/Ticket/Display.html?id=131364 >


Hi!

I was just playing around with the concurrent quicksort thing that Damien 
made.. It's neat.. But problem is: It crashes in different ways each time... 
Here's a couple of examples:

Run1:
Illegal instruction: 4

Run2:
Use of uninitialized value of type Any in string context
Any of .^name, .perl, .gist, or .say can stringify undefined things, if 
needed.Use of uninitialized value of type Any in string context
Any of .^name, .perl, .gist, or .say can stringify undefined things, if needed. 
 in whatevercode  at ./quicksort_concurrent.p6 line 10
Use of uninitialized value <element> of type Any in string context
Any of .^name, .perl, .gist, or .say can stringify undefined things, if 
needed.Use of uninitialized value <element> of type Any in string context
Any of .^name, .perl, .gist, or .say can stringify undefined things, if needed. 
 in sub quicksort at ./quicksort_concurrent.p6 line 4
  in whatevercode  at ./quicksort_concurrent.p6 line 10
Use of uninitialized value $pivot of type Any in string context
Any of .^name, .perl, .gist, or .say can stringify undefined things, if 
needed.Use of uninitialized value $pivot of type Any in string context
Any of .^name, .perl, .gist, or .say can stringify undefined things, if needed. 
 in sub quicksort at ./quicksort_concurrent.p6 line 4
  in whatevercode  at ./quicksort_concurrent.p6 line 10
Use of uninitialized value $pivot of type Any in string context
Any of .^name, .perl, .gist, or .say can stringify undefined things, if needed. 
 in whatevercode  at ./quicksort_concurrent.p6 line 10
  in sub quicksort at ./quicksort_concurrent.p6 line 4
Use of uninitialized value $pivot of type Any in string context
Any of .^name, .perl, .gist, or .say can stringify undefined things, if 
needed.Use of uninitialized value $pivot of type Any in string context
Any of .^name, .perl, .gist, or .say can stringify undefined things, if needed. 
 in whatevercode  at ./quicksort_concurrent.p6 line 10
  in sub quicksort at ./quicksort_concurrent.p6 line 4
Use of uninitialized value $pivot of type Any in string context
Any of .^name, .perl, .gist, or .say can stringify undefined things, if needed. 
 in sub quicksort at ./quicksort_concurrent.p6 line 4
This type does not support positional operations
  in block <unit> at ./quicksort_concurrent.p6 line 17

Run3:
Segmentation fault: 11

Run4:
This type does not support positional operations
  in block <unit> at ./quicksort_concurrent.p6 line 1


.... The code was just a slightly modified version of the example from Damien.. 
And it runs if I take away some numbers.. So I suspect that there is something 
weird going on.. Try it on your machines...

My environment is Mac os x (sierra) running 
This is Rakudo version 2016.04 built on MoarVM version 2016.04
implementing Perl 6.c.
... as that is what comes with brew these days... Not sure if the same thing 
happens on bleeding edge..

Here's the code:
#! /usr/bin/env perl6
use v6;

multi quicksort(  []  ) { () };

multi quicksort( [$x] ) { $x };

multi quicksort( [$pivot, *@xs] ) {
    flat await
         start { quicksort @xs.grep: *  before $pivot },
         start { $pivot                               },
         start { quicksort @xs.grep: * !before $pivot };
}

say "output = { quicksort 
[3,4,2,4,3,6,34589734,7,5,467,675,456,345,345,234,346,457,45,234,12,3123,3,9,8,7,6,7,8,9,8,7,6,7,8,9,8,7,7,6,5,5,5,4,4,4,444,9860,33,3,1,123,234,6,3,5,7,2,4543,2,342,143,234,234,234,4,36,234,324,5,234,457,678,3,1,4,1,5,9,2,6]
 }";






BR,
Sverre

Reply via email to