Skip Menu |
 

This queue is for tickets about the Socket-Netlink CPAN distribution.

Report information
The Basics
Id: 71112
Status: open
Priority: 0/
Queue: Socket-Netlink

People
Owner: Nobody in particular
Requestors: mathieu.bridon [...] network-box.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 0.03
Fixed in: (no value)

Attachments


Subject: Unit tests fail on ppc64
Download (untitled) / with headers
text/plain 442b
I'm trying to include Socket::Netlink in Fedora and EPEL6. In EPEL6, the 3 supported architectures are i686, x86_64 and ppc64. Here is the build log on ppc64, notice the unit tests failing: http://koji.fedoraproject.org/koji/getfile?taskID=3366738&name=build.log Unfortunately, I don't have a ppc64 machine handy to try and see if I can fix the problem, so my only choice for now is to simply not build the package for ppc64 in EPEL6.
Download (untitled) / with headers
text/plain 766b
On Wed Sep 21 03:09:56 2011, http://bochecha.id.fedoraproject.org/ wrote: Show quoted text
> I'm trying to include Socket::Netlink in Fedora and EPEL6. > > In EPEL6, the 3 supported architectures are i686, x86_64 and ppc64. > > Here is the build log on ppc64, notice the unit tests failing: > http://koji.fedoraproject.org/koji/getfile?
taskID=3366738&name=build.log Show quoted text
> > Unfortunately, I don't have a ppc64 machine handy to try and see if I > can fix the problem, so my only > choice for now is to simply not build the package for ppc64 in EPEL6.
At first glance that looks like it might be endian or 32/64bit cleanness going wrong. I'll have a look over the code to see if anything looks obviously out of place, as I have to do a new release soon anyway. -- Paul Evans
From: ppisar [...] redhat.com
Download (untitled) / with headers
text/plain 474b
Dne St 21.zář.2011 03:09:56, http://bochecha.id.fedoraproject.org/ napsal(a): Show quoted text
> I'm trying to include Socket::Netlink in Fedora and EPEL6. > > In EPEL6, the 3 supported architectures are i686, x86_64 and ppc64. > > Here is the build log on ppc64, notice the unit tests failing: >
http://koji.fedoraproject.org/koji/getfile?taskID=3366738&name=build.log Show quoted text
>
This issue is tracked by Fedora bug tracking system (https://bugzilla.redhat.com/show_bug.cgi?id=808197) now.
Subject: [rt.cpan.org #71112] Unit tests fail on ppc64
Date: Sun, 7 Sep 2014 21:26:38 +0200
To: bug-Socket-Netlink [...] rt.cpan.org
From: Emmanuel Seyman <emmanuel [...] seyman.fr>
Download (untitled) / with headers
text/plain 156b
FYI, t/20io-socket-netlink-generic.t still fails with Socket-Netlink-0.04 . https://kojipkgs.fedoraproject.org//work/tasks/742/7540742/build.log Emmanuel
From: ppisar [...] redhat.com
Download (untitled) / with headers
text/plain 1.4k
Dne St 21.zář.2011 13:24:06, PEVANS napsal(a): Show quoted text
> At first glance that looks like it might be endian or 32/64bit cleanness > going wrong.
There are two failures. In t/13netlink-message-attrs.t and in t/20io-socket-netlink-generic.t. The t/20io-socket-netlink-generic.t failure is: # Failed test '$message->pack' # at t/20io-socket-netlink-generic.t line 55. # at bytes 0-0xf (0-15) # got: | 00 00 00 14 00 1e 00 00 00 00 00 00 00 00 00 00 |................| # exp: | 00 00 00 14 00 00 00 1e 00 00 00 00 00 00 00 00 |................| The text is a hexadecimal dump of a netlink message built with code: my $message = $genlsock->new_message( nlmsg_type => 30, cmd => 1, version => 2 ); netlink(7) documents the netlink header as: struct nlmsghdr { __u32 nlmsg_len; /* Length of message including header. */ __u16 nlmsg_type; /* Type of message content. */ __u16 nlmsg_flags; /* Additional flags. */ __u32 nlmsg_seq; /* Sequence number. */ __u32 nlmsg_pid; /* Sender port ID. */ }; Current test is: is_hexstr( $message->pack, bswap("\x14\0\0\0").bswap("\x1e\0\0\0")."\0\0\0\0\0\0\0\0". "\1\2\0\0", '$message->pack' ); I think the test is wrong because the second bswap() call mangles 32 bites as one 32-bit integer but the netlink header has two 16-bit values nlmsg_type and nlmsg_flags there. The second bswap() should be split into two parts.
From: ppisar [...] redhat.com
Download (untitled) / with headers
text/plain 396b
Dne St 21.zář.2011 03:09:56, http://bochecha.id.fedoraproject.org/ napsal(a): Show quoted text
> I'm trying to include Socket::Netlink in Fedora and EPEL6. > > In EPEL6, the 3 supported architectures are i686, x86_64 and ppc64. > > Here is the build log on ppc64, notice the unit tests failing: > http://koji.fedoraproject.org/koji/getfile?taskID=3366738&name=build.log >
Attached patch fixes the tests.
Subject: 0001-Fix-tests-for-big-endian.patch
From ab1700d55b1b802e2eae4657b53b6017ae68047b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com> Date: Wed, 9 Nov 2016 13:17:40 +0100 Subject: [PATCH] Fix tests for big endian MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Tests in t/13netlink-message-attrs.t and t/20io-socket-netlink-generic.t failed on 64-bit big-endian PowerPC machines. This patch fixes erroneous bswap() calls in the tests by splitting nlmsg_type and nlmsg_flags fields in t/20io-socket-netlink-generic.t and handling zero-terminted byte-string literaly in t/13netlink-message-attrs.t. It also fixes incorrect length specification of a zero-terminated byte-string. CPAN RT#71112 Signed-off-by: Petr Písař <ppisar@redhat.com> --- t/13netlink-message-attrs.t | 2 +- t/20io-socket-netlink-generic.t | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/t/13netlink-message-attrs.t b/t/13netlink-message-attrs.t index 133d18e..132587f 100644 --- a/t/13netlink-message-attrs.t +++ b/t/13netlink-message-attrs.t @@ -87,7 +87,7 @@ $message = $sock->unpack_message( bswap("\5\0").bswap("\1\0").bswap("\7")."\0\0\0". bswap("\6\0").bswap("\2\0").bswap("\x59\0")."\0\0". bswap("\x08\0").bswap("\3\0").bswap("\xf3\3\0\0"). - bswap("\7\0").bswap("\4\0").bswap("FGH\0"). + bswap("\x08\0").bswap("\4\0")."FGH\0". bswap("\x0a\0").bswap("\5\0")."X\0Y\0Z\0\0\0". bswap("\x0c\0").bswap("\6\0"). bswap("\5\0").bswap("\1\0").bswap("\x15")."\0\0\0", diff --git a/t/20io-socket-netlink-generic.t b/t/20io-socket-netlink-generic.t index 16fb29e..c5cadde 100644 --- a/t/20io-socket-netlink-generic.t +++ b/t/20io-socket-netlink-generic.t @@ -53,7 +53,7 @@ isa_ok( $message, 'IO::Socket::Netlink::Generic::_Message', '$message' ); ok( $message->can( "cmd" ), '$message has ->cmd accessor' ); is_hexstr( $message->pack, - bswap("\x14\0\0\0").bswap("\x1e\0\0\0")."\0\0\0\0\0\0\0\0". + bswap("\x14\0\0\0").bswap("\x1e\0").bswap("\0\0")."\0\0\0\0\0\0\0\0". "\1\2\0\0", '$message->pack' ); -- 2.7.4
Download (untitled) / with headers
text/plain 142b
On Wed Nov 09 07:40:48 2016, ppisar wrote: Show quoted text
> > Attached patch fixes the tests.
Ahyes, another good catch. Pesky endians... -- Paul Evans


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

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.