AE::Handle::DESTROY w/ encoding.

gleeco gleeco at gmail.com
Sat Dec 22 01:16:01 CET 2012


in AnyEvent::Handle::DESTROY, the $wbuf isn't afforded the same luxuray of
utf8::downgrade() as the other syswrite call found via push_write().  If
you are so unlucky as to have a Wide char inside of wbuf in the DESTROY
linger, CPU will spin and the warnings keep spewing.  In my case, for an
hour.  Lines of interest:

      push @linger, AE::io $fh, 1, sub {
         my $len = syswrite $fh, $wbuf, length $wbuf;


found this is via AE::HTTP requests using POST where the body wasn't turned
in to bytes before getting in to linger.
Obviously my fault;  encoding the data fixes things, but FYI.

here's the gist of testing / reproducing it

  https://gist.github.com/4355681

bug?  caller should be using correct coding, sure; but a surprise awaits if
one gets these conditions to line up.  a similar utf8::downgrade seemed to
fix.

thx,

-gleeco
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.schmorp.de/pipermail/anyevent/attachments/20121221/cd0b0490/attachment.html>


More information about the anyevent mailing list