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


If I have a control exception within a Lock.protect, the lock in question is 
still in a locked state after the call to protect returns.  On MoarVM, this has 
the side effect when a ReentrantMutex object gets collected, the underlying 
pthread_mutex is still locked.  pthread_mutex_destroy thus fails, and libuv 
calls abort().  To reproduce this, run the attached script, or follow these 
instructions:

    $ git clone https://github.com/zostay/HTTP-Supply
    $ git checkout ad7da71
    $ perl6 -Ilib t/http-1.0.t
use v6;

for ^1_000_000 {
    .say if $_ %% 1_000;

    my $lock = Lock.new;

    $lock.protect({
        next;
    });
}

say 'end';

Reply via email to