NetBSD Problem Report #14095

Received: (qmail 13262 invoked from network); 29 Sep 2001 13:46:13 -0000
Message-Id: <200109291346.f8TDkBc00580@mmgserv.m2g.org>
Date: Sat, 29 Sep 2001 22:46:11 +0900 (JST)
From: taya@ba2.so-net.ne.jp
Reply-To: taya@ba2.so-net.ne.jp
To: gnats-bugs@gnats.netbsd.org
Subject: assigning return value of strlen() to double fails
X-Send-Pr-Version: 3.95

>Number:         14095
>Category:       port-sparc64
>Synopsis:       assigning return value of strlen() to double fails
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    port-sparc64-maintainer
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Sep 29 13:47:00 +0000 2001
>Closed-Date:    Sat Sep 29 13:53:10 +0000 2001
>Last-Modified:  Sun Sep 30 02:15:00 +0000 2001
>Originator:     Shin'ichiro TAYA
>Release:        Sep.28, 2001
>Organization:

--
Shin'ichiro TAYA <taya@ba2.so-net.ne.jp>
>Environment:

System: NetBSD turtle13.m2g.org 1.5Y NetBSD 1.5Y (BLADE100) #1: Sun Sep 30 19:32:07 JST 2001     taya@turtle13.m2g.org:/export/NetBSD/NetBSD-current/src/sys/arch/sparc64/compile/BLADE100 sparc64
Architecture: sparc64
Machine: sparc64
>Description:
	Assigning return value of strlen() to double fails.
	Because of this bug, awk doesn't work correctly.
	And this leads build failure of libedit.

>How-To-Repeat:
	% cat a.c
	#include	<stdio.h>

	main()
	{
		double	u;

		u = strlen("abc");

		printf("u = %g\n", u);
	}
	% cc a.c
	% ./a.out
	u = 1.4822e-323
	%

>Fix:

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: mrg 
State-Changed-When: Sat Sep 29 06:52:38 PDT 2001 
State-Changed-Why:  
this bug is known and already worked around.  see doc/HACKS and 
gnu/usr.bin/gawk/Makefile. 

From: matthew green <mrg@eterna.com.au>
To: taya@ba2.so-net.ne.jp
Cc: gnats-bugs@gnats.netbsd.org
Subject: re: port-sparc64/14095: assigning return value of strlen() to double fails 
Date: Sat, 29 Sep 2001 23:52:19 +1000

 awk should be built with -msoft-quad-float.  this is a known bug
 (see doc/HACKS) but it should be already worked around.  from
 src/gnu/usr.bin/gawk/Makefile:


 	.if (${MACHINE_ARCH} == "sparc64")
 	CFLAGS+=        -msoft-quad-float
 	.endif

From: "Shin'ichiro TAYA" <taya@ba2.so-net.ne.jp>
To: mrg@eterna.com.au
Cc: gnats-bugs@gnats.netbsd.org
Subject: Re: port-sparc64/14095: assigning return value of strlen() to
 double fails 
Date: Sun, 30 Sep 2001 02:17:11 +0900 (JST)

 From: matthew green <mrg@eterna.com.au>
 Subject: re: port-sparc64/14095: assigning return value of strlen() to double fails 
 Date: Sat, 29 Sep 2001 23:52:19 +1000

 > 
 > awk should be built with -msoft-quad-float.  this is a known bug
 > (see doc/HACKS) but it should be already worked around.  from
 > src/gnu/usr.bin/gawk/Makefile:
 > 
 > 
 > 	.if (${MACHINE_ARCH} == "sparc64")
 > 	CFLAGS+=        -msoft-quad-float
 > 	.endif

 Oops, I looked at wrong directory(src/usr.bin/awk).
 But awk(gnu/usr.bin/gawk) still doesn't work correctly, so fail to
 build libedit.
 I'll send another PR.

 sparc64:
 % echo 'abc defg' | awk '{print substr($2, 1,2);}'

 % 

 i386:
 % echo 'abc defg' | awk '{print substr($2, 1,2);}'
 de
 % 

From: matthew green <mrg@eterna.com.au>
To: "Shin'ichiro TAYA" <taya@ba2.so-net.ne.jp>
Cc: gnats-bugs@gnats.netbsd.org
Subject: re: port-sparc64/14095: assigning return value of strlen() to double fails 
Date: Sun, 30 Sep 2001 12:14:43 +1000

    From: matthew green <mrg@eterna.com.au>
    Subject: re: port-sparc64/14095: assigning return value of strlen() to double fails 
    Date: Sat, 29 Sep 2001 23:52:19 +1000

    > 
    > awk should be built with -msoft-quad-float.  this is a known bug
    > (see doc/HACKS) but it should be already worked around.  from
    > src/gnu/usr.bin/gawk/Makefile:
    > 
    > 
    > 	.if (${MACHINE_ARCH} == "sparc64")
    > 	CFLAGS+=        -msoft-quad-float
    > 	.endif

    Oops, I looked at wrong directory(src/usr.bin/awk).
    But awk(gnu/usr.bin/gawk) still doesn't work correctly, so fail to
    build libedit.
    I'll send another PR.

    sparc64:
    % echo 'abc defg' | awk '{print substr($2, 1,2);}'

    % 

    i386:
    % echo 'abc defg' | awk '{print substr($2, 1,2);}'
    de
    % 


 this is exactly the problem the workaround should fix.  is your awk
 properly built?  it sounds not.


 .mrg.
>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.