<html>
<head>
<base href="https://llvm.org/bugs/" />
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW " title="NEW --- - Segmentation fault in clang::Sema::Sema constructor" href="https://urldefense.proofpoint.com/v2/url?u=https-3A__llvm.org_bugs_show-5Fbug.cgi-3Fid-3D24104&d=AwMBaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=pF93YEPyB-J_PERP4DUZOJDzFVX5ZQ57vQk33wu0vio&m=8BHPuPAQoe_ylvAB-AQWmPOz0Vp1HACWn2kWKW6jzTI&s=wpz572vmFTr9mJPb9UG52JcDRb29mNytb4Oc0dHZIWM&e=">24104</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Segmentation fault in clang::Sema::Sema constructor
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>trunk
</td>
</tr>
<tr>
<th>Hardware</th>
<td>Sun
</td>
</tr>
<tr>
<th>OS</th>
<td>Solaris
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>-New Bugs
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>xan@igalia.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvmbugs@cs.uiuc.edu
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>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 (<a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_git_clang.git&d=AwMBaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=pF93YEPyB-J_PERP4DUZOJDzFVX5ZQ57vQk33wu0vio&m=8BHPuPAQoe_ylvAB-AQWmPOz0Vp1HACWn2kWKW6jzTI&s=qC6F-XQy1WefBK9o9g-A818J2YNaMn8vPCzRbACK0g4&e=">http://llvm.org/git/clang.git</a>
e51916fdedd5a1a8ab8e3440e9af9825bbc3b5be)
(<a href="https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_llvm-2Dmirror_llvm.git&d=AwMBaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=pF93YEPyB-J_PERP4DUZOJDzFVX5ZQ57vQk33wu0vio&m=8BHPuPAQoe_ylvAB-AQWmPOz0Vp1HACWn2kWKW6jzTI&s=MRTEqO--x9Sekk6iP3kgmn37J-kdDHdF2s2XU3SGB5k&e=">https://github.com/llvm-mirror/llvm.git</a>
8e7e3650af1076daa6a755dc9b54bc8be6266be5)
Target: sparc-sun-solaris2.11
Thread model: posix
clang-3.7: note: diagnostic msg: PLEASE submit a bug report to
<a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_bugs_&d=AwMBaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=pF93YEPyB-J_PERP4DUZOJDzFVX5ZQ57vQk33wu0vio&m=8BHPuPAQoe_ylvAB-AQWmPOz0Vp1HACWn2kWKW6jzTI&s=c1rkHjRVa8EQQmqvXVuQg8V9Mht_tgqNUWrE37I-PL8&e=">http://llvm.org/bugs/</a> 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));</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>