Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 26 Jan 2013 18:54:21 +0000
From:      David Chisnall <theraven@FreeBSD.org>
To:        Eitan Adler <lists@eitanadler.com>
Cc:        freebsd-standards@FreeBSD.org
Subject:   Re: standards/175453: Catching C std::bad_cast doesn&#39; t work in FreeBSD 9.1
Message-ID:  <9E117940-356E-4F15-9C9F-CDAEC99B5AE1@FreeBSD.org>
In-Reply-To: <201301261710.r0QHA11J003897@freefall.freebsd.org>
References:  <201301261710.r0QHA11J003897@freefall.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help

--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 <lists@eitanadler.com>
> To: bug-followup@freebsd.org, hongli@phusion.nl
> Cc: =20
> Subject: Re: standards/175453: Catching C std::bad_cast doesn&#39;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<const bar &>(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--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?9E117940-356E-4F15-9C9F-CDAEC99B5AE1>