public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug sanitizer/64330] New: [ASAN] Bogus "AddressSanitizer: odr-violation"
@ 2014-12-16 12:34 burnus at gcc dot gnu.org
  2014-12-16 12:45 ` [Bug sanitizer/64330] " trippels at gcc dot gnu.org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: burnus at gcc dot gnu.org @ 2014-12-16 12:34 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64330

            Bug ID: 64330
           Summary: [ASAN] Bogus "AddressSanitizer: odr-violation"
           Product: gcc
           Version: 5.0
            Status: UNCONFIRMED
          Keywords: diagnostic
          Severity: normal
          Priority: P3
         Component: sanitizer
          Assignee: unassigned at gcc dot gnu.org
          Reporter: burnus at gcc dot gnu.org
                CC: dodji at gcc dot gnu.org, dvyukov at gcc dot gnu.org,
                    jakub at gcc dot gnu.org, kcc at gcc dot gnu.org,
                    mpolacek at gcc dot gnu.org

I have in a C++ header file ("foo.h"):

class Foo {
 public:
  static const unsigned short   AlignRight;
  static const unsigned short   AlignBottom;
  ...
};

And in its C++ file (foo.cc):

const unsigned short    Foo::AlignRight = 2;
const unsigned short    Foo::AlignTop  = 1;
const unsigned short    Foo::AlignBottom = 2;


I fail to see a reason why that's a violation of the One Definition Rule (ORD),
but ASAN fails with:

==9056==ERROR: AddressSanitizer: odr-violation (0x000004b4dbc0):
  [1] size=2 'AlignRight' foo.cc:23:22
  [2] size=2 'AlignBottom' foo.cc:25:22
These globals were registered at these points:
  [1]:
    #0 0x4daa56 in __asan_register_globals
../../../../libsanitizer/asan/asan_globals.cc:217
    #1 0x4b0c6ac in __libc_csu_init (foo+0x4b0c6ac)
    #2 0x3761c1ecef in __libc_start_main (/lib64/libc.so.6+0x3761c1ecef)


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2014-12-18 13:32 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-12-16 12:34 [Bug sanitizer/64330] New: [ASAN] Bogus "AddressSanitizer: odr-violation" burnus at gcc dot gnu.org
2014-12-16 12:45 ` [Bug sanitizer/64330] " trippels at gcc dot gnu.org
2014-12-16 13:43 ` jakub at gcc dot gnu.org
2014-12-16 14:02 ` [Bug tree-optimization/64330] [5 Regression] IPA-ICF merges const exported vars that could be addressable in other TUs jakub at gcc dot gnu.org
2014-12-16 18:01 ` kcc at gcc dot gnu.org
2014-12-16 18:09 ` jakub at gcc dot gnu.org
2014-12-17 14:30 ` y.gribov at samsung dot com
2014-12-17 16:49 ` hubicka at gcc dot gnu.org
2014-12-17 19:08 ` hubicka at ucw dot cz
2014-12-18 13:32 ` marxin at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).