Clang 7.1.0 crashing in emitMultiVersionFunctions

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Clang 7.1.0 crashing in emitMultiVersionFunctions

Nathan Ridge via cfe-dev

Hi Everyone,

 

Anyone knows if this is a known bug that has been fixed?

 

Crash occurs with my clang 7.1.0 build but not with the trunk builds at (wandbox, godbolt):

 

Test case:

 

#include <nmmintrin.h>
 
class Foo {
   __attribute__((target("default"))) void lexString() { }
 
   __attribute__((target("sse4.2"))) void lexString() {
      static const char whitespaces[16] = " \t\r\n";
      const __m128i w = _mm_loadu_si128((__m128i *)whitespaces);
   }
};

 

Stack trace:

#0  0x00002aaaabedd495 in raise () from /lib64/libc.so.6

#1  0x00002aaaabedec75 in abort () from /lib64/libc.so.6

#2  0x00002aaaac25093d in uw_update_context_1 (context=context@entry=0x3bcb6d0, fs=fs@entry=0x3bcb7c0)

    at ../../../src/gcc-6.2.0/libgcc/unwind-dw2.c:1426

#3  0x00002aaaac250c91 in uw_update_context (context=context@entry=0x3bcb6d0, fs=fs@entry=0x3bcb7c0)

    at ../../../src/gcc-6.2.0/libgcc/unwind-dw2.c:1502

#4  0x00002aaaac2513ed in _Unwind_Backtrace (trace=0x2aaaabfa9a30 <backtrace_helper>, trace_argument=0x3bcb980)

    at ../../../src/gcc-6.2.0/libgcc/unwind.inc:303

#5  0x00002aaaabfa9bc6 in backtrace () from /lib64/libc.so.6

#6  0x0000000001271b0d in PrintStackTraceSignalHandler(void*) ()

#7  0x000000000126fa3e in llvm::sys::RunSignalHandlers() ()

#8  0x0000000001271c82 in SignalHandler(int) ()

#9  <signal handler called>

#10 0x0000000000eb4850 in llvm::Value::getName() const ()

#11 0x000000000147c3f0 in clang::CodeGen::CodeGenModule::emitMultiVersionFunctions() ()

#12 0x000000000147b789 in clang::CodeGen::CodeGenModule::Release() ()

#13 0x0000000001b165e4 in (anonymous namespace)::CodeGeneratorImpl::HandleTranslationUnit(clang::ASTContext&) ()

#14 0x0000000001b13c58 in clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&) ()

#15 0x0000000002288cf5 in clang::ParseAST(clang::Sema&, bool, bool) ()

#16 0x000000000181d48c in clang::FrontendAction::Execute() ()

#17 0x00000000017cbc58 in clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) ()

#18 0x00000000018adbc9 in clang::ExecuteCompilerInvocation(clang::CompilerInstance*) ()

#19 0x00000000007b9ae7 in cc1_main(llvm::ArrayRef<char const*>, char const*, void*) ()

#20 0x00000000007b7c67 in main ()

 

The crash goes away if static const char whitespaces[16] is changed to const char whitespaces[16] by removing the static keyword.

 

/Riyaz

 


_______________________________________________
cfe-dev mailing list
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: Clang 7.1.0 crashing in emitMultiVersionFunctions

Nathan Ridge via cfe-dev

I don’t remember explicitly fixing this problem, however it does not appear to still exist (at least in trunk).  I will note that between the 7 and 8 release I did quite a bit of refactoring in that function, so I might have just fixed it along the way.  I don’t see the problem either on Godbolt for 7.0.0, 8.0.0, or trunk, and don’t have a 7.1.0 build available.

 

So I guess my guess is that it probably has been fixed?

 

From: cfe-dev [mailto:[hidden email]] On Behalf Of Riyaz Puthiyapurayil via cfe-dev
Sent: Tuesday, June 11, 2019 12:23 PM
To: [hidden email]
Subject: [cfe-dev] Clang 7.1.0 crashing in emitMultiVersionFunctions

 

Hi Everyone,

 

Anyone knows if this is a known bug that has been fixed?

 

Crash occurs with my clang 7.1.0 build but not with the trunk builds at (wandbox, godbolt):

 

Test case:

 

#include <nmmintrin.h>
 
class Foo {
   __attribute__((target("default"))) void lexString() { }
 
   __attribute__((target("sse4.2"))) void lexString() {
      static const char whitespaces[16] = " \t\r\n";
      const __m128i w = _mm_loadu_si128((__m128i *)whitespaces);
   }
};

 

Stack trace:

#0  0x00002aaaabedd495 in raise () from /lib64/libc.so.6

#1  0x00002aaaabedec75 in abort () from /lib64/libc.so.6

#2  0x00002aaaac25093d in uw_update_context_1 (context=context@entry=0x3bcb6d0, fs=fs@entry=0x3bcb7c0)

    at ../../../src/gcc-6.2.0/libgcc/unwind-dw2.c:1426

#3  0x00002aaaac250c91 in uw_update_context (context=context@entry=0x3bcb6d0, fs=fs@entry=0x3bcb7c0)

    at ../../../src/gcc-6.2.0/libgcc/unwind-dw2.c:1502

#4  0x00002aaaac2513ed in _Unwind_Backtrace (trace=0x2aaaabfa9a30 <backtrace_helper>, trace_argument=0x3bcb980)

    at ../../../src/gcc-6.2.0/libgcc/unwind.inc:303

#5  0x00002aaaabfa9bc6 in backtrace () from /lib64/libc.so.6

#6  0x0000000001271b0d in PrintStackTraceSignalHandler(void*) ()

#7  0x000000000126fa3e in llvm::sys::RunSignalHandlers() ()

#8  0x0000000001271c82 in SignalHandler(int) ()

#9  <signal handler called>

#10 0x0000000000eb4850 in llvm::Value::getName() const ()

#11 0x000000000147c3f0 in clang::CodeGen::CodeGenModule::emitMultiVersionFunctions() ()

#12 0x000000000147b789 in clang::CodeGen::CodeGenModule::Release() ()

#13 0x0000000001b165e4 in (anonymous namespace)::CodeGeneratorImpl::HandleTranslationUnit(clang::ASTContext&) ()

#14 0x0000000001b13c58 in clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&) ()

#15 0x0000000002288cf5 in clang::ParseAST(clang::Sema&, bool, bool) ()

#16 0x000000000181d48c in clang::FrontendAction::Execute() ()

#17 0x00000000017cbc58 in clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) ()

#18 0x00000000018adbc9 in clang::ExecuteCompilerInvocation(clang::CompilerInstance*) ()

#19 0x00000000007b9ae7 in cc1_main(llvm::ArrayRef<char const*>, char const*, void*) ()

#20 0x00000000007b7c67 in main ()

 

The crash goes away if static const char whitespaces[16] is changed to const char whitespaces[16] by removing the static keyword.

 

/Riyaz

 


_______________________________________________
cfe-dev mailing list
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev