This is the mail archive of the gcc-prs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

c++/7046: wrong template instantiation within #pragma pack(1) context


>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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]