[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#278379: marked as done (Atomic stdc++ operations are broken on some MIPS machines)



Your message dated Sun, 05 Dec 2004 06:58:38 -0500
with message-id <E1Cav2E-0003bG-00@newraff.debian.org>
and subject line Bug#278379: fixed in gcc-3.3 1:3.3.5-3
has caused the attached Bug report to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what I am
talking about this indicates a serious mail system misconfiguration
somewhere.  Please contact me immediately.)

Debian bug tracking system administrator
(administrator, Debian Bugs database)

--------------------------------------
Received: (at submit) by bugs.debian.org; 26 Oct 2004 14:09:20 +0000
>From ica2_ts@csv.ica.uni-stuttgart.de Tue Oct 26 07:09:20 2004
Return-path: <ica2_ts@csv.ica.uni-stuttgart.de>
Received: from iris1.csv.ica.uni-stuttgart.de [129.69.118.2] 
	by spohr.debian.org with esmtp (Exim 3.35 1 (Debian))
	id 1CMS0l-0006PJ-00; Tue, 26 Oct 2004 07:09:20 -0700
Received: from rembrandt.csv.ica.uni-stuttgart.de ([129.69.118.42])
	by iris1.csv.ica.uni-stuttgart.de with esmtp
	id 1CMS0k-00084E-00
	for <submit@bugs.debian.org>; Tue, 26 Oct 2004 16:09:18 +0200
Received: from ica2_ts by rembrandt.csv.ica.uni-stuttgart.de with local (Exim 3.35 #1 (Debian))
	id 1CMS0h-00047u-00
	for <submit@bugs.debian.org>; Tue, 26 Oct 2004 16:09:15 +0200
Date: Tue, 26 Oct 2004 16:09:15 +0200
To: submit@bugs.debian.org
Subject: Atomic stdc++ operations are broken on some MIPS machines
Message-ID: <20041026140915.GF24545@rembrandt.csv.ica.uni-stuttgart.de>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
X-Debbugs-CC: flo@rfc822.org
User-Agent: Mutt/1.5.6i
From: Thiemo Seufer <ica2_ts@csv.ica.uni-stuttgart.de>
Delivered-To: submit@bugs.debian.org
X-Spam-Checker-Version: SpamAssassin 2.60-bugs.debian.org_2004_03_25 
	(1.212-2003-09-23-exp) on spohr.debian.org
X-Spam-Status: No, hits=-11.0 required=4.0 tests=BAYES_00,HAS_PACKAGE,
	X_DEBBUGS_CC autolearn=ham version=2.60-bugs.debian.org_2004_03_25
X-Spam-Level: 

Package: gcc-3.3
Version: 3.3.5-1
Severity: important

While trying to run Debian on a SGI O200 Machine I found out that the
inline assembly to handle atomic operations in libstdc++ is broken.
The effect is very visible: "apt-get update" hangs in an endless loop
on startup, same for every other c++ program I tried. This happens on
machines with R10000 CPU, others may show degraded performance.

R10000 CPUs aren't yet officially supported in Debian, so I used
serverity important for this bugreport.

The problem is caused by inserting normal load operation in the atomic
loop, which isn't guaranteed to work. The load is generated by the
assembler to fulfill the memory reference, so it isn't visible in the
source.

The appended patch fixes it. It also changes the branch to the likely
variant, this works around some breakage in early R10000 silicon.
The patch is against gcc-3.3, newer gccs have the same problem, but
have some apparently bogus changes in that area.


Thiemo


#! /bin/sh -e

# All lines beginning with `# DPATCH:' are a description of the patch.
# DP: Fix libstdc++ atomic ops for mips/mipsel

dir=
if [ $# -eq 3 -a "$2" = '-d' ]; then
    pdir="-d $3"
    dir="$3/"
elif [ $# -ne 1 ]; then
    echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
    exit 1
fi
case "$1" in
    -patch)
        patch $pdir -f --no-backup-if-mismatch -p0 < $0
        #cd ${dir}gcc && autoconf
        ;;
    -unpatch)
        patch $pdir -f --no-backup-if-mismatch -R -p0 < $0
        #rm ${dir}gcc/configure
        ;;
    *)
        echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
        exit 1
esac
exit 0

--- libstdc++-v3/config/cpu/mips/atomicity.h.old	2003-06-02 20:04:54.000000000 +0200
+++ libstdc++-v3/config/cpu/mips/atomicity.h	2004-10-23 17:41:38.000000000 +0200
@@ -40,17 +40,19 @@ __exchange_and_add (volatile _Atomic_wor
 
   __asm__ __volatile__
     ("/* Inline exchange & add */\n\t"
-     "1:\n\t"
      ".set	push\n\t"
      ".set	mips2\n\t"
-     "ll	%0,%3\n\t"
-     "addu	%1,%4,%0\n\t"
-     "sc	%1,%2\n\t"
+     ".set	noreorder\n\t"
+     ".set	nomacro\n"
+     "1:\tll	%0,(%2)\n\t"
+     "addu	%1,%3,%0\n\t"
+     "sc	%1,(%2)\n\t"
+     ".set	reorder\n\t"
+     "beqzl	%1,1b\n\t"
      ".set	pop\n\t"
-     "beqz	%1,1b\n\t"
-     "/* End exchange & add */"
-     : "=&r"(__result), "=&r"(__tmp), "=m"(*__mem)
-     : "m" (*__mem), "r"(__val)
+     "/* End exchange & add */\n"
+     : "=&r"(__result), "=&r"(__tmp), "+r"(__mem)
+     : "r"(__val)
      : "memory");
 
   return __result;
@@ -64,17 +66,19 @@ __atomic_add (volatile _Atomic_word *__m
 
   __asm__ __volatile__
     ("/* Inline atomic add */\n\t"
-     "1:\n\t"
      ".set	push\n\t"
      ".set	mips2\n\t"
-     "ll	%0,%2\n\t"
-     "addu	%0,%3,%0\n\t"
-     "sc	%0,%1\n\t"
+     ".set	noreorder\n\t"
+     ".set	nomacro\n"
+     "1:\tll	%0,(%1)\n\t"
+     "addu	%0,%2,%0\n\t"
+     "sc	%0,(%1)\n\t"
+     ".set	reorder\n\t"
+     "beqzl	%0,1b\n\t"
      ".set	pop\n\t"
-     "beqz	%0,1b\n\t"
-     "/* End atomic add */"
-     : "=&r"(__result), "=m"(*__mem)
-     : "m" (*__mem), "r"(__val)
+     "/* End atomic add */\n"
+     : "=&r"(__result), "+r"(__mem)
+     : "r"(__val)
      : "memory");
 }
 

---------------------------------------
Received: (at 278379-close) by bugs.debian.org; 5 Dec 2004 12:20:44 +0000
>From katie@ftp-master.debian.org Sun Dec 05 04:20:44 2004
Return-path: <katie@ftp-master.debian.org>
Received: from newraff.debian.org [208.185.25.31] 
	by spohr.debian.org with esmtp (Exim 3.35 1 (Debian))
	id 1CavNb-0000fq-00; Sun, 05 Dec 2004 04:20:44 -0800
Received: from katie by newraff.debian.org with local (Exim 3.35 1 (Debian))
	id 1Cav2E-0003bG-00; Sun, 05 Dec 2004 06:58:38 -0500
From: Matthias Klose <doko@debian.org>
To: 278379-close@bugs.debian.org
X-Katie: $Revision: 1.54 $
Subject: Bug#278379: fixed in gcc-3.3 1:3.3.5-3
Message-Id: <E1Cav2E-0003bG-00@newraff.debian.org>
Sender: Archive Administrator <katie@ftp-master.debian.org>
Date: Sun, 05 Dec 2004 06:58:38 -0500
Delivered-To: 278379-close@bugs.debian.org
X-Spam-Checker-Version: SpamAssassin 2.60-bugs.debian.org_2004_03_25 
	(1.212-2003-09-23-exp) on spohr.debian.org
X-Spam-Status: No, hits=-6.0 required=4.0 tests=BAYES_00,HAS_BUG_NUMBER 
	autolearn=no version=2.60-bugs.debian.org_2004_03_25
X-Spam-Level: 
X-CrossAssassin-Score: 4

Source: gcc-3.3
Source-Version: 1:3.3.5-3

We believe that the bug you reported is fixed in the latest version of
gcc-3.3, which is due to be installed in the Debian FTP archive:

cpp-3.3-doc_3.3.5-3_all.deb
  to pool/main/g/gcc-3.3/cpp-3.3-doc_3.3.5-3_all.deb
cpp-3.3_3.3.5-3_i386.deb
  to pool/main/g/gcc-3.3/cpp-3.3_3.3.5-3_i386.deb
fixincludes_3.3.5-3_i386.deb
  to pool/main/g/gcc-3.3/fixincludes_3.3.5-3_i386.deb
g++-3.3_3.3.5-3_i386.deb
  to pool/main/g/gcc-3.3/g++-3.3_3.3.5-3_i386.deb
g77-3.3-doc_3.3.5-3_all.deb
  to pool/main/g/gcc-3.3/g77-3.3-doc_3.3.5-3_all.deb
g77-3.3_3.3.5-3_i386.deb
  to pool/main/g/gcc-3.3/g77-3.3_3.3.5-3_i386.deb
gcc-3.3-base_3.3.5-3_i386.deb
  to pool/main/g/gcc-3.3/gcc-3.3-base_3.3.5-3_i386.deb
gcc-3.3-doc_3.3.5-3_all.deb
  to pool/main/g/gcc-3.3/gcc-3.3-doc_3.3.5-3_all.deb
gcc-3.3_3.3.5-3.diff.gz
  to pool/main/g/gcc-3.3/gcc-3.3_3.3.5-3.diff.gz
gcc-3.3_3.3.5-3.dsc
  to pool/main/g/gcc-3.3/gcc-3.3_3.3.5-3.dsc
gcc-3.3_3.3.5-3_i386.deb
  to pool/main/g/gcc-3.3/gcc-3.3_3.3.5-3_i386.deb
gcj-3.3_3.3.5-3_i386.deb
  to pool/main/g/gcc-3.3/gcj-3.3_3.3.5-3_i386.deb
gij-3.3_3.3.5-3_i386.deb
  to pool/main/g/gcc-3.3/gij-3.3_3.3.5-3_i386.deb
gnat-3.3-doc_3.3.5-3_all.deb
  to pool/main/g/gcc-3.3/gnat-3.3-doc_3.3.5-3_all.deb
gnat-3.3_3.3.5-3_i386.deb
  to pool/main/g/gcc-3.3/gnat-3.3_3.3.5-3_i386.deb
gobjc-3.3_3.3.5-3_i386.deb
  to pool/main/g/gcc-3.3/gobjc-3.3_3.3.5-3_i386.deb
gpc-2.1-3.3-doc_3.3.5.20040516-3_all.deb
  to pool/main/g/gcc-3.3/gpc-2.1-3.3-doc_3.3.5.20040516-3_all.deb
gpc-2.1-3.3_3.3.5.20040516-3_i386.deb
  to pool/main/g/gcc-3.3/gpc-2.1-3.3_3.3.5.20040516-3_i386.deb
libffi2-dev_3.3.5-3_i386.deb
  to pool/main/g/gcc-3.3/libffi2-dev_3.3.5-3_i386.deb
libffi2_3.3.5-3_i386.deb
  to pool/main/g/gcc-3.3/libffi2_3.3.5-3_i386.deb
libg2c0-dev_3.3.5-3_i386.deb
  to pool/main/g/gcc-3.3/libg2c0-dev_3.3.5-3_i386.deb
libg2c0_3.3.5-3_i386.deb
  to pool/main/g/gcc-3.3/libg2c0_3.3.5-3_i386.deb
libgcj-common_3.3.5-3_all.deb
  to pool/main/g/gcc-3.3/libgcj-common_3.3.5-3_all.deb
libgcj4-awt_3.3.5-3_i386.deb
  to pool/main/g/gcc-3.3/libgcj4-awt_3.3.5-3_i386.deb
libgcj4-common_3.3.5-3_all.deb
  to pool/main/g/gcc-3.3/libgcj4-common_3.3.5-3_all.deb
libgcj4-dev_3.3.5-3_i386.deb
  to pool/main/g/gcc-3.3/libgcj4-dev_3.3.5-3_i386.deb
libgcj4_3.3.5-3_i386.deb
  to pool/main/g/gcc-3.3/libgcj4_3.3.5-3_i386.deb
libobjc1_3.3.5-3_i386.deb
  to pool/main/g/gcc-3.3/libobjc1_3.3.5-3_i386.deb
libstdc++5-3.3-dbg_3.3.5-3_i386.deb
  to pool/main/g/gcc-3.3/libstdc++5-3.3-dbg_3.3.5-3_i386.deb
libstdc++5-3.3-dev_3.3.5-3_i386.deb
  to pool/main/g/gcc-3.3/libstdc++5-3.3-dev_3.3.5-3_i386.deb
libstdc++5-3.3-doc_3.3.5-3_all.deb
  to pool/main/g/gcc-3.3/libstdc++5-3.3-doc_3.3.5-3_all.deb
libstdc++5-3.3-pic_3.3.5-3_i386.deb
  to pool/main/g/gcc-3.3/libstdc++5-3.3-pic_3.3.5-3_i386.deb
libstdc++5_3.3.5-3_i386.deb
  to pool/main/g/gcc-3.3/libstdc++5_3.3.5-3_i386.deb
protoize_3.3.5-3_i386.deb
  to pool/main/g/gcc-3.3/protoize_3.3.5-3_i386.deb
treelang-3.3_3.3.5-3_i386.deb
  to pool/main/g/gcc-3.3/treelang-3.3_3.3.5-3_i386.deb



A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 278379@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Matthias Klose <doko@debian.org> (supplier of updated gcc-3.3 package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.7
Date: Tue, 30 Nov 2004 06:59:42 +0100
Source: gcc-3.3
Binary: gcc-3.3-nof gcc-3.3 libobjc1 libgcc1 lib64g2c0 libstdc++5-3.3-doc libgcj4 gpc-2.1-3.3-doc libstdc++5 cpp-3.3-doc protoize gcc-3.3-hppa64 cpp-3.3 libgcj4-awt libstdc++5-3.3-dbg g77-3.3-doc gpc-2.1-3.3 g77-3.3 libgcj4-dev gcc-3.3-doc libgnat-3.15 lib64objc1 lib64ffi2 libstdc++5-3.3-dev libffi2-dev gcj-3.3 libgcj-common gobjc-3.3 lib64stdc++5 gcc-3.3-soft-float lib64gcj4 treelang-3.3 libg2c0-dev lib64gcc1 fastjar lib64gnat3.15 fixincludes libg2c0 gij-3.3 libstdc++5-3.3-pic gcc-3.3-base g++-3.3 gnat-3.3 libffi2 gnat-3.3-doc libgcj4-common
Architecture: source i386 all
Version: 1:3.3.5-3
Distribution: unstable
Urgency: medium
Maintainer: Debian GCC maintainers <debian-gcc@lists.debian.org>
Changed-By: Matthias Klose <doko@debian.org>
Description: 
 cpp-3.3    - The GNU C preprocessor
 cpp-3.3-doc - Documentation for the GNU C preprocessor (cpp)
 fixincludes - Fix non-ANSI header files
 g++-3.3    - The GNU C++ compiler
 g77-3.3    - The GNU Fortran 77 compiler
 g77-3.3-doc - Documentation for the GNU Fortran compiler (g77)
 gcc-3.3    - The GNU C compiler
 gcc-3.3-base - The GNU Compiler Collection (base package)
 gcc-3.3-doc - Documentation for the GNU compilers (gcc, gobjc, g++)
 gcj-3.3    - The GNU compiler for Java(TM)
 gij-3.3    - The GNU Java bytecode interpreter
 gnat-3.3   - The GNU Ada compiler
 gnat-3.3-doc - Documentation for the GNU Ada compiler (gnat)
 gobjc-3.3  - The GNU Objective-C compiler
 gpc-2.1-3.3 - The GNU Pascal compiler
 gpc-2.1-3.3-doc - Documentation for the GNU Pascal compiler (gpc)
 libffi2    - Foreign Function Interface library runtime
 libffi2-dev - Foreign Function Interface library (development files)
 libg2c0    - Runtime library for GNU Fortran 77 applications
 libg2c0-dev - GNU Fortran 77 library development
 libgcj-common - Java runtime library (common files)
 libgcj4    - Java runtime library for use with gcj
 libgcj4-awt - AWT peer runtime libraries for use with gcj
 libgcj4-common - Java runtime library for use with gcj (jar files)
 libgcj4-dev - Java development headers and static library for use with gcj
 libobjc1   - Runtime library for GNU Objective-C applications
 libstdc++5 - The GNU Standard C++ Library v3
 libstdc++5-3.3-dbg - The GNU Standard C++ Library v3 (debugging files)
 libstdc++5-3.3-dev - The GNU Standard C++ Library v3 (development files)
 libstdc++5-3.3-doc - The GNU Standard C++ Library v3 (documentation files)
 libstdc++5-3.3-pic - The GNU Standard C++ Library v3 (shared library subset kit)
 protoize   - Create/remove ANSI prototypes from C code
 treelang-3.3 - The GNU Treelang compiler
Closes: 272673 277833 278379 278835
Changes: 
 gcc-3.3 (1:3.3.5-3) unstable; urgency=medium
 .
   * On ia64-linux, configure using --enable-libunwind-exceptions, add
     ia64-unwind patch by David Mosberger. Closes: #278835.
     Add build dependency on libunwind7-dev (>= 0.98.3-1.1) [ia64],
     add libunwind7-dev dependency on gcc-3.3.
   * Tighten binutils dependency.
   * Fix atomic stdc++ operations are broken on some MIPS machines. Patch
     by Thiemo Seufer. Closes: #278379.
   * Fix example for locale name in docs (closes: #277833).
   * Update to gcc-3_3-branch CVS 20041204.
     - Applies patch to fix PR 14838, ICE on hppa. Closes: #272673.
     - Fix PR 18577, wrong code generation.
Files: 
 6df18bf0dfe302cb0231ee3e442b9be8 2259 devel standard gcc-3.3_3.3.5-3.dsc
 6a6489ab4bc0225a036d393f73d839a1 3522517 devel standard gcc-3.3_3.3.5-3.diff.gz
 9490723e8e9e5ff561bf2d9a39713721 176662 doc optional cpp-3.3-doc_3.3.5-3_all.deb
 79ecafc6388cc95ea2c3ec0646df3d06 1331526 libs optional libgcj4-common_3.3.5-3_all.deb
 ca151c5119107b5f72eee191ef22aa98 1168 libs optional libgcj-common_3.3.5-3_all.deb
 cd2797ee42491b8d31b59e6787bef160 3419672 doc optional libstdc++5-3.3-doc_3.3.5-3_all.deb
 28414145a40230e57d592618d80cb1a9 628568 doc optional g77-3.3-doc_3.3.5-3_all.deb
 55ca8d5e31954dbfee9695be7447e848 707496 doc optional gnat-3.3-doc_3.3.5-3_all.deb
 209e6054616be05f779c9558fa6cd4b2 1204218 doc optional gpc-2.1-3.3-doc_3.3.5.20040516-3_all.deb
 7334985feb8e07b0bb50bff502ad1caf 1336244 doc optional gcc-3.3-doc_3.3.5-3_all.deb
 5cf5d341235e998e43c4c9ede3c31b3b 147892 devel required gcc-3.3-base_3.3.5-3_i386.deb
 300caa6667a5f87079211b4e41cdfe26 1392252 interpreters standard cpp-3.3_3.3.5-3_i386.deb
 fa95c84ccfed018a64b29a43adc3f410 23138 devel optional protoize_3.3.5-3_i386.deb
 62cbf7beb56400bc82d460d94510fc27 74194 devel optional fixincludes_3.3.5-3_i386.deb
 98ee5d2e0e46e038a7cbaea097b340fb 1468906 devel optional gobjc-3.3_3.3.5-3_i386.deb
 8bafad9823d70a0aae271cb438ea7a82 136960 libs optional libobjc1_3.3.5-3_i386.deb
 0102caf3c7c189b19f7bc030ac575765 12978 devel optional gij-3.3_3.3.5-3_i386.deb
 c15b67a0ca8c3ecfd82b5e2592ec24df 2586760 libs optional libgcj4_3.3.5-3_i386.deb
 643c686dc867d6216157893d9dc01d26 62550 libs optional libgcj4-awt_3.3.5-3_i386.deb
 c69dccd82652d9cf1b6844debdf311ec 1736490 devel optional gcj-3.3_3.3.5-3_i386.deb
 d37995364ae1fed6c90cfa0e74963194 4750878 libdevel optional libgcj4-dev_3.3.5-3_i386.deb
 de01cbdcf67340ebc1e79bee852a5498 71748 libs optional libffi2_3.3.5-3_i386.deb
 7a3f28f294fb55ad2fdfac08a5c19b91 11190 libdevel optional libffi2-dev_3.3.5-3_i386.deb
 f53baa57350cff946b3f8da3b2a6a767 1778584 devel standard g++-3.3_3.3.5-3_i386.deb
 75f595a0b62e1076538e3c42fb44f495 293086 base required libstdc++5_3.3.5-3_i386.deb
 9d1ef8548a7d5e89c2a1dce9fe0ec139 774770 libdevel standard libstdc++5-3.3-dev_3.3.5-3_i386.deb
 30e2754e4a991fe9ddb5ff49dc069f89 325354 libdevel extra libstdc++5-3.3-pic_3.3.5-3_i386.deb
 4cbc08582d2e2b0ff3d7cf6af81acddb 4877654 libdevel extra libstdc++5-3.3-dbg_3.3.5-3_i386.deb
 1b77f42547742cef1fd0da307a5bf371 50574 libs optional libg2c0_3.3.5-3_i386.deb
 8852d233988231e726e42e12fa58cbce 1549012 devel optional g77-3.3_3.3.5-3_i386.deb
 fe2d7507f18bc21a5bfdaf560b1ccf96 66604 libdevel optional libg2c0-dev_3.3.5-3_i386.deb
 a9d20fc06e275d52cc5e4b0c42512d92 6215868 devel optional gnat-3.3_3.3.5-3_i386.deb
 294afa3b1e31d7a1f363be48b54aaf2c 1321172 devel optional treelang-3.3_3.3.5-3_i386.deb
 8d0980ce5d269d96732e96de1d5f4147 1938910 devel optional gpc-2.1-3.3_3.3.5.20040516-3_i386.deb
 45a5a24b22b6432b9c5f836b9c87fa89 1566424 devel standard gcc-3.3_3.3.5-3_i386.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (GNU/Linux)

iD8DBQFBstuQStlRaw+TLJwRAjCkAJ0UHKgZVKgVOoKiFEbh8t0CwJ+jUwCfSEz6
Xc9kizBaVAmzvxXTn1J0P8I=
=yde5
-----END PGP SIGNATURE-----



Reply to: