-
Notifications
You must be signed in to change notification settings - Fork 16
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
"No subtests run" CPAN Testers failure #13
Comments
So far I haven't been able to reproduce this on my FreeBSD boxes. I have one 9.x and one 10.x 64 bit (both installed ZMQ::FFI cleanly) and one 10.x 32 bit (though the 32bit one is in the process of rebuilding so I haven't gotten there yet). The libffi on those machines is more recent that 3.0.13 though, I will try the older version next. I can also try on my netbsd VM if I can remember how to install packages in that environment :) I noticed the kFreeBSD failures were similar to the Linux failures (and should be fixed with the Math::BigInt upgrade), so that points to the userland rather than the kernel. |
@plicease thanks so much for your help, let me know what you find. I've released 1.01 with the newer Math::BigInt requirement. |
Since adding the newer Math::BigInt requirement test failures only appear to be on BSD now (interestingly only FreeBSD and NetBSD flavors): And they all exhibit the same symptom ("No subtests run"), so at least it's consistent... |
Note that the the failures for both Net and FreeBSD are on unthreaded Perls for 1.02. I haven't been able to do any testing on this yet, but I hope to soon. |
Also the Perl that I built for FreeBSD was threaded too, which may explain why I wasn't able to reproduce it. |
I think I have this figured out. I was able to reproduce this on NetBSD once I installed zmq since the Perl on my NetBSD VM is unthreaded. It is, as I suspected dumping core:
The problem is that zmq uses pthreads:
I was able to get the test suite to pass by setting LD_PRELOAD:
Solutions as I see it include:
Here are some references: https://rt.perl.org/Public/Bug/Display.html?id=122906 This does seem to be a general Perl issue and not a FFI / Platypus issue, so that at least is good :) |
To clarify, an unthreaded Perl without the LD_PRELOAD hack WOULD work, IF the Perl had been linked with pthreads (which is possible with manual intervention by the person building Perl itself). This is probably half baked, and may not be portable, but I was able to detect if pthreads had been initalized with this snipit: use strict;
use warnings;
use 5.010;
use FFI::Platypus;
my $ffi = FFI::Platypus->new;
$ffi->find_lib( lib => 'pthread' );
$ffi->attach( pthread_self => [] => 'opaque' );
if(pthread_self() == -1)
{
warn 'pthreads were not initalized';
}
else
{
say pthread_self();
} Let me know if you want me to test whatever solution you come up with. |
Not sure why I didn't think of it last night but I think the portable way to determine if pthreads is already baked into the Perl you are using is use It breaks down if someone else has already loaded a library linked to pthreads, but them having done that is probably broken anyway. use strict;
use warnings;
use 5.010;
use FFI::Platypus;
my $ffi = FFI::Platypus->new;
$ffi->lib( undef );
if($ffi->find_symbol('pthread_self'))
{
say "have pthreads";
}
else
{
say "no pthreads";
} |
Awesome @plicease, thanks for the update. Just so I'm clear, the reason this isn't an issue on Linux is because the libc/pthread/dlopen semantics are different? i.e. on Linux pthread init can happen lazily on a subsequent dlopen, but on BSD it only happens on initial loading of the executable? That is, they're both honoring the NEEDED entry in the ELF dynamic section, it's just a matter of whether pthreads is being initialized on the lazy dlopen or not?
Regarding how to address, yeah I'm thinking go with the |
This should resolve #13. Follow @plicease's recommendation and use FFI::Platypus find_symbol on the current perl process to see if the pthread_self symbol exists. we're on BSD and the symbol doesn't exist bail on installing. This is preferrable over a $Config{usethreads} check as this will work even for custom perls that were manually linked to pthread (but not compiled with the usethreads flag).
This should resolve #13. Follow @plicease's recommendation and use FFI::Platypus find_symbol on the current perl process to see if the pthread_self symbol exists. If we're on BSD and the symbol doesn't exist bail on installing. This is preferrable over a $Config{usethreads} check as this will work even for custom perls that were manually linked to pthread (but not compiled with the usethreads flag).
@plicease I added the |
diff --git a/dist.ini b/dist.ini
index 07fd08e..94058a4 100644
--- a/dist.ini
+++ b/dist.ini
@@ -12,11 +12,11 @@ lib = zmq
[MakeMaker::Awesome]
delimiter = |
+header = |use FFI::Platypus;
header = |# Can't currently support unthreaded BSD perls
header = |# See GH #13
header = |if ($^O =~ m/bsd/i) {
-header = | !FFI::Platypus->new
-header = | ->lib(undef)
+header = | !FFI::Platypus->new(lib => [undef])
header = | ->find_symbol('pthread_self')
header = | && exit;
header = |} Almost, need to Fails with exit 0 on NetBSD without pthreads and installs on FreeBSD64 with a threaded Perl. Also installed on NetBSD with the |
fixed, thanks. All of the outstanding |
well, no luck... still failing on bsd. Checked the http://www.cpantesters.org/distro/Z/ZMQ-FFI.html?oncpan=1&distmat=1&version=1.04&grade=3 @plicease you think just check grr this action-at-a-distance stuff is hard to test. I'll reach out to the CPAN Testers and see if they can tell me if a) their Perl is definitely sans threads, and b) why the Makefile.PL didn't bail like it was supposed to. |
@calid It's up to you, and I agree that breaking LD_PRELOAD is not a big deal, but the problem with It does seem to be working for NetBSD at least. Admittedly I wasn't able to test FreeBSD because my Perl on my FreeBSD system is threaded. For FreeBSD you could check
At some point I do want to build an unthreaded Perl on FreeBSD that I can do some testing on. |
oh yeah, I'll probably hold off on further changes until more CPAN Tester reports come in... who knows, maybe those 4 are just a one off and it's working as expected everywhere else. |
Also it wouldn't hurt to let me get an unthreaded FreeBSD perl. It would be good to verify that |
Definitely, thanks again for your help |
Yes, the test reports mentioned above come from my boxes. The long runtime (wallclock secs > 3200) indicates that the tests were killed because they were hanging (inactivity timeout is 200s times 16 tests = 3200s). And yes, plicease's observation is correct that it seems to fail only for unthreaded FreeBSD perls without Right now I am running your module with such perls, so expect a couple of PASSes for the combination FreeBSD + unthreaded perl. |
@eserte thanks. One question: the newest From the 1.04 Makefile.PL on CPAN: use FFI::Platypus;
# Can't currently support unthreaded BSD perls
# See GH #13
if ($^O =~ m/bsd/i) {
!FFI::Platypus->new(lib => [undef])
->find_symbol('pthread_self')
&& exit;
} |
pthread_self seems to be part of libc:
|
@plicease thanks. @eserte I've published a developer release The direct link is at: http://www.cpan.org/authors/id/C/CA/CALID/ZMQ-FFI-1.05_01.tar.gz |
I published http://www.cpan.org/authors/id/C/CA/CALID/ZMQ-FFI-1.05_02.tar.gz |
1.05_02 looks good, it seems that the problematic perl versions are properly skipped on my systems. |
I've published |
http://www.cpantesters.org/cpan/report/82a6d9fa-c691-11e4-81ee-a225e0bfc7aa
http://www.cpantesters.org/cpan/report/81c2a190-c691-11e4-81ee-a225e0bfc7aa
http://www.cpantesters.org/cpan/report/dc0274fa-c632-11e4-a2b5-449ce0bfc7aa
http://www.cpantesters.org/cpan/report/dfe98c8a-c62c-11e4-8bfc-ee8be0bfc7aa
http://www.cpantesters.org/cpan/report/6bda7bfc-c699-11e4-adfb-e2d3ebda7229
http://www.cpantesters.org/cpan/report/6bda7bfc-c699-11e4-adfb-e2d3ebda7229
Seems to only occur on BSD. One of the CPAN testers provided this info:
The text was updated successfully, but these errors were encountered: