Skip to content

Clang crash with -fsanitize=hwaddress -flto=thin -ffat-lto-objects #105569

Open
@pirama-arumuga-nainar

Description

@pirama-arumuga-nainar

The crash is caused when using -ffat-lto-objects together with -fsanitize=hwaddress.

$ cat test.c
int main(int argc, char* argv[])
{ (void)argv; return argc-1;}
$ clang  -c test.c -fsanitize=hwaddress -flto=thin
// no crash

$ clang -c test.c -fsanitize=hwaddress -flto=thin -ffat-lto-objects
clang: /usr/local/google/work/llvm-monorepo/llvm-project/clang/lib/CodeGen/CodeGenAction.cpp:897: void clang::BackendConsumer::DiagnosticHandlerImpl(const DiagnosticInfo &): Assertion `CurLinkModule && "CurLinkM
odule must be set for linker diagnostics"' failed.                                                                                                                                                                 
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace, preprocessed source, and associated run script.                            
Stack dump:                                                                                                                                                                                                        
0.      Program arguments: ../release/bin/clang -c test.c -fsanitize=hwaddress -flto=thin -ffat-lto-objects                                                              
1.      <eof> parser at end of file                                                                                                                                                                                
2.      Optimizer                                                                                                                                                                                                  3.      Running pass "hwasan<>" on module "test.c" 

Metadata

Metadata

Assignees

No one assigned

    Labels

    LTOLink time optimization (regular/full LTO or ThinLTO)clang:codegenIR generation bugs: mangling, exceptions, etc.compiler-rt:hwasanHardware-assisted address sanitizer

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions