NetBSD Problem Report #46898

From msaitoh@execsw.org  Tue Sep  4 04:40:03 2012
Return-Path: <msaitoh@execsw.org>
Received: from mail.netbsd.org (mail.netbsd.org [149.20.53.66])
	by www.NetBSD.org (Postfix) with ESMTP id A99FC63B86D
	for <gnats-bugs@gnats.NetBSD.org>; Tue,  4 Sep 2012 04:40:03 +0000 (UTC)
Message-Id: <20120904044000.C039F439854@vslock.execsw.org>
Date: Tue,  4 Sep 2012 13:40:00 +0900 (JST)
From: msaitoh@execsw.org
Reply-To: msaitoh@execsw.org
To: gnats-bugs@gnats.NetBSD.org
Subject: t_nat_ipf_exec
X-Send-Pr-Version: 3.95

>Number:         46898
>Category:       port-arm
>Synopsis:       t_nat_ipf_exec fails on arm
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    port-arm-maintainer
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Sep 04 04:45:00 +0000 2012
>Closed-Date:    Sat Sep 15 17:02:41 +0000 2012
>Last-Modified:  Sat Sep 15 17:02:41 +0000 2012
>Originator:     SAITOH Masanobu
>Release:        netbsd-6 and -current
>Organization:
-----------------------------------------------
		SAITOH Masanobu (msaitoh@netbsd.org)
>Environment:
Architecture: arm
Machine: evbarm
>Description:
	/usr/tests/ipf/t_nat_ipf_exec and some ipf tests fail on arm.
	tested both netbsd-6 and current. The test binary and kernel
	were made from 2012/09/04's source code. So, it's different
	from PR#46865.

# atf-run t_nat_ipf_exec |atf-report
Tests root: /usr/tests/ipf

t_nat_ipf_exec (1/1): 22 test cases
    ni1: [0.556454s] Failed: results differ
    ni10: [0.567413s] Failed: results differ
    ni11: [0.469307s] Failed: results differ
    ni12: [0.466899s] Failed: results differ
    ni13: [0.515241s] Failed: results differ
    ni14: [0.627750s] Failed: results differ
    ni15: [0.522298s] Failed: results differ
    ni16: [0.628566s] Failed: results differ
    ni17: [0.410399s] Passed.
    ni18: [0.409700s] Passed.
    ni19: [0.598524s] Failed: results differ
    ni2: [0.496925s] Failed: results differ
    ni20: [0.605358s] Failed: results differ
    ni21: [0.413808s] Passed.
    ni23: [0.518455s] Passed.
    ni3: [0.465314s] Failed: results differ
    ni4: [0.566758s] Failed: results differ
    ni5: [0.550354s] Failed: results differ
    ni6: [0.536449s] Passed.
    ni7: [0.470756s] Failed: results differ
    ni8: [0.575661s] Failed: results differ
    ni9: [0.466272s] Failed: results differ
[11.865294s]

Failed test cases:
    t_nat_ipf_exec:ni1, t_nat_ipf_exec:ni10, t_nat_ipf_exec:ni11,
    t_nat_ipf_exec:ni12, t_nat_ipf_exec:ni13, t_nat_ipf_exec:ni14,
    t_nat_ipf_exec:ni15, t_nat_ipf_exec:ni16, t_nat_ipf_exec:ni19,
    t_nat_ipf_exec:ni2, t_nat_ipf_exec:ni20, t_nat_ipf_exec:ni3,
    t_nat_ipf_exec:ni4, t_nat_ipf_exec:ni5, t_nat_ipf_exec:ni7,
    t_nat_ipf_exec:ni8, t_nat_ipf_exec:ni9
Summary for 1 test programs:
    5 passed test cases.
    17 failed test cases.
    0 expected failed test cases.
    0 skipped test cases.

>How-To-Repeat:
	Do following command on an arm machine:

	cd /usr/tests/ipf
	atf-run
>Fix:
	I don't know.

>Release-Note:

>Audit-Trail:
From: Masanobu SAITOH <msaitoh@execsw.org>
To: gnats-bugs@NetBSD.org
Cc: port-arm-maintainer@netbsd.org, gnats-admin@netbsd.org, 
 netbsd-bugs@netbsd.org, msaitoh@execsw.org
Subject: Re: port-arm/46898: t_nat_ipf_exec
Date: Tue, 04 Sep 2012 13:55:59 +0900

 >> Description:
 > 	/usr/tests/ipf/t_nat_ipf_exec and some ipf tests fail on arm.
 > 	tested both netbsd-6 and current. The test binary and kernel
 > 	were made from 2012/09/04's source code. So, it's different
 > 	from PR#46865.
 > 
 > # atf-run t_nat_ipf_exec |atf-report
 > Tests root: /usr/tests/ipf
 > 
 > t_nat_ipf_exec (1/1): 22 test cases
 >      ni1: [0.556454s] Failed: results differ

 results' diff are like as follows:

 > Test case: ipf/t_nat_exec/n10
 > 
 > Duration: 0.511676 seconds
 > Termination reason
 > 
 > FAILED: results differ
 > Standard output stream
 > 
 > Executing command [ /bin/sh -c echo "map ppp0 0/0 -> 203.203.203.203/32 mssclamp 100" | ipftest -T fr_update_ipid=0 -xF hex -RbN - -i in ]
 > Executing command [ /bin/sh -c echo "map ppp0 0/0 -> 203.203.203.203/32 mssclamp 1000" | ipftest -T fr_update_ipid=0 -xF hex -RbN - -i in ]
 > Executing command [ /bin/sh -c echo "map ppp0 0/0 -> 203.203.203.203/32 mssclamp 10000" | ipftest -T fr_update_ipid=0 -xF hex -RbN - -i in ]
 > --- exp	2012-09-04 02:14:52.000000000 +0000
 > +++ out	2012-09-04 02:14:53.000000000 +0000
 > @@ -1,9 +1,9 @@
 > -4500 002c 10c9 4000 ff06 5c9d cbcb cbcb 96cb e002 8032 0015 bd6b c9c8 0000 0000 6002 2238 655d 0000 0204 0064 
 > +4500 002c 10c9 4000 ff06 ffff cbcb cbcb 96cb e002 8032 0015 bd6b c9c8 0000 0000 6002 2238 ffff 0000 0204 0064 
 >  
 >  -------------------------------
 > -4500 002c 10c9 4000 ff06 5c9d cbcb cbcb 96cb e002 8032 0015 bd6b c9c8 0000 0000 6002 2238 61d9 0000 0204 03e8 
 > +4500 002c 10c9 4000 ff06 ffff cbcb cbcb 96cb e002 8032 0015 bd6b c9c8 0000 0000 6002 2238 ffff 0000 0204 03e8 
 >  
 >  -------------------------------
 > -4500 002c 10c9 4000 ff06 5c9d cbcb cbcb 96cb e002 8032 0015 bd6b c9c8 0000 0000 6002 2238 600d 0000 0204 05b4 
 > +4500 002c 10c9 4000 ff06 ffff cbcb cbcb 96cb e002 8032 0015 bd6b c9c8 0000 0000 6002 2238 ffff 0000 0204 05b4 
 >  
 >  -------------------------------

 failed to recalculate checksum?

 -- 
 -----------------------------------------------
                 SAITOH Masanobu (msaitoh@execsw.org
                                  msaitoh@netbsd.org)

From: Masanobu SAITOH <msaitoh@execsw.org>
To: gnats-bugs@NetBSD.org
Cc: Masanobu SAITOH <msaitoh@execsw.org>, port-arm-maintainer@netbsd.org, 
 gnats-admin@netbsd.org, netbsd-bugs@netbsd.org
Subject: Re: port-arm/46898: t_nat_ipf_exec
Date: Wed, 05 Sep 2012 09:11:07 +0900

  test program:
 =============================================================
 #include <stdio.h>
 #include <stdint.h>

 #include <arpa/inet.h>

 uint32_t wrapsum(uint32_t);

 int sum = 0x00000102;

 uint32_t
 wrapsum(uint32_t sum)
 {
         sum = ~sum & 0xFFFF;
         return htons(sum);
 }

 int
 main(int argc, char *argv[])
 {
         uint32_t wsum = wrapsum(sum);

         printf("0x%08x\n", wsum);

         return 0;
 }
 =============================================================

 On i386:
 > % gcc -O2 pkt.c -o pkt
 > % ./pkt
 > 0x0000fdfe

 On arm:
 > $ gcc -O2 pkt.c -o pkt
 > $ ./pkt
 > 0x0000ffff


 -- 
 -----------------------------------------------
                 SAITOH Masanobu (msaitoh@execsw.org
                                  msaitoh@netbsd.org)

From: "Matt Thomas" <matt@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/46898 CVS commit: src/sys/arch/arm/include
Date: Wed, 5 Sep 2012 01:03:54 +0000

 Module Name:	src
 Committed By:	matt
 Date:		Wed Sep  5 01:03:54 UTC 2012

 Modified Files:
 	src/sys/arch/arm/include: byte_swap.h

 Log Message:
 Disable arm32 __asm for _byte_swap_u16_variable since gcc4.5 produces
 decent code for it.  Fixes PR/46898.


 To generate a diff of this commit:
 cvs rdiff -u -r1.11 -r1.12 src/sys/arch/arm/include/byte_swap.h

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: David Laight <david@l8s.co.uk>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: PR/46898 CVS commit: src/sys/arch/arm/include
Date: Wed, 5 Sep 2012 07:29:40 +0100

 On Wed, Sep 05, 2012 at 01:05:03AM +0000, Matt Thomas wrote:
 >  Disable arm32 __asm for _byte_swap_u16_variable since gcc4.5 produces
 >  decent code for it.  Fixes PR/46898.

 Presumably there was also something badly wrong with it as well?
 That is likely to be replicated and will crop up elsewhere.

 	David

 -- 
 David Laight: david@l8s.co.uk

From: Matt Thomas <matt@3am-software.com>
To: gnats-bugs@NetBSD.org
Cc: port-arm-maintainer@netbsd.org,
 gnats-admin@netbsd.org,
 netbsd-bugs@netbsd.org,
 msaitoh@execsw.org
Subject: Re: PR/46898 CVS commit: src/sys/arch/arm/include
Date: Tue, 4 Sep 2012 23:58:58 -0700

 On Sep 4, 2012, at 11:40 PM, David Laight wrote:

 > The following reply was made to PR port-arm/46898; it has been noted =
 by GNATS.
 >=20
 > From: David Laight <david@l8s.co.uk>
 > To: gnats-bugs@NetBSD.org
 > Cc:=20
 > Subject: Re: PR/46898 CVS commit: src/sys/arch/arm/include
 > Date: Wed, 5 Sep 2012 07:29:40 +0100
 >=20
 > On Wed, Sep 05, 2012 at 01:05:03AM +0000, Matt Thomas wrote:
 >> Disable arm32 __asm for _byte_swap_u16_variable since gcc4.5 produces
 >> decent code for it.  Fixes PR/46898.
 >=20
 > Presumably there was also something badly wrong with it as well?
 > That is likely to be replicated and will crop up elsewhere.

 the uint16_t was causing the compiler to assume the upper 16-bits
 didn't matter which int fact they did.  So unexpected got mixed
 into the result resulting in a bad value.  Hence the adding of a
 uint32_t temporary to cause the compiler to do the right thing.  But
 after examining the code that generated again the naive C code, i
 found the the normal optimizer did a decent enough job that the asm
 wasn't needed.=

From: "Jeff Rizzo" <riz@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/46898 CVS commit: [netbsd-6] src/sys/arch/arm/include
Date: Thu, 13 Sep 2012 20:28:16 +0000

 Module Name:	src
 Committed By:	riz
 Date:		Thu Sep 13 20:28:16 UTC 2012

 Modified Files:
 	src/sys/arch/arm/include [netbsd-6]: byte_swap.h

 Log Message:
 Pull up following revision(s) (requested by martin in ticket #542):
 	sys/arch/arm/include/byte_swap.h: revision 1.12
 Disable arm32 __asm for _byte_swap_u16_variable since gcc4.5 produces
 decent code for it.  Fixes PR/46898.


 To generate a diff of this commit:
 cvs rdiff -u -r1.8 -r1.8.40.1 src/sys/arch/arm/include/byte_swap.h

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: open->closed
State-Changed-By: dholland@NetBSD.org
State-Changed-When: Sat, 15 Sep 2012 17:02:41 +0000
State-Changed-Why:
fixed and pulled up.


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.