NetBSD Problem Report #44705

From martin@duskware.de  Wed Mar  9 20:02:15 2011
Return-Path: <martin@duskware.de>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by www.NetBSD.org (Postfix) with ESMTP id 7398F63B93C
	for <gnats-bugs@gnats.NetBSD.org>; Wed,  9 Mar 2011 20:02:15 +0000 (UTC)
Message-Id: <20110309200215.7398F63B93C@www.NetBSD.org>
Date: Wed,  9 Mar 2011 20:02:15 +0000 (UTC)
From: martin@NetBSD.org
Reply-To: martin@NetBSD.org
To: gnats-bugs@gnats.NetBSD.org
Subject: libc violates sparc ABI by using %g7
X-Send-Pr-Version: 3.95

>Number:         44705
>Category:       port-sparc
>Synopsis:       libc violates sparc ABI by using %g7
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    port-sparc-maintainer
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Mar 09 20:05:00 +0000 2011
>Closed-Date:    Thu Feb 02 22:26:34 +0000 2012
>Last-Modified:  Thu Feb 02 22:26:34 +0000 2012
>Originator:     Martin Husemann
>Release:        NetBSD 5.99.48
>Organization:
The NetBSD Foundation, Inc.
>Environment:
System: NetBSD krups.duskware.de 5.99.48 NetBSD 5.99.48 (MP3) #12: Wed Mar 9 20:42:21 CET 2011 martin@night-porter.duskware.de:/usr/src/sys/arch/sparc/compile/MP3 sparc
Architecture: sparc
Machine: sparc
>Description:
The libc source generated from src/lib/libc/arch/sparc/gen/divrem.m4 use a
scratch register "SC", which is currently defined as %g7. This violates the
ABI and will cause trouble with threaded programs.

Luckily the code in question (in default installs) should only be used on
sparc v7 machines (not seen [powered on] in the wild a lot nowadays).
>How-To-Repeat:
Code inspection.
>Fix:
n/a

>Release-Note:

>Audit-Trail:
From: Manuel Bouyer <bouyer@antioche.eu.org>
To: gnats-bugs@NetBSD.org
Cc: port-sparc-maintainer@NetBSD.org, gnats-admin@NetBSD.org,
        netbsd-bugs@NetBSD.org
Subject: Re: port-sparc/44705: libc violates sparc ABI by using %g7
Date: Wed, 9 Mar 2011 21:26:57 +0100

 On Wed, Mar 09, 2011 at 08:05:00PM +0000, martin@NetBSD.org wrote:
 > The libc source generated from src/lib/libc/arch/sparc/gen/divrem.m4 use a
 > scratch register "SC", which is currently defined as %g7. This violates the
 > ABI and will cause trouble with threaded programs.
 > 
 > Luckily the code in question (in default installs) should only be used on
 > sparc v7 machines (not seen [powered on] in the wild a lot nowadays).

 Could this be the reason why some threaded programs have troubles on
 my sparc IPX ?

 -- 
 Manuel Bouyer <bouyer@antioche.eu.org>
      NetBSD: 26 ans d'experience feront toujours la difference
 --

From: Martin Husemann <martin@duskware.de>
To: Manuel Bouyer <bouyer@antioche.eu.org>
Cc: gnats-bugs@NetBSD.org, port-sparc-maintainer@NetBSD.org,
	gnats-admin@NetBSD.org, netbsd-bugs@NetBSD.org
Subject: Re: port-sparc/44705: libc violates sparc ABI by using %g7
Date: Wed, 9 Mar 2011 21:31:24 +0100

 On Wed, Mar 09, 2011 at 09:26:57PM +0100, Manuel Bouyer wrote:
 > Could this be the reason why some threaded programs have troubles on
 > my sparc IPX ?

 Not yet - the stack address based pthread_self() we use untill TLS hits
 the tree is not affected.

 Martin

From: David Holland <dholland-bugs@netbsd.org>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: port-sparc/44705: libc violates sparc ABI by using %g7
Date: Wed, 16 Mar 2011 06:13:05 +0000

 On Wed, Mar 09, 2011 at 08:30:05PM +0000, Manuel Bouyer wrote:
  >  Could this be the reason why some threaded programs have troubles on
  >  my sparc IPX ?

 Don't forget there's also PR 4029.

 -- 
 David A. Holland
 dholland@netbsd.org

State-Changed-From-To: open->closed
State-Changed-By: martin@NetBSD.org
State-Changed-When: Thu, 02 Feb 2012 22:26:34 +0000
State-Changed-Why:
Fixed during the TLS cleanup


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