From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25666 invoked by alias); 16 Jun 2002 09:56:04 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 25621 invoked by uid 71); 16 Jun 2002 09:56:02 -0000 Resent-Date: 16 Jun 2002 09:56:02 -0000 Resent-Message-ID: <20020616095602.25620.qmail@sources.redhat.com> Resent-From: gcc-gnats@gcc.gnu.org (GNATS Filer) Resent-To: nobody@gcc.gnu.org Resent-Cc: gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org Resent-Reply-To: gcc-gnats@gcc.gnu.org, wuerkner@gmx.de Received: (qmail 22234 invoked by uid 61); 16 Jun 2002 09:49:30 -0000 Message-Id: <20020616094930.22233.qmail@sources.redhat.com> Date: Sun, 16 Jun 2002 06:46:00 -0000 From: wuerkner@gmx.de Reply-To: wuerkner@gmx.de To: gcc-gnats@gcc.gnu.org X-Send-Pr-Version: gnatsweb-2.9.3 (1.1.1.1.2.31) Subject: c++/7046: wrong template instantiation within #pragma pack(1) context X-SW-Source: 2002-06/txt/msg00353.txt.bz2 List-Id: >Number: 7046 >Category: c++ >Synopsis: wrong template instantiation within #pragma pack(1) context >Confidential: no >Severity: serious >Priority: medium >Responsible: unassigned >State: open >Class: wrong-code >Submitter-Id: net >Arrival-Date: Sun Jun 16 02:56:01 PDT 2002 >Closed-Date: >Last-Modified: >Originator: Frank Würkner >Release: gcc 2.95.3 >Organization: >Environment: SuSE Linux 7.3 (Kernel 2.4.18) >Description: templates that are instantiated within a #pragma pack(1) context, generate code as if they where defined with #pragma pack(1). The result is, that one can create instantiations (in other compile units) that place class member variables on different memory locations for the SAME template arguments. Thus leeding to obvious data corruption when accessing them from different compile units. >How-To-Repeat: Unpack Attachment. cd gcc_bug ./run.sh (compiles and runs example) >Fix: template instantiations should respect the #pragma pack-state of their definition. The current state when beeing instantiated should be irrelevant. >Release-Note: >Audit-Trail: >Unformatted: ----gnatsweb-attachment---- Content-Type: application/x-gzip; name="gcc_bug.tar.gz" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="gcc_bug.tar.gz" H4sIAHtZDD0AA+2X32/aMBDHecV/xSmVKli14IQkSA1FqrY9IE1s0njYGwrBBGsQR8HR6Cr+99oh oVBo6Uvoqt7nxYl/3Fl2vrm7KAxH4yxq1SqEUod2XFe1OU/bzXPHpW3qeE6nU6OWZXluDdwqN1WS LWWQAtRSIeRL806Nv1Oi4v4XAY/NMEmq8EEtSj3Hefb+265X3n/b81S/ZXtU3T+tYjNP+eD3f8Hj cJ5NGHS5WMqUBYseIdtOQ8gZS82ZQQiPJeiPpNEk96Qu2VJC4JN6KDIJ3S4YS/6PiWlDDzSBxxCK RcLnDLKYbxbqrwvg5gYMPT8w9YLRuNHUbyyezF9tbLMnba00FjE5UpvPQtWolbs2ST1lMktjoD5Z k7c+7f+PUv/FRVfi46T+bXerf+paWv9OG/V/FiRbJPNAsu5YiDkMe7DREWjpjcpBrXit/5V1bfvF o50/bl5yKQdKdvdQqK0Q8Cc548umD+udeeMX562VZOVdwiZsur+HrtoX6+V9agpbSaaWa6MH4vdR 5q+n1H+axeayGvnn+u8c6n6rf9uySv07ltXW+rc9D/V/DqKrq52Auo3Tl5dgtgJTxWPCwpkAwyja v1zOgK2SOQ9VKOaxOr1Y8kByEV8bRFv7/PXb75/f+1/6w1F/8Gt4Oxj2b4f9H4MTbt76ID4o+/G/ mgLgVPx3PHsb/11P139ttQD1fw6OpPqPJYEKqzyO8oJgqgPycWGTVgumfAXju2d+DKSM4cciuk8u VKbOp8pJkgbRIoAkCP80rCYpMpGpEHsVx9GY/5hRFIWFykZ0OqHziT27zU0lc2BAu1CeYOVvK4aV eSS1wBoCQRAEQRAEQRAEQRAEQRAEeQ88AE36bb8AKAAA