[Bug 45905] New: [lldb][unittest] Assertion failed : (m_replayers.find(RunID) == m_replayers.end())

Bug ID 45905
Summary [lldb][unittest] Assertion failed : (m_replayers.find(RunID) == m_replayers.end())
Product lldb
Version unspecified
Hardware PC
OS Windows NT
Status NEW
Severity enhancement
Priority P
Component All Bugs
Assignee lldb-dev@lists.llvm.org
Reporter sylvain.audi@ubisoft.com
CC alexandre.ganea@ubisoft.com, jdevlieghere@apple.com, llvm-bugs@lists.llvm.org

This happens in the LLDB unit tests, when building under windows.

In lldb\unittests\Utility\ReproducerInstrumentationTest.cpp:
  LLDB_REGISTER_METHOD(void, InstrumentedFoo, Validate, ());
  (...)
  LLDB_REGISTER_METHOD(void, InstrumentedBar, Validate, ());

The clashing IDs are evaluated as follows:
   &invoke<void(InstrumentedFoo::*) 
   ()>::method<(&InstrumentedFoo::Validate)>::record
  and
   &invoke<void(InstrumentedBar::*) 
   ()>::method<(&InstrumentedBar::Validate)>::record

Both "record" implementations are only calling Validate() through the vtable,
so the implementations are identical for both.

The linker does COMDAT folding (option /OPT:ICF), which merges the 2 functions,
so their address, which is used as an ID, end up being identical.

Jonas Devlieghere changed bug 45905