RFR: 8209758: 2 classes with same name G1PrintCollectionSetClosure cause crash when logging is enabled
Thomas Schatzl
thomas.schatzl at oracle.com
Wed Aug 22 09:32:53 UTC 2018
Hi,
On Tue, 2018-08-21 at 12:06 -0400, Kim Barrett wrote:
> > On Aug 21, 2018, at 4:27 AM, Thomas Schatzl <thomas.schatzl at oracle.
> > com> wrote:
> >
> > Hi,
> >
> > On Mon, 2018-08-20 at 15:25 -0700, Leonid Mesnik wrote:
> > > Hi
> > >
[...]
> > > I think it would be enough just to rename one of classes to avoid
> > > confusion.
> >
> > Although I think this is a clang compiler bug, let's rename it…
>
> This is an ODR violation, which is UB and no diagnostic required.
> I think there’s a gcc compiler/linker option to check for such, but
> we’re not turning it on. Use of anonymous namespaces to limit the
> scope of such “local” classes would also avoid such problems, but
> there are apparently other problems with those.
I tried to enable -Wodr for some test builds but it did not warn in
this case - apparently it needs lto enabled too which we apparently do
not either.
Thanks,
Thome
More information about the hotspot-gc-dev
mailing list