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

Bug#222377: marked as done (g++-2.95 incorrectly handles in64_t type with optimizing)



Your message dated Sat, 6 Dec 2003 12:00:26 +0100
with message-id <16337.46794.158475.437202@gargle.gargle.HOWL>
and subject line fixed in default g++ in sarge/unstable
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; 28 Nov 2003 10:35:49 +0000
>From a.khlebnikau@sam-solutions.net Fri Nov 28 04:35:39 2003
Return-path: <a.khlebnikau@sam-solutions.net>
Received: from mail.sam-solutions.net (mail.belcaf.minsk.by) [217.21.35.41] 
	by master.debian.org with esmtp (Exim 3.35 1 (Debian))
	id 1APfyM-00046i-00; Fri, 28 Nov 2003 04:35:38 -0600
Received: from pc166.sam-solutions.net ([192.168.111.195]) by
          mail.belcaf.minsk.by (MTA 4.15) with ESMTP id HP25FB00.K88 for
          <submit@bugs.debian.org>; Fri, 28 Nov 2003 12:35:35 +0200 
Received: from localhost
	([127.0.0.1] helo=pc166 ident=khlebnikov)
	by pc166.sam-solutions.net with smtp (Exim 3.35 #1 (Debian))
	id 1APfy4-0000PW-00
	for <submit@bugs.debian.org>; Fri, 28 Nov 2003 12:35:20 +0200
Date: Fri, 28 Nov 2003 12:35:20 +0200
From: Alexei Khlebnikov <a.khlebnikau@sam-solutions.net>
To: submit@bugs.debian.org
Subject: g++-2.95 incorrectly handles in64_t type with optimizing
Message-Id: <20031128123520.24887c49.a.khlebnikau@sam-solutions.net>
Organization: sam-solutions
X-Mailer: Sylpheed version 0.7.4 (GTK+ 1.2.10; i386-debian-linux-gnu)
Mime-Version: 1.0
Content-Type: multipart/mixed;
 boundary="Multipart_Fri__28_Nov_2003_12:35:20_+0200_08286568"
Delivered-To: submit@bugs.debian.org
X-Spam-Checker-Version: SpamAssassin 
	2.60-master.debian.org_2003_11_25-bugs.debian.org_2003_11_20 
	(1.212-2003-09-23-exp) on master.debian.org
X-Spam-Status: No, hits=-5.0 required=4.0 tests=HAS_PACKAGE autolearn=no 
	version=2.60-master.debian.org_2003_11_25-bugs.debian.org_2003_11_20
X-Spam-Level: 

This is a multi-part message in MIME format.

--Multipart_Fri__28_Nov_2003_12:35:20_+0200_08286568
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit

Package: g++-2.95
Version: 1:2.95.4-19

When combine working with int32 and int64, not all operations performed
correctly.

Here is code example
=begin
#include <stdint.h>
#include <stdio.h>
#include <iostream>


int main()
{
        const long int offset = 1025;

	FILE* F = fopen("samplefile", "r");
	fseek(F, offset, SEEK_SET);
        const int64_t num2 = ftell(F);

	std::cerr << num2 / 1024 << ", must be 1\n";

	fclose(F);
	return 0;
}
=end

Here is a script, showing incorrect behaviour:
=begin
#!/bin/sh

CXX=g++-2.95

dd if=/dev/zero of=samplefile bs=2K count=1
rm -f ./int64
$CXX -v
$CXX -O3 -o ./int64 int64.cpp
./int64
=end

The script's output:
=begin
1+0 records in
1+0 records out
2048 bytes transferred in 0.007738 seconds (264668 bytes/sec)
Reading specs from /usr/lib/gcc-lib/i386-linux/2.95.4/specs
gcc version 2.95.4 20011002 (Debian prerelease)
2, must be 1
=end

The bug is reproduceable at least on Pentium 1 and Pentium 4 debian machines.
I've tried this testcase on Alt Linux Master 2.0 with g++ 2.95.3,
the bug is not reproduceable there. Seems like it is debian-specific bug.

When not optimizing, the bug is not triggered, and the lasy line is printed as
"1, must be 1".

When using g++-3.0, g++-3.2 or g++-3.3 with optimizing, the last line
is also printed correctly.

gcc-2.95 package probably also has this bug. A bug might be also in libstdc++.

I attach to this mail the source and the script.

I am using Debian GNU/Linux 3.0r0 packages mixed with packages from testing (sarge) tree.

$uname -a
Linux hostname 2.4.20-debianpatches-freeswan-lowlatency #1 Mon Nov 17 12:54:29 EET 2003 i686 GNU/Linux
As you see, I am also patched the kernel with freeswan and low latency patches.

I am using libc6 version 2.3.2.ds1-10 from testing.

--Multipart_Fri__28_Nov_2003_12:35:20_+0200_08286568
Content-Type: application/octet-stream;
 name="int64-bug.tar.gz"
Content-Disposition: attachment;
 filename="int64-bug.tar.gz"
Content-Transfer-Encoding: base64

H4sIANofxz8CA+3VT2/aMBQA8Fzxp3jLdoAViB3sRCuklwmkqZN26A49TKpI4kBEYiPH4bBp330O
BTqk/TlsVNr0fhcnfnZs6fk5pbIRH6XtKvAuhlJOYyFcS1ks6PftkUfjOGIRi2MWeZRNolh4ILxn
0DZ2aQC8zbqSqSo3evfjcb+L/6PKU/73T+Nsu/37+WeURpz/NP+cT475FyLs8i8mnHpAMf8X97JU
WdXmEmaNzd0RGK9vyHmfPu8qdWONXNY3hBA3HuplqfoD8oXAQaZVY6HSagVdXBdFIy0kwGgopoT0
Fu/ez1/DwvUUeitV32+W9baSRVlJfwi+8QdT0nNz5Ka/GB6mD+FuPr99uJt/dMHzhfbH9sGCauuw
+6aVVdVfDLqV3O6vrzNpDMxmj/Gg2wXvXt1StUs9pBLYJ+V3w4us0o3cz+0ZaVujgE7JV+L9z57q
37TqUve/q/9f3f8hZaf7n/Ou/jlnAuv/Wer/RZCWKmjWhLy9v09WV1ejcPxGEJLnUBZJkMtd8Fka
7QoxeSpUSJskvHUV2CqbMGJqGBUwfvyFkFfuQzDaHdoPExjpYwxOPxlyHO0hhBBCCCGEEEIIIYQQ
QgghhBBC6E99A++hut4AKAAA

--Multipart_Fri__28_Nov_2003_12:35:20_+0200_08286568--

---------------------------------------
Received: (at 222377-done) by bugs.debian.org; 6 Dec 2003 11:50:01 +0000
>From doko@cs.tu-berlin.de Sat Dec 06 05:50:00 2003
Return-path: <doko@cs.tu-berlin.de>
Received: from mail.cs.tu-berlin.de [130.149.17.13] 
	by master.debian.org with esmtp (Exim 3.35 1 (Debian))
	id 1ASaF5-0005ce-00; Sat, 06 Dec 2003 05:04:56 -0600
Received: from bolero.cs.tu-berlin.de (doko@bolero.cs.tu-berlin.de [130.149.19.1])
	by mail.cs.tu-berlin.de (8.9.3p2/8.9.3) with ESMTP id MAA03497
	for <222377-done@bugs.debian.org>; Sat, 6 Dec 2003 12:00:26 +0100 (MET)
Received: (from doko@localhost)
	by bolero.cs.tu-berlin.de (8.12.10+Sun/8.12.8/Submit) id hB6B0Qrh025240;
	Sat, 6 Dec 2003 12:00:26 +0100 (MET)
From: Matthias Klose <doko@cs.tu-berlin.de>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Message-ID: <16337.46794.158475.437202@gargle.gargle.HOWL>
Date: Sat, 6 Dec 2003 12:00:26 +0100
To: 222377-done@bugs.debian.org
Subject: fixed in default g++ in sarge/unstable
X-Mailer: VM 7.03 under 21.4 (patch 6) "Common Lisp" XEmacs Lucid
Delivered-To: 222377-done@bugs.debian.org
X-Spam-Checker-Version: SpamAssassin 
	2.60-master.debian.org_2003_11_25-bugs.debian.org_2003_11_20 
	(1.212-2003-09-23-exp) on master.debian.org
X-Spam-Status: No, hits=1.0 required=4.0 tests=BAYES_99 autolearn=no 
	version=2.60-master.debian.org_2003_11_25-bugs.debian.org_2003_11_20
X-Spam-Level: *

closing this report, as it is fixed upstream.  if you need g++-2.95,
then pleae use -O0 as a workaround.



Reply to: