Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 13 May 2018 05:46:04 +0000
From:      bugzilla-noreply@freebsd.org
To:        x11@FreeBSD.org
Subject:   [Bug 220767] lang/beignet: hangs if consumer is not linked against libpthread after jemalloc 5.0.0 update
Message-ID:  <bug-220767-7141-Y0Q7pNX7vX@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-220767-7141@https.bugs.freebsd.org/bugzilla/>
References:  <bug-220767-7141@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D220767

--- Comment #7 from Jan Beich <jbeich@FreeBSD.org> ---
(In reply to Jason Evans from comment #6)
Some facts:
- libpthread-stubs is an alias to -pthread since ports r437182
- beignet doesn't use libpthread-stubs
- mesa-libs uses libpthread-stubs
- beignet optionally uses mesa-libs for cl_khr_gl_sharing
- libcl (from beignet) is already linked against libpthread
- ocl-icd uses dlopen() to pull libcl
- clinfo isn't linked against libpthread

After disabling beignet -> mesa-libs dependency clinfo crashes if not passe=
d=20
LD_PRELOAD=3D/lib/libthr.so.3:

$ clinfo
Number of platforms                               1
  Platform Name                                   Intel Gen OCL Driver
  Platform Vendor                                 Intel
  Platform Version                                OpenCL 2.0 beignet 1.3
  Platform Profile                                FULL_PROFILE
  Platform Extensions=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20
cl_khr_global_int32_base_atomics cl_khr_global_int32_extended_atomics
cl_khr_local_int32_base_atomics cl_khr_local_int32_extended_atomics
cl_khr_byte_addressable_store cl_khr_3d_image_writes cl_khr_image2d_from_bu=
ffer
cl_khr_depth_images cl_khr_spir cl_khr_icd cl_intel_accelerator
cl_intel_subgroups cl_intel_subgroups_short
  Platform Extensions function suffix             Intel
[New LWP 101911 of process 86314]

Thread 1 received signal SIGSEGV, Segmentation fault.
0x0000000802463650 in clang::CodeGen::LValue::MakeAddr(clang::CodeGen::Addr=
ess,
clang::QualType, clang::ASTContext&, clang::CodeGen::LValueBaseInfo,
clang::CodeGen::TBAAAccessInfo) () from /usr/local/lib/beignet//libgbe.so
(gdb) backtrace
#0  0x0000000802463650 in
clang::CodeGen::LValue::MakeAddr(clang::CodeGen::Address, clang::QualType,
clang::ASTContext&, clang::CodeGen::LValueBaseInfo,
clang::CodeGen::TBAAAccessInfo) () from /usr/local/lib/beignet//libgbe.so
#1  0x0000000802482287 in
clang::CodeGen::CodeGenFunction::EmitDeclRefLValue(clang::DeclRefExpr const=
*)
()
   from /usr/local/lib/beignet//libgbe.so
#2  0x0000000802477b79 in
clang::CodeGen::CodeGenFunction::EmitLValue(clang::Expr const*) ()
   from /usr/local/lib/beignet//libgbe.so
#3  0x000000080247fc13 in
clang::CodeGen::CodeGenFunction::EmitCheckedLValue(clang::Expr const*,
clang::CodeGen::CodeGenFunction::TypeCheckKind) () from
/usr/local/lib/beignet//libgbe.so
#4  0x0000000802519c36 in clang::StmtVisitorBase<clang::make_ptr, (anonymous
namespace)::ScalarExprEmitter, llvm::Value*>::Visit(clang::Stmt*) () from
/usr/local/lib/beignet//libgbe.so
#5  0x00000008025205fa in (anonymous
namespace)::ScalarExprEmitter::VisitCastExpr(clang::CastExpr*) ()
   from /usr/local/lib/beignet//libgbe.so
#6  0x0000000802510258 in
clang::CodeGen::CodeGenFunction::EmitScalarExpr(clang::Expr const*, bool) ()
   from /usr/local/lib/beignet//libgbe.so
#7  0x000000080247f015 in
clang::CodeGen::CodeGenFunction::EmitPointerWithAlignment(clang::Expr const=
*,
clang::CodeGen::LValueBaseInfo*, clang::CodeGen::TBAAAccessInfo*) () from
/usr/local/lib/beignet//libgbe.so
#8  0x0000000802480352 in
clang::CodeGen::CodeGenFunction::EmitArraySubscriptExpr(clang::ArraySubscri=
ptExpr
const*, bool) () from /usr/local/lib/beignet//libgbe.so
#9  0x0000000802477c51 in
clang::CodeGen::CodeGenFunction::EmitLValue(clang::Expr const*) ()
   from /usr/local/lib/beignet//libgbe.so
#10 0x000000080247fc13 in
clang::CodeGen::CodeGenFunction::EmitCheckedLValue(clang::Expr const*,
clang::CodeGen::CodeGenFunction::TypeCheckKind) () from
/usr/local/lib/beignet//libgbe.so
#11 0x0000000802519c36 in clang::StmtVisitorBase<clang::make_ptr, (anonymous
namespace)::ScalarExprEmitter, llvm::Value*>::Visit(clang::Stmt*) () from
/usr/local/lib/beignet//libgbe.so
#12 0x00000008025205fa in (anonymous
namespace)::ScalarExprEmitter::VisitCastExpr(clang::CastExpr*) ()
   from /usr/local/lib/beignet//libgbe.so
#13 0x0000000802515f57 in clang::StmtVisitorBase<clang::make_ptr, (anonymous
namespace)::ScalarExprEmitter, llvm::Value*>::Visit(clang::Stmt*) () from
/usr/local/lib/beignet//libgbe.so
#14 0x0000000802510258 in
clang::CodeGen::CodeGenFunction::EmitScalarExpr(clang::Expr const*, bool) ()
   from /usr/local/lib/beignet//libgbe.so
#15 0x0000000802477572 in
clang::CodeGen::CodeGenFunction::EmitAnyExpr(clang::Expr const*,
clang::CodeGen::AggValueSlot, bool) () from /usr/local/lib/beignet//libgbe.=
so
#16 0x0000000802477524 in
clang::CodeGen::CodeGenFunction::EmitIgnoredExpr(clang::Expr const*) ()
   from /usr/local/lib/beignet//libgbe.so
#17 0x00000008024c07b1 in clang::CodeGen::CodeGenFunction::EmitStmt(clang::=
Stmt
const*, llvm::ArrayRef<clang::Attr const*>) () from
/usr/local/lib/beignet//libgbe.so
#18 0x00000008024c933f in
clang::CodeGen::CodeGenFunction::EmitCompoundStmtWithoutScope(clang::Compou=
ndStmt
const&, bool, clang::CodeGen::AggValueSlot) () from
/usr/local/lib/beignet//libgbe.so
#19 0x00000008026085d5 in
clang::CodeGen::CodeGenFunction::GenerateCode(clang::GlobalDecl,
llvm::Function*, clang::CodeGen::CGFunctionInfo const&) () from
/usr/local/lib/beignet//libgbe.so
#20 0x000000080261db9c in
clang::CodeGen::CodeGenModule::EmitGlobalFunctionDefinition(clang::GlobalDe=
cl,
llvm::GlobalValue*) () from /usr/local/lib/beignet//libgbe.so
#21 0x0000000802617c64 in
clang::CodeGen::CodeGenModule::EmitGlobalDefinition(clang::GlobalDecl,
llvm::GlobalValue*) () from /usr/local/lib/beignet//libgbe.so
#22 0x0000000802620852 in
clang::CodeGen::CodeGenModule::EmitTopLevelDecl(clang::Decl*) ()
   from /usr/local/lib/beignet//libgbe.so
#23 0x00000008026f1d3f in (anonymous
namespace)::CodeGeneratorImpl::HandleTopLevelDecl(clang::DeclGroupRef) ()
   from /usr/local/lib/beignet//libgbe.so
#24 0x000000080243956a in
clang::BackendConsumer::HandleTopLevelDecl(clang::DeclGroupRef) ()
   from /usr/local/lib/beignet//libgbe.so
#25 0x000000080303ac22 in clang::ParseAST(clang::Sema&, bool, bool) () from
/usr/local/lib/beignet//libgbe.so
#26 0x000000080212f969 in clang::FrontendAction::Execute() () from
/usr/local/lib/beignet//libgbe.so
#27 0x00000008020e6ec1 in
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) ()
   from /usr/local/lib/beignet//libgbe.so
#28 0x0000000801c84381 in gbe::buildModuleFromSource (
    source=3D0x8013392a0 "__kernel void self_test(__global int *buf) {  __l=
ocal
int tmp[3];  tmp[get_local_id(0)] =3D buf[get_local_id(0)];=20
barrier(CLK_LOCAL_MEM_FENCE);  buf[get_global_id(0)] =3D tmp[2 - get_local_=
id(0)]
+ buf[g"..., out_module=3D0x7fffffffda70, llvm_ctx=3D0x800257440,
dumpLLVMFileName=3D..., dumpSPIRBinaryName=3D..., options=3D...,
    stringSize=3D1048576, err=3D0x8078435c0 "", errSize=3D0x801339288,
oclVersion=3D120)
    at backend/src/backend/program.cpp:735
#29 0x0000000801c7035d in gbe::programNewFromSource (deviceID=3D6418,
    source=3D0x8013392a0 "__kernel void self_test(__global int *buf) {  __l=
ocal
int tmp[3];  tmp[get_local_id(0)] =3D buf[get_local_id(0)];=20
barrier(CLK_LOCAL_MEM_FENCE);  buf[get_global_id(0)] =3D tmp[2 - get_local_=
id(0)]
+ buf[g"..., stringSize=3D1048576, options=3D0x8008addaa "", err=3D0x807843=
5c0 "",
errSize=3D0x801339288)
    at backend/src/backend/program.cpp:1058
#30 0x00000008008d2b77 in cl_program_build (p=3D0x8013391c0, options=3D0x80=
08addaa
"") at src/cl_program.c:597
#31 0x00000008008c2cdd in clBuildProgram (program=3D0x8013391c0, num_device=
s=3D1,
device_list=3D0x7fffffffe040,
    options=3D0x8008addaa "", pfn_notify=3D0x0, user_data=3D0x0) at src/cl_=
api.c:835
#32 0x00000008008e85d4 in cl_self_test (device=3D0x800945218
<intel_skl_gt2_device>,
    atomic_in_l3_flag=3DSELF_TEST_PASS) at src/cl_device_id.c:900
#33 0x00000008008e885e in cl_get_device_ids (platform=3D0x800941238
<intel_platform_data>, device_type=3D4294967295,
    num_entries=3D0, devices=3D0x0, num_devices=3D0x8033dbeb0) at
src/cl_device_id.c:955
#34 0x00000008008c6093 in clGetDeviceIDs (platform=3D0x800941238
<intel_platform_data>, device_type=3D4294967295,
    num_entries=3D0, devices=3D0x0, num_devices=3D0x8033dbeb0) at
src/cl_api_device_id.c:43
#35 0x000000080025fada in clGetDeviceIDs_hid () from
/usr/local/lib/libOpenCL.so.1
#36 0x0000000000207071 in printPlatformInfo (p=3D0) at src/clinfo.c:459
#37 0x000000000020f0ed in main (argc=3D1, argv=3D0x7fffffffe278) at
src/clinfo.c:2676

Sorry, I didn't build devel/llvm* with debug symbols this time.

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-220767-7141-Y0Q7pNX7vX>