From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20497 invoked by alias); 10 Aug 2012 10:37:57 -0000 Received: (qmail 20472 invoked by uid 22791); 10 Aug 2012 10:37:56 -0000 X-SWARE-Spam-Status: No, hits=-4.4 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL X-Spam-Check-By: sourceware.org Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 10 Aug 2012 10:37:41 +0000 Received: from svr-orw-exc-10.mgc.mentorg.com ([147.34.98.58]) by relay1.mentorg.com with esmtp id 1Szmb6-0005eM-7U from Yao_Qi@mentor.com ; Fri, 10 Aug 2012 03:37:40 -0700 Received: from SVR-ORW-FEM-03.mgc.mentorg.com ([147.34.97.39]) by SVR-ORW-EXC-10.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.4675); Fri, 10 Aug 2012 03:37:40 -0700 Received: from qiyao.dyndns.org (147.34.91.1) by svr-orw-fem-03.mgc.mentorg.com (147.34.97.39) with Microsoft SMTP Server id 14.1.289.1; Fri, 10 Aug 2012 03:37:35 -0700 From: Yao Qi To: CC: Thomas Schwinge , Subject: Re: Memory corruption for host double format different from target double format Date: Fri, 10 Aug 2012 10:37:00 -0000 Message-ID: <6114731.htKcOdL0z6@qiyao.dyndns.org> User-Agent: KMail/4.8.3 (Linux/3.3.7-1.fc16.i686; KDE/4.8.3; i686; ; ) In-Reply-To: <87ipcrrt16.fsf@schwinge.name> References: <87r4rgrkss.fsf@schwinge.name> <87ipcrrt16.fsf@schwinge.name> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2012-08/txt/msg00030.txt.bz2 On Friday, August 10, 2012 11:32:53 AM Thomas Schwinge wrote: > gdbarch.c:verify_gdbarch: >=20 > [...] > /* Skip verify of float_bit, invalid_p =3D=3D 0 */ > if (gdbarch->float_format =3D=3D 0) > gdbarch->float_format =3D floatformats_ieee_single; > /* Skip verify of double_bit, invalid_p =3D=3D 0 */ > if (gdbarch->double_format =3D=3D 0) > gdbarch->double_format =3D floatformats_ieee_double; > /* Skip verify of long_double_bit, invalid_p =3D=3D 0 */ > if (gdbarch->long_double_format =3D=3D 0) > gdbarch->long_double_format =3D floatformats_ieee_double; > [...] >=20 > That is, if set_gdbarch_double_format has not been called, it will > default to floatformats_ieee_double -- even though set_gdbarch_double_bit > may have been called setting it unequal to the 64-bit double format. > Hmm, and gdbarch.c:verify_gdbarch has the following comment on top of it: > =C2=BBEnsure that all values in a GDBARCH are reasonable.=C2=AB ;-) Looks like some checking like this is missing? gdbarch->float_format->totalsize <=3D gdbarch->float_bit gdbarch->double_format->totalsize <=3D gdbarch->double_bit --=20 Yao (=E9=BD=90=E5=B0=A7)