[LLVMbugs] [Bug 24104] New: Segmentation fault in clang::Sema::Sema constructor

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Jul 13 07:14:16 PDT 2015


https://llvm.org/bugs/show_bug.cgi?id=24104

            Bug ID: 24104
           Summary: Segmentation fault in clang::Sema::Sema constructor
           Product: clang
           Version: trunk
          Hardware: Sun
                OS: Solaris
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: xan at igalia.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Happens simply by running the clang binary, or any of the clang unit tests.
Trace:

0  clang-3.7 0x04bece90 llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 76
1  clang-3.7 0x04bed2a0 PrintStackTraceSignalHandler(void*) + 24
2  clang-3.7 0x04bebb1c SignalHandler(int) + 648
3  libc.so.1 0xed9d7c8c __sighndlr + 12
4  libc.so.1 0xed9caffc call_user_handler + 880
5  libc.so.1 0xed9cb304 sigacthandler + 88
6  clang-3.7 0x066bc00c clang::Sema::Sema(clang::Preprocessor&,
clang::ASTContext&, clang::ASTConsumer&, clang::TranslationUnitKind,
clang::CodeCompleteConsumer*) + 2836
7  clang-3.7 0x052c4158
clang::CompilerInstance::createSema(clang::TranslationUnitKind,
clang::CodeCompleteConsumer*) + 116
8  clang-3.7 0x053158d4 clang::ASTFrontendAction::ExecuteAction() + 360
9  clang-3.7 0x05796df0 clang::CodeGenAction::ExecuteAction() + 1772
10 clang-3.7 0x05315180 clang::FrontendAction::Execute() + 164
11 clang-3.7 0x052c6620
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 1268
12 clang-3.7 0x0546c300
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 1464
13 clang-3.7 0x02eb1fc0 cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) + 1040
14 clang-3.7 0x02ea66a8 ExecuteCC1Tool(llvm::ArrayRef<char const*>,
llvm::StringRef) + 236
15 clang-3.7 0x02ea6d5c main + 1312
16 clang-3.7 0x02ea457c _start + 92
Stack dump:
0.    Program arguments: /export/home/igalia/llvm/build/bin/clang-3.7 -cc1
-triple sparc-sun-solaris2.11 -emit-obj -mrelax-all -disable-free
-main-file-name error.cpp -mrelocation-model static -mthread-model posix
-mdisable-fp-elim -fmath-errno -masm-verbose -mconstructor-aliases
-dwarf-column-info -resource-dir
/export/home/igalia/llvm/build/bin/../lib/clang/3.7.0 -fdeprecated-macro
-fdebug-compilation-dir /export/home/igalia/llvm/build -ferror-limit 19
-fmessage-length 149 -mstackrealign -fobjc-runtime=gcc -fcxx-exceptions
-fexceptions -fdiagnostics-show-option -fcolor-diagnostics -o
/var/tmp/error-a12800.o -x c++ /export/home/igalia/error.cpp 
clang-3.7: error: unable to execute command: Bus Error (core dumped)
clang-3.7: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 3.7.0 (http://llvm.org/git/clang.git
e51916fdedd5a1a8ab8e3440e9af9825bbc3b5be)
(https://github.com/llvm-mirror/llvm.git
8e7e3650af1076daa6a755dc9b54bc8be6266be5)
Target: sparc-sun-solaris2.11
Thread model: posix
clang-3.7: note: diagnostic msg: PLEASE submit a bug report to
http://llvm.org/bugs/ and include the crash backtrace, preprocessed source, and
associated run script.
clang-3.7: note: diagnostic msg: Error generating preprocessed source(s).

The following patch "fixes" it, but it's obviosuly only a workaround. I guess
it points to an underlying bug in either std::forward or the template <typename
... Args> feature, since those are the only differences compared to the
.push_back method:

diff --git a/lib/Sema/Sema.cpp b/lib/Sema/Sema.cpp
index 18d7e9d..5d54de6 100644
--- a/lib/Sema/Sema.cpp
+++ b/lib/Sema/Sema.cpp
@@ -124,7 +124,7 @@ Sema::Sema(Preprocessor &pp, ASTContext &ctxt, ASTConsumer
&consumer,
   PP.getDiagnostics().SetArgToStringFn(&FormatASTNodeDiagnosticArgument,
                                        &Context);

-  ExprEvalContexts.emplace_back(PotentiallyEvaluated, 0, false, nullptr,
false);
+ 
ExprEvalContexts.push_back(ExpressionEvaluationContextRecord(PotentiallyEvaluated,
0, false, nullptr, false));

   FunctionScopes.push_back(new FunctionScopeInfo(Diags));

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20150713/d9200947/attachment.html>


More information about the llvm-bugs mailing list