-
Notifications
You must be signed in to change notification settings - Fork 4
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
libb-cow-perl: fails to build (test failures) on some architectures #1
Comments
@gregoa could you give me more informations on the Perl version used, would appreciate if you could copy paste here the full output from |
Here's the output from
|
We have the same problem for ppc: https://build.opensuse.org/package/live_build_log/devel:languages:perl/perl-B-COW/openSUSE_Tumbleweed/ppc |
The pattern of test failure is "fails on big endian". |
Given that this is a fail in One (admittedly undesirable) workaround is to build Perl without COW support, but this dist will need to be updated to handle such configurations. #3 is how I would do it. |
Just thinking aloud here, but the tests are failing with
Maybe the difference between shared hash keys and other scalar values is relevant here? |
As an experiment, I tried this: figment% git diff
diff --git a/COW.xs b/COW.xs
index 151a6d9..0607210 100644
--- a/COW.xs
+++ b/COW.xs
@@ -67,6 +67,22 @@ CODE:
OUTPUT:
RETVAL
+
+SV*
+cowrefcnt_shared_hash(sv)
+ SV *sv;
+CODE:
+{
+#if !B_CAN_COW
+ XSRETURN_UNDEF;
+#else
+ if ( SvIsCOW_shared_hash(sv) ) XSRETURN_IV( CowREFCNT(sv) );
+#endif
+ XSRETURN_UNDEF;
+}
+OUTPUT:
+ RETVAL
+
SV*
cowrefcnt_max()
CODE:
diff --git a/lib/B/COW.pm b/lib/B/COW.pm
index 287629a..4a7c055 100644
--- a/lib/B/COW.pm
+++ b/lib/B/COW.pm
@@ -13,7 +13,7 @@ use XSLoader;
XSLoader::load(__PACKAGE__);
-my @all_export = qw{ can_cow is_cow cowrefcnt cowrefcnt_max };
+my @all_export = qw{ can_cow is_cow cowrefcnt cowrefcnt_shared_hash cowrefcnt_max };
our @EXPORT_OK = (
@all_export,
@@ -78,4 +78,4 @@ If the string is not COW, then it will return undef.
=head2 cowrefcnt_max()
Will return the SV_COW_REFCNT_MAX of your Perl. (if COW is supported, this should
-be 255 unless customized).
\ No newline at end of file
+be 255 unless customized).
diff --git a/t/01-basic.t b/t/01-basic.t
index 7d4be88..41f4f65 100644
--- a/t/01-basic.t
+++ b/t/01-basic.t
@@ -55,7 +55,7 @@ if ( can_cow() ) {
my %h = ( 'a'..'d' );
foreach my $k ( sort keys %h ) {
ok is_cow( $k ), "key $k is cowed";
- is cowrefcnt( $k ), 0, "hash key $k cowrefcnt is 0" or Dump($k);
+ is cowrefcnt_shared_hash( $k ), 0, "hash key $k cowrefcnt is 0" or Dump($k);
}
}
but I get the same result running the test:
Or maybe I was trying the wrong thing? I am happy to try other variations while I happen to have a BE machine to test on. |
I can also test things on ppc if it helps |
@perlpunk any chance I could use the ppc machine/vm a few hours to debug? |
@atoomic Sorry, that's not possible. I can only test it by letting the SUSE Open Build Service run a build on a package. I think we also have ppc vms where I can login, but they are in the intranet only. |
@atoomic You could create an account on https://build.opensuse.org/ and branch the https://build.opensuse.org/package/show/devel:languages:perl/perl-B-COW package and put debug statements in your tests. But a build can take a while. |
Dan Horák should be able to provide you with access to an s390x machine: https://fedoraproject.org/wiki/Architectures/s390x#Shell_access_for_debugging |
Thanks to the help of @Tux I can now reproduce the issue, |
I think this is a bug in
for example, when increasing the length of one hash key using
|
Fix #1 If the SvPV has a LEN=0, we should not try to read what's in front to access the CowREFCNT and consider its value is 0.
this was reported upstream and I'm going to provide a fix upstream for it |
Fix #1 If the SvPV has a LEN=0, we should not try to read what's in front to access the CowREFCNT and consider its value is 0. Upstream-URL: Perl/perl5#17745
This is going to be fixed in v0.004 which was just uploaded to CPAN |
Thanks! |
On Thu, 23 Apr 2020 13:43:05 -0700, Nicolas R. wrote:
This is going to be fixed in v0.004 which was just uploaded to CPAN
Thank you!
Uploaded to Debian, the build logs for 0.004-1 will be showing up at
https://buildd.debian.org/status/package.php?p=libb-cow-perl over the
next few hours.
Cheers,
gregor
|
I've performed some extra tests using one |
Built OK for multiple architectures and Fedora/EPEL versions: |
On Fri, 24 Apr 2020 07:56:16 -0700, Paul Howarth wrote:
Built OK for multiple architectures and Fedora/EPEL versions:
https://bodhi.fedoraproject.org/updates/?packages=perl-B-COW
Thank you!
Same for Debian:
https://buildd.debian.org/status/package.php?p=libb-cow-perl
Thanks!
|
We have the following bug reported to the Debian package of B-COW,
c.f. https://bugs.debian.org/945416
It doesn't seem to be a bug in the packaging, so you may want to take
a look. Thanks!
------8<-----------8<-----------8<-----------8<-----------8<-----
------8<-----------8<-----------8<-----------8<-----------8<-----
Thanks for considering,
gregor herrmann,
Debian Perl Group
The text was updated successfully, but these errors were encountered: