[Beignet] building on Fedora 28, gbe_bin_generater fails

Gerald Baier geraldbaier86 at googlemail.com
Fri May 4 09:44:47 UTC 2018


I'm trying to build the latest Beignet from git on Fedora 28 using gcc 
8.0, but the build fails when calling gbe_bin_generater with the 
following error:

/usr/include/c++/8/bits/stl_vector.h:932: std::vector<_Tp, 
_Alloc>::reference std::vector<_Tp, _Alloc>::operator[](std::vector<_Tp, 
_Alloc>::size_type) [with _Tp = clang::IdentifierInfo*; _Alloc = 
std::allocator<clang::IdentifierInfo*>; std::vector<_Tp, 
_Alloc>::reference = clang::IdentifierInfo*&; std::vector<_Tp, 
_Alloc>::size_type = long unsigned int]: Assertion '__builtin_expect(__n 
< this->size(), true)' failed.

Specifically gbe_bin_generater crashed when executing:

    733     std::unique_ptr<clang::CodeGenAction> Act(new 
clang::EmitLLVMOnlyAction(llvm_ctx));
    734
    735     auto retVal = Clang.ExecuteAction(*Act);

in beignet/backend/src/backend/program.cpp. As far as I can tell the 
source and the build options seem to be passed correctly.

Here's the complete backtrace:

#0  __GI_raise (sig=sig at entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
#1  0x00007fffef4ca591 in __GI_abort () at abort.c:79
#2  0x00007ffff6ed3d28 in std::__replacement_assert 
(__file=__file at entry=0x7ffff6fd2488 
"/usr/include/c++/8/bits/stl_vector.h", __line=__line at entry=932,
     __function=__function at entry=0x7ffff6fd5320 
<std::vector<clang::IdentifierInfo*, 
std::allocator<clang::IdentifierInfo*> >::operator[](unsigned 
long)::__PRETTY_FUNCTION__> "std::vector<_Tp, _Alloc>::reference
std::vector<_Tp, _Alloc>::operator[](std::vector<_Tp, 
_Alloc>::size_type) [with _Tp = clang::IdentifierInfo*; _Alloc = 
std::allocator<clang::IdentifierInfo*>; std::"...,
     __condition=__condition at entry=0x7ffff6fd2458 "__builtin_expect(__n 
< this->size(), true)") at 
/usr/include/c++/8/x86_64-redhat-linux/bits/c++config.h:2389
#3  0x00007ffff6f0f697 in std::vector<clang::IdentifierInfo*, 
std::allocator<clang::IdentifierInfo*> >::operator[] (__n=4294950511, 
this=0x6ea348)
     at /usr/lib64/llvm5.0/../../include/llvm5.0/llvm/ADT/StringMap.h:104
#4  clang::ASTReader::DecodeIdentifierInfo (this=this at entry=0x6e9410, 
ID=4294950511) at 
/usr/src/debug/clang5.0-5.0.1-3.fc28.x86_64/lib/Serialization/ASTReader.cpp:8112 

#5  0x00007ffff6f20ddb in clang::ASTReader::GetIdentifierInfo 
(Idx=@0x7fffffffbbb0: 81, Record=..., M=..., this=0x6e9410)
     at 
/usr/src/debug/clang5.0-5.0.1-3.fc28.x86_64/include/clang/Serialization/ASTReader.h:1968
#6 
clang::ASTReader::ReadNestedNameSpecifierLoc(clang::serialization::ModuleFile&, 
llvm::SmallVector<unsigned long, 64u> const&, unsigned int&) ()
     at 
/usr/src/debug/clang5.0-5.0.1-3.fc28.x86_64/lib/Serialization/ASTReader.cpp:8745
#7  0x00007ffff6f212dd in clang::ASTReader::ReadQualifierInfo 
(this=0x6e9410, F=..., Info=..., Record=..., Idx=@0x7fffffffbbb0: 81)
     at 
/usr/src/debug/clang5.0-5.0.1-3.fc28.x86_64/lib/Serialization/ASTReader.cpp:8429
#8  0x00007ffff6f3cc7a in clang::ASTRecordReader::readQualifierInfo 
(Info=..., this=0x0) at 
/usr/src/debug/clang5.0-5.0.1-3.fc28.x86_64/include/clang/Serialization/ASTReader.h:2442 

#9  clang::ASTDeclReader::ReadQualifierInfo (this=0x7fffffffbb50, 
Info=...) at 
/usr/src/debug/clang5.0-5.0.1-3.fc28.x86_64/lib/Serialization/ASTReaderDecl.cpp:103 

#10 clang::ASTDeclReader::VisitDeclaratorDecl (this=0x7fffffffbb50, 
DD=0x70aee8) at 
/usr/src/debug/clang5.0-5.0.1-3.fc28.x86_64/lib/Serialization/ASTReaderDecl.cpp:764 

#11 0x00007ffff6f49ad7 in 
clang::ASTDeclReader::VisitFunctionDecl(clang::FunctionDecl*) () at 
/usr/src/debug/clang5.0-5.0.1-3.fc28.x86_64/lib/Serialization/ASTReaderDecl.cpp:771 

#12 0x00007ffff6f50e95 in 
clang::declvisitor::Base<clang::declvisitor::make_ptr, 
clang::ASTDeclReader, void>::Visit (D=0x70aee8, this=0x7fffffffbb50)
     at 
/usr/src/debug/clang5.0-5.0.1-3.fc28.x86_64/lib/Serialization/ASTReaderDecl.cpp:333
#13 clang::ASTDeclReader::Visit (this=this at entry=0x7fffffffbb50, 
D=D at entry=0x70aee8) at 
/usr/src/debug/clang5.0-5.0.1-3.fc28.x86_64/lib/Serialization/ASTReaderDecl.cpp:468 

#14 0x00007ffff6f51470 in clang::ASTReader::ReadDeclRecord(unsigned int) 
() at 
/usr/src/debug/clang5.0-5.0.1-3.fc28.x86_64/lib/Serialization/ASTReaderDecl.cpp:3623 

#15 0x00007ffff6f05d35 in clang::ASTReader::GetDecl (this=0x6e9410, 
ID=7750) at 
/usr/src/debug/clang5.0-5.0.1-3.fc28.x86_64/lib/Serialization/ASTReader.cpp:7102 

#16 0x00007ffff6f0a91f in clang::ASTReader::InitializeSema 
(this=0x6e9410, S=...) at 
/usr/src/debug/clang5.0-5.0.1-3.fc28.x86_64/lib/Serialization/ASTReader.cpp:7521 

#17 0x00007ffff5cdd7e5 in clang::Sema::Initialize() () at 
/usr/src/debug/clang5.0-5.0.1-3.fc28.x86_64/lib/Sema/Sema.cpp:280
#18 0x00007ffff4430a58 in clang::Parser::Initialize 
(this=this at entry=0x6e6ad0) at 
/usr/src/debug/clang5.0-5.0.1-3.fc28.x86_64/lib/Parse/Parser.cpp:515
#19 0x00007ffff4380791 in clang::ParseAST(clang::Sema&, bool, bool) () 
at /usr/src/debug/clang5.0-5.0.1-3.fc28.x86_64/lib/Parse/ParseAST.cpp:139
#20 0x00007ffff675596a in clang::CodeGenAction::ExecuteAction() () at 
/usr/src/debug/clang5.0-5.0.1-3.fc28.x86_64/lib/CodeGen/CodeGenAction.cpp:992 

#21 0x00007ffff72df386 in clang::FrontendAction::Execute() () at 
/usr/src/debug/clang5.0-5.0.1-3.fc28.x86_64/lib/Frontend/FrontendAction.cpp:902 

#22 0x00007ffff729c816 in 
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) () at 
/usr/src/debug/clang5.0-5.0.1-3.fc28.x86_64/lib/Frontend/CompilerInstance.cpp:980 

#23 0x00007ffff7a137b0 in gbe::buildModuleFromSource (
     source=0x7ffff7fe9000 "kernel void __cl_copy_region_align4 ( global 
float* src, unsigned int src_offset,\n", ' ' <repeats 37 times>, "global 
float* dst, unsigned int dst_offset,\n\t\t\t\t     unsigned int 
size)\n{\n    int"..., out_module=0x7fffffffcbd0, llvm_ctx=0x6c6b30, 
dumpLLVMFileName="", dumpSPIRBinaryName="", options=..., stringSize=0, 
err=0x0, errSize=0x0, oclVersion=120)
     at /home/gerald/packages/beignet/backend/src/backend/program.cpp:735
#24 0x00007ffff7a0cc73 in gbe::programCompileFromSource (deviceID=0, 
source=<optimized out>, temp_header_path=<optimized out>, 
stringSize=<optimized out>, options=<optimized out>, err=<optimized out>,
     errSize=<optimized out>) at 
/home/gerald/packages/beignet/backend/src/backend/program.cpp:1163
#25 0x00000000004032c8 in program_build_instance::build_program 
(this=0x6c6850) at 
/home/gerald/packages/beignet/backend/src/gbe_bin_generater.cpp:280
#26 0x0000000000404218 in main (argc=<optimized out>, argv=<optimized 
out>) at /home/gerald/packages/beignet/backend/src/gbe_bin_generater.cpp:429

I'd be grateful for any hint on what the problem might be.

Cheers,
Gerald


More information about the Beignet mailing list