From owner-freebsd-standards@FreeBSD.ORG Sat Jan 26 18:54:35 2013 Return-Path: Delivered-To: freebsd-standards@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 8C428AC0 for ; Sat, 26 Jan 2013 18:54:35 +0000 (UTC) (envelope-from theraven@FreeBSD.org) Received: from theravensnest.org (theraven.freebsd.your.org [216.14.102.27]) by mx1.freebsd.org (Postfix) with ESMTP id 55322B26 for ; Sat, 26 Jan 2013 18:54:31 +0000 (UTC) Received: from [192.168.0.2] (cpc10-cmbg15-2-0-cust123.5-4.cable.virginmedia.com [86.30.246.124]) (authenticated bits=0) by theravensnest.org (8.14.5/8.14.5) with ESMTP id r0QIsRns085503 (version=TLSv1/SSLv3 cipher=DHE-DSS-AES128-SHA bits=128 verify=NO); Sat, 26 Jan 2013 18:54:29 GMT (envelope-from theraven@FreeBSD.org) Subject: Re: standards/175453: Catching C std::bad_cast doesn' t work in FreeBSD 9.1 Mime-Version: 1.0 (Apple Message framework v1278) Content-Type: multipart/signed; boundary="Apple-Mail=_F36252B1-3BAA-4BBD-91C1-36507E8071F2"; protocol="application/pgp-signature"; micalg=pgp-sha1 From: David Chisnall In-Reply-To: <201301261710.r0QHA11J003897@freefall.freebsd.org> Date: Sat, 26 Jan 2013 18:54:21 +0000 Message-Id: <9E117940-356E-4F15-9C9F-CDAEC99B5AE1@FreeBSD.org> References: <201301261710.r0QHA11J003897@freefall.freebsd.org> To: Eitan Adler X-Mailer: Apple Mail (2.1278) Cc: freebsd-standards@FreeBSD.org X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Jan 2013 18:54:35 -0000 --Apple-Mail=_F36252B1-3BAA-4BBD-91C1-36507E8071F2 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii This is more complicated than the test case I have. Simply calling = __cxa_bad_cast() will trigger it. The issue is related to symbol = versioning: libcxxrt and libsupc++ have the wrong symbol version for a = number of C++ classes (mea culpa) and so when the runtime library throws = the exception it throws its version, but everything else is seeing the = other version.=20 David On 26 Jan 2013, at 17:10, Eitan Adler wrote: > The following reply was made to PR standards/175453; it has been noted = by GNATS. >=20 > From: Eitan Adler > To: bug-followup@freebsd.org, hongli@phusion.nl > Cc: =20 > Subject: Re: standards/175453: Catching C std::bad_cast doesn't = work in > FreeBSD 9.1 > Date: Sat, 26 Jan 2013 12:07:14 -0500 >=20 > This bug is probably well understood by now, but here is a minimal > testcase for it (no includes, as few C++ features as possible): >=20 > extern "C++" { > namespace std { > class exception { > const char* name() const { > } > }; > class bad_cast : public exception { > }; > } > } > class foo { > public: virtual ~foo() { > } > }; > class bar: public foo { > public: int val; > bar(): val(123) { > } > }; > static void cast_test(const foo &f) { > try { > const bar &b =3D dynamic_cast(f); > } > catch (const std::bad_cast &) { > } > } > int main() { > foo f; > cast_test(f); > } >=20 >=20 > --=20 > Eitan Adler > _______________________________________________ > freebsd-standards@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-standards > To unsubscribe, send any mail to = "freebsd-standards-unsubscribe@freebsd.org" --Apple-Mail=_F36252B1-3BAA-4BBD-91C1-36507E8071F2 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.18 (Darwin) iQIcBAEBAgAGBQJRBCZdAAoJEKx65DEEsqIdpCcQAIs1t7fnrzLPhoa4bvrtBbUW y9x3sRqhP2nXxFd//SDmMk6zxtIsK/pmzxA5TrBy9fY4qTUnF6riP/LHIbW+kXc0 OkfuKUb0WYPZfrJDNgiwg0zfEIJYEF5MFkHfvNgvp8oCIOxsFS2dupDtnS0f7he5 TnhTBGXZucRg3E1Pmma3dOMk9fbUR4ikgY+UzzhNRJkfwQym+B71irqj2htI0iBg w49qR8NJZ2NcA9D3n9fl9dqXfhM1bW20NJ13vzqCI1U1m5xb+VFzDbctAII4mKDv 5PJG1ulfqJZ5Uq0SyYj8S49+iXMNaStq/iyhFrD4M+b7nZYH8QpYPp8q3NCzgoZ+ mQCrcN44pveanfnVirMLnx+GOE2/ZIC+JGKuEb1SrOoYOGaHLF0NQgacl1KPHf1J oYIirDzOkRvl32Z9N7g32Xmj6dQ5RTk07JbkFrh96T8n7TX3iW+CFkyKnOVGuT2g utqa/xQYHPF+faD63brPUcoAx30mbX8bWn57OHeaRwHjimoKLuuBcpC7E7K+EOhV +Xdp8+mp49VQIAh1Q/aOvWeHJvIY33J2/i/yRDkaSaDjWqMQXANB9cXtfTCck3nR wgDV5GEowPUZYgX6UAzlnDt+znvsd7S7mdYDIME5wkfwz5BZkRwzzruVZLJRuoIB J8hxN2flbCG6R9aDZvT+ =sY+S -----END PGP SIGNATURE----- --Apple-Mail=_F36252B1-3BAA-4BBD-91C1-36507E8071F2--