Closed Bug 1215679 Opened 7 years ago Closed 7 years ago

Disable AddressSanitizer ODR checking for cppunittests


(Core :: WebRTC: Networking, defect)

Not set



Tracking Status
firefox44 --- fixed


(Reporter: ehsan.akhgari, Unassigned)


(Blocks 1 open bug)



(1 file, 1 obsolete file)

10:46:25     INFO -  TEST-START | TestSyncRunnable
10:46:25     INFO -  PROCESS | 2292 |
10:46:25     INFO -  =================================================================
10:46:25     INFO -  ==2292==ERROR: AddressSanitizer: odr-violation (0x00000148ac40):
10:46:25     INFO -    [1] size=142 'SSL_ImplementedCiphers' sslenum.c:49:16
10:46:25     INFO -    [2] size=142 'SSL_ImplementedCiphers' sslenum.c:49:16
10:46:25     INFO -  These globals were registered at these points:
10:46:25     INFO -    [1]:
10:46:25     INFO -      #0 0x434c83 in __asan_register_globals /builds/slave/moz-toolchain/src/llvm/projects/compiler-rt/lib/asan/
10:46:25     INFO -      #1 0x994deb in asan.module_ctor (/builds/slave/test/build/tests/cppunittest/TestSyncRunnable+0x994deb)
10:46:25     INFO -    [2]:
10:46:25     INFO -      #0 0x434c83 in __asan_register_globals /builds/slave/moz-toolchain/src/llvm/projects/compiler-rt/lib/asan/
10:46:25     INFO -      #1 0x7f46fea64a6b in asan.module_ctor (/builds/slave/test/build/application/firefox/
10:46:25     INFO -  ==2292==HINT: if you don't care about these warnings you may set ASAN_OPTIONS=detect_odr_violation=0
10:46:25     INFO -  SUMMARY: AddressSanitizer: odr-violation: global 'SSL_ImplementedCiphers' at sslenum.c:49:16
10:46:25     INFO -  ==2292==ABORTING
10:46:25  WARNING -  TEST-UNEXPECTED-FAIL | TestSyncRunnable | test failed with return code 1

And many other tests.
The easiest fix here would be to set ASAN_OPTIONS=detect_odr_violation=0 as it suggests, at least for these test functions.
Both declarations, for SSL_ImplementedCiphers, are the same. From the part about where the globals were registered, I'm guessing that this file is getting linked into both and the object file for the specific tests. I'm also seeing this in CPP unit tests for WebRTC stuff, so the issue may not be in NSS per se.
Glandium, do you think there's something easy that can be done here? It doesn't really seem like a big deal, so I could just disable this check for CPP unit tests if needed.
Flags: needinfo?(mh+mozilla)
These failures are all under media/mtransport.

It looks like ekr added this back in bug 1022812.

ekr do you have an opinion on having this vs. doing ODR ("One definition rule"[1]) violation checking in ASan C++ unit tests?

Assignee: nobody → nobody
Component: Libraries → WebRTC: Networking
Flags: needinfo?(ekr)
Product: NSS → Core
Version: trunk → Trunk
I recall adding the static linkage.  Would it be a terrible thing to add another guard on that static linkage?   That way developers (i.e., ekr and myself probably) can statically link NSS if they need to debug NSS, but most builds would just rely on dynamic linkage.
Depends on: 1216721
I'm just going to disable ODR violation checking for now. If somebody wants to figure out what to do with the mtransport tests and enable it later, that's fine with me. The disable leaks thing is needed because we are overriding the default settings.

Attachment #8676993 - Flags: review?(mh+mozilla)
Oops, I meant to ask a testing person for a review here.

Anyways, it is unfortunate to disable some testing, but we are clearly not doing this at all right now, so we're still getting more coverage, over all.
Attachment #8676997 - Flags: review?(jmaher)
Attachment #8676993 - Attachment is obsolete: true
Attachment #8676993 - Flags: review?(mh+mozilla)
Comment on attachment 8676997 [details] [diff] [review]
Ignore ODR violations in ASan CPP unit tests.

Review of attachment 8676997 [details] [diff] [review]:

Attachment #8676997 - Flags: review?(jmaher) → review+
Summary: AddressSanitizer: odr-violation: global 'SSL_ImplementedCiphers' at sslenum.c:49:16 with clang 3.7 on Linux → Disable AddressSanitizer ODR checking for cppunittests
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla44
Flags: needinfo?(ekr)
You need to log in before you can comment on or make changes to this bug.