Skip to content
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

concurrent quicksort from Damien gives different crashes each time #6269

Open
p6rt opened this issue May 25, 2017 · 10 comments
Open

concurrent quicksort from Damien gives different crashes each time #6269

p6rt opened this issue May 25, 2017 · 10 comments

Comments

@p6rt
Copy link

p6rt commented May 25, 2017

Migrated from rt.perl.org#131364 (status was 'open')

Searchable as RT131364$

@p6rt
Copy link
Author

p6rt commented May 25, 2017

From skeldoy@gmail.com

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

@p6rt
Copy link
Author

p6rt commented May 27, 2017

From @lizmat

FWIW, I can’t get this to break on 2017.05. Please note that a *LOT* of concurrency fixes landed after 2016.04. I suggest you use a more current version, preferably 2017.05. Unless this problem can be confirmed on a more recent Rakudo version, I suggest this ticket can be closed.

On 25 May 2017, at 17​:01, Sverre Eldøy (via RT) <perl6-bugs-followup@​perl.org> wrote​:

# 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-archive.perl.org/perl6/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

@p6rt
Copy link
Author

p6rt commented May 27, 2017

The RT System itself - Status changed from 'new' to 'open'

@p6rt
Copy link
Author

p6rt commented May 29, 2017

From @coke

Closing based on last comment.
--
Will "Coke" Coleda

@p6rt
Copy link
Author

p6rt commented May 29, 2017

@coke - Status changed from 'open' to 'resolved'

@p6rt
Copy link
Author

p6rt commented Jun 1, 2017

From skeldoy@gmail.com

Hi! Sorry for the late reply. I just tried it on 2017.04 ... and the problem is still there.. So please reopen

On 29 May 2017, at 20​:53, Will Coleda via RT <perl6-bugs-followup@​perl.org> wrote​:

According to our records, your request regarding
"concurrent quicksort from Damien gives different crashes each time"
has been resolved.

If you have any further questions or concerns, please respond to this message.

For other topics, please create a new ticket.

<URL​: https://rt-archive.perl.org/perl6/Ticket/Display.html?id=131364 >

@p6rt
Copy link
Author

p6rt commented Jun 1, 2017

@coke - Status changed from 'resolved' to 'open'

@p6rt
Copy link
Author

p6rt commented Jun 1, 2017

From @lizmat

Could you please retry on 2017.05? I cannot reproduce the problem, even after 1000 runs.

On 30 May 2017, at 17​:25, Sverre Eldøy <skeldoy@​gmail.com> wrote​:

Hi! Sorry for the late reply. I just tried it on 2017.04 ... and the problem is still there.. So please reopen

On 29 May 2017, at 20​:53, Will Coleda via RT <perl6-bugs-followup@​perl.org> wrote​:

According to our records, your request regarding
"concurrent quicksort from Damien gives different crashes each time"
has been resolved.

If you have any further questions or concerns, please respond to this message.

For other topics, please create a new ticket.

<URL​: https://rt-archive.perl.org/perl6/Ticket/Display.html?id=131364 >

@p6rt
Copy link
Author

p6rt commented Jun 2, 2017

From skeldoy@gmail.com

And three more tries​:
./quicksort_concurrent.p6 ;./quicksort_concurrent.p6 ;./quicksort_concurrent.p6
input = 3 1 4 1 5 9 2 6
Segmentation fault​: 11
input = 3 1 4 1 5 9 2 6
Tried to get the result of a broken Promise
  in block <unit> at ./quicksort_concurrent.p6 line 17

Original exception​:
  Cannot resolve caller infix​:<before>(Mu, Int); none of these signatures match​:
  ($?)
  (\a, \b)
  in sub quicksort at ./quicksort_concurrent.p6 line 4
  in block at ./quicksort_concurrent.p6 line 12

input = 3 1 4 1 5 9 2 6
moar(25827,0x70000264b000) malloc​: *** error for object 0x7f835a70d870​: pointer being realloc'd was not allocated
*** set a breakpoint in malloc_error_break to debug
Abort trap​: 6

... It's kinda amazing how it can break in different ways each time... three more​:
./quicksort_concurrent.p6 ;./quicksort_concurrent.p6 ;./quicksort_concurrent.p6
input = 3 1 4 1 5 9 2 6
Segmentation fault​: 11
input = 3 1 4 1 5 9 2 6
Illegal instruction​: 4
input = 3 1 4 1 5 9 2 6
Use of uninitialized value of type Any in string context.
Methods .^name, .perl, .gist, or .say can be used to stringify it to something meaningful.
  in whatevercode at ./quicksort_concurrent.p6 line 10
Use of uninitialized value <element> of type Any in string context.
Methods .^name, .perl, .gist, or .say can be used to stringify it to something meaningful.
Use of uninitialized value <element> of type Any in string context.
Methods .^name, .perl, .gist, or .say can be used to stringify it to something meaningful.
  in sub quicksort at ./quicksort_concurrent.p6 line 4
  in sub quicksort at ./quicksort_concurrent.p6 line 4
Use of uninitialized value $pivot of type Any in string context.
Methods .^name, .perl, .gist, or .say can be used to stringify it to something meaningful.Use of uninitialized value $pivot of type Any in string context.
Methods .^name, .perl, .gist, or .say can be used to stringify it to something meaningful.

  in whatevercode at ./quicksort_concurrent.p6 line 10
Use of uninitialized value $pivot of type Any in string context.
Methods .^name, .perl, .gist, or .say can be used to stringify it to something meaningful.
  in sub quicksort at ./quicksort_concurrent.p6 line 4
Use of uninitialized value $pivot of type Any in string context.
Methods .^name, .perl, .gist, or .say can be used to stringify it to something meaningful.
  in whatevercode at ./quicksort_concurrent.p6 line 10
Use of uninitialized value $pivot of type Any in string context.
Methods .^name, .perl, .gist, or .say can be used to stringify it to something meaningful.
  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.
Methods .^name, .perl, .gist, or .say can be used to stringify it to something meaningful.
  in sub quicksort at ./quicksort_concurrent.p6 line 4
Tried to get the result of a broken Promise
  in block <unit> at ./quicksort_concurrent.p6 line 17

Original exception​:
  This type (Mu) does not support elems
  in sub quicksort at ./quicksort_concurrent.p6 line 4
  in block at ./quicksort_concurrent.p6 line 10

On 1 Jun 2017, at 18​:50, Sverre Eldøy <skeldoy@​gmail.com> wrote​:

./quicksort_concurrent.p6 ;./quicksort_concurrent.p6 ;./quicksort_concurrent.p6 ; perl6 -v
input = 3 1 4 1 5 9 2 6
Tried to get the result of a broken Promise
in block <unit> at ./quicksort_concurrent.p6 line 17

Original exception​:
Cannot resolve caller infix​:<before>(Mu, Int); none of these signatures match​:
($?)
(\a, \b)
in sub quicksort at ./quicksort_concurrent.p6 line 4
in block at ./quicksort_concurrent.p6 line 12

input = 3 1 4 1 5 9 2 6
moar(25759,0x70000d20d000) malloc​: *** error for object 0x7fea48663230​: double free
*** set a breakpoint in malloc_error_break to debug
Abort trap​: 6
input = 3 1 4 1 5 9 2 6
output = 1 1 1 2 2 2 2 3 3 3 3 3 3 4 4 4 4 4 4 4 5 5 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 7 7 8 8 8 8 8 9 9 9 9 12 33 36 45 123 143 234 234 234 234 234 234 234 234 324 342 345 345 346 444 456 457 457 467 675 678 3123 4543 9860 34589734
This is Rakudo version 2017.04.3 built on MoarVM version 2017.04-53-g66c6dda
implementing Perl 6.c.

Third times the charm..

On 1 Jun 2017, at 15​:14, Elizabeth Mattijsen via RT <perl6-bugs-followup@​perl.org> wrote​:

Could you please retry on 2017.05? I cannot reproduce the problem, even after 1000 runs.

On 30 May 2017, at 17​:25, Sverre Eldøy <skeldoy@​gmail.com> wrote​:

Hi! Sorry for the late reply. I just tried it on 2017.04 ... and the problem is still there.. So please reopen

On 29 May 2017, at 20​:53, Will Coleda via RT <perl6-bugs-followup@​perl.org> wrote​:

According to our records, your request regarding
"concurrent quicksort from Damien gives different crashes each time"
has been resolved.

If you have any further questions or concerns, please respond to this message.

For other topics, please create a new ticket.

<URL​: https://rt-archive.perl.org/perl6/Ticket/Display.html?id=131364 >

@p6rt
Copy link
Author

p6rt commented Jun 2, 2017

From skeldoy@gmail.com

./quicksort_concurrent.p6 ;./quicksort_concurrent.p6 ;./quicksort_concurrent.p6 ; perl6 -v
input = 3 1 4 1 5 9 2 6
Tried to get the result of a broken Promise
  in block <unit> at ./quicksort_concurrent.p6 line 17

Original exception​:
  Cannot resolve caller infix​:<before>(Mu, Int); none of these signatures match​:
  ($?)
  (\a, \b)
  in sub quicksort at ./quicksort_concurrent.p6 line 4
  in block at ./quicksort_concurrent.p6 line 12

input = 3 1 4 1 5 9 2 6
moar(25759,0x70000d20d000) malloc​: *** error for object 0x7fea48663230​: double free
*** set a breakpoint in malloc_error_break to debug
Abort trap​: 6
input = 3 1 4 1 5 9 2 6
output = 1 1 1 2 2 2 2 3 3 3 3 3 3 4 4 4 4 4 4 4 5 5 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 7 7 8 8 8 8 8 9 9 9 9 12 33 36 45 123 143 234 234 234 234 234 234 234 234 324 342 345 345 346 444 456 457 457 467 675 678 3123 4543 9860 34589734
This is Rakudo version 2017.04.3 built on MoarVM version 2017.04-53-g66c6dda
implementing Perl 6.c.

Third times the charm..

On 1 Jun 2017, at 15​:14, Elizabeth Mattijsen via RT <perl6-bugs-followup@​perl.org> wrote​:

Could you please retry on 2017.05? I cannot reproduce the problem, even after 1000 runs.

On 30 May 2017, at 17​:25, Sverre Eldøy <skeldoy@​gmail.com> wrote​:

Hi! Sorry for the late reply. I just tried it on 2017.04 ... and the problem is still there.. So please reopen

On 29 May 2017, at 20​:53, Will Coleda via RT <perl6-bugs-followup@​perl.org> wrote​:

According to our records, your request regarding
"concurrent quicksort from Damien gives different crashes each time"
has been resolved.

If you have any further questions or concerns, please respond to this message.

For other topics, please create a new ticket.

<URL​: https://rt-archive.perl.org/perl6/Ticket/Display.html?id=131364 >

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant