Async Aborts and P6SGI

So, it's been a couple months or so since I last posted about this. Since then, I gave a talk about it at the Pittsburgh Perl Workshop. After that, I took a Perl 6 hiatus because life got busy and I was a little burned up. In the past few weeks, I've done a little bit of work: cleaning up somethings, making changes that'd been slow cooking in my brain during hiatus, etc. However, I'm putting P6SGI on another hiatus, but this time it has nothing to do with me and everything to do with the state of Perl 6.

Why? In order to make any further progress on P6SGI, I really need an implementation to prove that what I'm proposing can actually be done the way I'm proposing it. I'm pretty sure it can, but it surely needs a few tweaks that will only be found with an implementation. There are also some blue sky ideas I want to play with to see if they're feasible, but can't without an implementation because they are so far out in space.

To that end I have built a small library that will be named HTTP::Supply (though was provisionally named HTTP1::StreamParser until I could come up with something better). This HTTP parser is the core of what must happen to make an implementation of P6SGI: a library that takes bytes from a socket connection and turns it into an asynchronous Supply of HTTP requests.

This new hiatus basically comes down to this output I get when testing the library:

% perl6 -Ilib t/http-1.0.t
1..40
ok 1 - environment looks good
ok 2 - input found in environment
ok 3 - message body looks good
ok 4 - no more requests expected
ok 5 - environment looks good
ok 6 - input found in environment
ok 7 - message body looks good
ok 8 - no more requests expected
ok 9 - environment looks good
ok 10 - input found in environment
ok 11 - message body looks good
ok 12 - no more requests expected
ok 13 - environment looks good
ok 14 - input found in environment
ok 15 - message body looks good
ok 16 - no more requests expected
ok 17 - environment looks good
ok 18 - input found in environment
ok 19 - message body looks good
ok 20 - no more requests expected
ok 21 - environment looks good
ok 22 - input found in environment
ok 23 - message body looks good
ok 24 - no more requests expected
ok 25 - environment looks good
ok 26 - input found in environment
ok 27 - message body looks good
ok 28 - no more requests expected
ok 29 - environment looks good
ok 30 - input found in environment
ok 31 - message body looks good
ok 32 - no more requests expected
ok 33 - environment looks good
ok 34 - input found in environment
zsh: abort      perl6 -Ilib t/http-1.0.t

That abort there is the issue. My code could most definitely be at fault, but I am of the opinion that it should not be an abort message, but a Perl 6 failure. This is Perl, not C. I'm not really an expert in tracking down my errors when the VM is aborting without giving me any clues at all.

I have been able to track down where this is happening inside of MoarVM and libuv. My C fu is that good, but my libuv fu and pthreads fu is pretty weak. All I know is that it appears to be some sort of action-at-a-distance issue occurring during thread cleanup within MoarVM. At least that's what it looks like to me. I'm a module guy, though, not a VM hacker. I need help on this one.

If you're interested and have the skills required or willing to acquire them to help me past this hiatus, I'll happily buy you coffee or a beer. Help me and then tell me where to send the gift card. In the meantime, I'm moving on to other Perl 6 problems I've been thinking of tackling.

Cheers.

2 Comments

Thank you for this bug report. Not being a MoarVM / libuv person much myself, I won't act on it in the near future. But I'm pretty sure some other people will soon!

Sterling, if you'd like some help, feel free to drop by #moarvm! We are all too familiar with aborts from libuv. =)

Leave a comment

About Sterling Hanenkamp

user-pic Perl hacker by day, Perl 6 module contributor by night.