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

segfault possibly async related #4434

Closed
p6rt opened this issue Jul 28, 2015 · 5 comments
Closed

segfault possibly async related #4434

p6rt opened this issue Jul 28, 2015 · 5 comments
Labels

Comments

@p6rt
Copy link

p6rt commented Jul 28, 2015

Migrated from rt.perl.org#125705 (status was 'resolved')

Searchable as RT125705$

@p6rt
Copy link
Author

p6rt commented Jul 28, 2015

From @jdv

Hello,

The code below, when it decides to manifest (~ 1 in 10 for me at the
moment),
produces something like​:

*** Error in `/home/jdv/rakudo/install/bin/moar'​: double free or
corruption (!prev)​: 0x00007ff7f4009c30 ***
*** Error in `/home/jdv/rakudo/install/bin/moar'​: double free or
corruption (!prev)​: 0x00007ff7f4009c30 ***
*** Error in `/home/jdv/rakudo/install/bin/moar'​: double free or
corruption (!prev)​: 0x00007ff7f4009c30 ***
...
Aborted (core dumped)

or

Segmentation fault (core dumped)

or other similar looking outputs.

And here's the code​:

use v6;

for 1..15 {

  my $lock = Lock.new;
  my $cond = $lock.condition;
  my $todo = 0;
  my $done = 0;
  my @​in = 1..100;
  my @​out;

  loop ( my $i = 0; $i < @​in; $i++ ) {
  my $in := @​in[$i];
  my $out := @​out[$i];
  $lock.protect( {
  $*SCHEDULER.cue( {
  $out = $in * 10;
  $lock.protect( {
  $done++;
  $cond.signal if $done == $todo;
  } );
  } );
  $todo++;
  } );
  }

  $lock.protect( { $cond.wait unless $done == $todo; } );

  say @​out;

}

And here's what I'm running​:

[jdv@​wieldy ~]$ perl6 -v
This is perl6 version 2015.07.1-3-g6bbb56f built on MoarVM version
2015.07
[jdv@​wieldy ~]$

-jdv

@p6rt
Copy link
Author

p6rt commented Jul 28, 2015

From @lizmat

On 28 Jul 2015, at 13​:48, Justin DeVuyst (via RT) <perl6-bugs-followup@​perl.org> wrote​:

# New Ticket Created by Justin DeVuyst
# Please include the string​: [perl #​125705]
# in the subject line of all future correspondence about this issue.
# <URL​: https://rt-archive.perl.org/perl6/Ticket/Display.html?id=125705 >

Hello,

The code below, when it decides to manifest (~ 1 in 10 for me at the
moment),
produces something like​:

*** Error in `/home/jdv/rakudo/install/bin/moar'​: double free or
corruption (!prev)​: 0x00007ff7f4009c30 ***
*** Error in `/home/jdv/rakudo/install/bin/moar'​: double free or
corruption (!prev)​: 0x00007ff7f4009c30 ***
*** Error in `/home/jdv/rakudo/install/bin/moar'​: double free or
corruption (!prev)​: 0x00007ff7f4009c30 ***
...
Aborted (core dumped)

or

Segmentation fault (core dumped)

or other similar looking outputs.

And here's the code​:

use v6;

for 1..15 {

my $lock = Lock\.new;
my $cond = $lock\.condition;
my $todo = 0;
my $done = 0;
my @&#8203;in = 1\.\.100;
my @&#8203;out;

loop \( my $i = 0; $i \< @&#8203;in; $i\+\+ \) \{
    my $in := @&#8203;in\[$i\];
    my $out := @&#8203;out\[$i\];
    $lock\.protect\( \{
        $\*SCHEDULER\.cue\( \{
            $out = $in \* 10;
            $lock\.protect\( \{
                $done\+\+;
                $cond\.signal if $done == $todo;
            \} \);
        \} \);

Is it wise (or even sane) to use the same lock inside protected code with that lock???

        $todo\+\+;
    \} \);
\}

$lock\.protect\( \{ $cond\.wait unless $done == $todo; \} \);

say @&#8203;out;

}

And here's what I'm running​:

[jdv@​wieldy ~]$ perl6 -v
This is perl6 version 2015.07.1-3-g6bbb56f built on MoarVM version
2015.07
[jdv@​wieldy ~]$

-jdv

@p6rt
Copy link
Author

p6rt commented Jul 28, 2015

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

@p6rt
Copy link
Author

p6rt commented Sep 15, 2015

From @jnthn

On Tue Jul 28 04​:48​:54 2015, jdv79 wrote​:

Hello,

The code below, when it decides to manifest (~ 1 in 10 for me at the
moment),
produces something like​:

*** Error in `/home/jdv/rakudo/install/bin/moar'​: double free or
corruption (!prev)​: 0x00007ff7f4009c30 ***
*** Error in `/home/jdv/rakudo/install/bin/moar'​: double free or
corruption (!prev)​: 0x00007ff7f4009c30 ***
*** Error in `/home/jdv/rakudo/install/bin/moar'​: double free or
corruption (!prev)​: 0x00007ff7f4009c30 ***
...
Aborted (core dumped)

or

Segmentation fault (core dumped)

or other similar looking outputs.

Was most likely due to the recently fixed invocation data race. I can't get it to crash at all now, so added a test to S17-lowlevel/lock.t.

/jnthn

@p6rt
Copy link
Author

p6rt commented Sep 15, 2015

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

@p6rt p6rt closed this as completed Sep 15, 2015
@p6rt p6rt added the Bug label Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant