Skip Menu |

This queue is for tickets about the IO-KQueue CPAN distribution.

Report information
The Basics
Id: 50112
Status: resolved
Priority: 0/
Queue: IO-KQueue

Owner: Nobody in particular
Requestors: GRUBER [...]
Cc: geraud [...] (no email address)

Bug Information
Severity: Normal
Broken in: 0.32
Fixed in: (no value)

CC: geraud [...], kuriyama [...]
Subject: IO::KQueue pushes C NULLs into an AV, which it should not
Download (untitled) / with headers
text/plain 521b
Hi, Geraud CONTINSOUZAS has recently reported assertion failures related to IO::KQueue on FreeBSD with perl 5.10.1 compiled with -DDEBUGGING. The culprit turned out to be C NULLs pushed into Perl AV when udata is not specified. While in previous versions of perl, as well as with perl compiled without debugging (and without extra assertions) it silently worked, it certainly does not look like a good practice. The attached patch fixes the problem. I hope you'll release an updated version soon. Thanks, \Anton.
Subject: kqueue.patch
Download kqueue.patch
text/x-diff 927b
--- KQueue.xs.orig 2009-09-29 10:42:31.000000000 +0200 +++ KQueue.xs 2009-09-29 10:44:43.000000000 +0200 @@ -107,7 +107,8 @@ kevent(kq, timeout=&PL_sv_undef) av_push(array, newSViv(ke[i].flags)); av_push(array, newSViv(ke[i].fflags)); av_push(array, newSViv(ke[i].data)); - av_push(array, SvREFCNT_inc(ke[i].udata)); + if (ke[i].udata) + av_push(array, SvREFCNT_inc(ke[i].udata)); PUSHs(sv_2mortal(newRV_noinc((SV*)array))); } @@ -152,7 +153,10 @@ get_kev(kq, i) sv_setiv(AvARRAY(ke2av)[2], ke2[i-1].flags); sv_setiv(AvARRAY(ke2av)[3], ke2[i-1].fflags); sv_setiv(AvARRAY(ke2av)[4], ke2[i-1].data); - av_store(ke2av, 5, SvREFCNT_inc(ke2[i-1].udata)); + if (ke2[i-1].udata) + av_store(ke2av, 5, SvREFCNT_inc(ke2[i-1].udata)); + else + av_store(ke2av, 5, &PL_sv_undef); RETVAL = newRV_inc((SV*) ke2av);
Resolved in 0.33 now heading to CPAN.

This service is sponsored and maintained by Best Practical Solutions and runs on infrastructure.

Please report any issues with to