<html>
<head>
<base href="http://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 --- - assertion "GlobalAlias should not have a section!""
href="http://llvm.org/bugs/show_bug.cgi?id=19653">19653</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>assertion "GlobalAlias should not have a section!"
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>trunk
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>All
</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>LLVM Codegen
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>nlewycky@google.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>An asserts build of clang fires an assert building tcmalloc. Testcase:
extern "C" {
void tc_free() { }
void tc_cfree() __attribute__((section("test")));
void tc_cfree() __attribute__((alias("tc_free")));
}
LLVM has an assert that you aren't calling setSection on a GlobalAlias.
(gdb) run
Starting program: /usr/local/google/home/nlewycky/llvm/Debug+Asserts/bin/clang
-cc1 a.cc -emit-llvm-only
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/grte/v3/lib64/libthread_db.so.1".
clang: /usr/local/google/home/nlewycky/llvm/include/llvm/IR/GlobalValue.h:115:
void llvm::GlobalValue::setSection(llvm::StringRef): Assertion `(getValueID()
!= Value::GlobalAliasVal || S.empty()) && "GlobalAlias should not have a
section!"' failed.
Program received signal SIGABRT, Aborted.
0x00007ffff6ced425 in __GI_raise (sig=<optimized out>) at
../nptl/sysdeps/unix/sysv/linux/raise.c:64
64 ../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt
#0 0x00007ffff6ced425 in __GI_raise (sig=<optimized out>) at
../nptl/sysdeps/unix/sysv/linux/raise.c:64
#1 0x00007ffff6cf0b8b in __GI_abort () at abort.c:91
#2 0x00007ffff6ce60ee in __assert_fail_base (fmt=<optimized out>,
assertion=0x3bd1238 "(getValueID() != Value::GlobalAliasVal || S.empty()) &&
\"GlobalAlias should not have a section!\"",
file=0x3bd11f0
"/usr/local/google/home/nlewycky/llvm/include/llvm/IR/GlobalValue.h",
line=<optimized out>, function=<optimized out>) at assert.c:94
#3 0x00007ffff6ce6192 in __GI___assert_fail (assertion=0x3bd1238
"(getValueID() != Value::GlobalAliasVal || S.empty()) && \"GlobalAlias should
not have a section!\"",
file=0x3bd11f0
"/usr/local/google/home/nlewycky/llvm/include/llvm/IR/GlobalValue.h", line=115,
function=0x3bd8cc0
<llvm::GlobalValue::setSection(llvm::StringRef)::__PRETTY_FUNCTION__> "void
llvm::GlobalValue::setSection(llvm::StringRef)") at assert.c:103
#4 0x0000000001327d24 in llvm::GlobalValue::setSection (this=0x61b2588, S=...)
at /usr/local/google/home/nlewycky/llvm/include/llvm/IR/GlobalValue.h:114
#5 0x000000000132c35a in clang::CodeGen::CodeGenModule::SetCommonAttributes
(this=0x61aafa0, D=0x61bfd10, GV=0x61b2588) at CodeGenModule.cpp:715
#6 0x0000000001331df0 in clang::CodeGen::CodeGenModule::EmitAliasDefinition
(this=0x61aafa0, GD=...) at CodeGenModule.cpp:2316
#7 0x000000000132e1f1 in clang::CodeGen::CodeGenModule::EmitGlobal
(this=0x61aafa0, GD=...) at CodeGenModule.cpp:1149
#8 0x0000000001334fa8 in clang::CodeGen::CodeGenModule::EmitTopLevelDecl
(this=0x61aafa0, D=0x61bfd10) at CodeGenModule.cpp:3015
#9 0x0000000001334e5b in clang::CodeGen::CodeGenModule::EmitLinkageSpec
(this=0x61aafa0, LSD=0x61754e0) at CodeGenModule.cpp:2996
#10 0x0000000001335465 in clang::CodeGen::CodeGenModule::EmitTopLevelDecl
(this=0x61aafa0, D=0x61754e0) at CodeGenModule.cpp:3119
#11 0x00000000012abfe8 in (anonymous
namespace)::CodeGeneratorImpl::HandleTopLevelDecl (this=0x6175b90, DG=...) at
ModuleBuilder.cpp:80
#12 0x00000000012a8222 in clang::BackendConsumer::HandleTopLevelDecl
(this=0x61759d0, D=...) at CodeGenAction.cpp:99
#13 0x000000000150aa55 in clang::ParseAST (S=..., PrintStats=false,
SkipFunctionBodies=false) at ParseAST.cpp:143
#14 0x00000000010119de in clang::ASTFrontendAction::ExecuteAction
(this=0x61440e0) at FrontendAction.cpp:487
#15 0x00000000012aa34c in clang::CodeGenAction::ExecuteAction (this=0x61440e0)
at CodeGenAction.cpp:611
#16 0x0000000001011513 in clang::FrontendAction::Execute (this=0x61440e0) at
FrontendAction.cpp:388
#17 0x0000000000fdf670 in clang::CompilerInstance::ExecuteAction
(this=0x6143360, Act=...) at CompilerInstance.cpp:727
#18 0x0000000000fa6800 in clang::ExecuteCompilerInvocation (Clang=0x6143360) at
ExecuteCompilerInvocation.cpp:239
#19 0x0000000000f94e3d in cc1_main (ArgBegin=0x7fffffffdd38,
ArgEnd=0x7fffffffdd48, Argv0=0x7fffffffeb71
"/usr/local/google/home/nlewycky/llvm/Debug+Asserts/bin/clang",
MainAddr=0xf9fefe <GetExecutablePath(char const*, bool)>) at
cc1_main.cpp:112
#20 0x0000000000fa13df in main (argc_=4, argv_=0x7fffffffe8f8) at
driver.cpp:319
(gdb)</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>