Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 16 Jul 2017 15:18:53 +0000
From:      bugzilla-noreply@freebsd.org
To:        x11@FreeBSD.org
Subject:   maintainer-feedback requested: [Bug 220767] lang/beignet: hangs if not linked against libpthread after jemalloc 5.0.0 update
Message-ID:  <bug-220767-7141-tIuqckL03R@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
Jan Beich <jbeich@FreeBSD.org> has reassigned Bugzilla Automation
<bugzilla@FreeBSD.org>'s request for maintainer-feedback to x11@FreeBSD.org:
Bug 220767: lang/beignet: hangs if not linked against libpthread after jema=
lloc
5.0.0 update
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D220767



--- Description ---
After base r319971 some applications not already linked against threading
library started to hang in [umtxn] state. It affects at least Beignet. Howe=
ver,
bisecting jemalloc as part of libc requires 8 steps of rebasing
FreeBSD-specific changes.

Maybe someone can suggest more apps to try that can trigger the issue.

$ pkg install clinfo beignet # requires bug 217635
$ LD_PRELOAD=3D/lib/libthr.so.3 clinfo # works fine
$ gdb clinfo
(gdb) r
Starting program: /usr/local/bin/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=09=09=09=09=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 cl_khr_gl_sharing
  Platform Extensions function suffix		  Intel
[New LWP 102018 of process 60317]
^C
Thread 1 received signal SIGINT, Interrupt.
_umtx_op_err () at /usr/src/lib/libthr/arch/amd64/amd64/_umtx_op_err.S:37
37	RSYSCALL_ERR(_umtx_op)
(gdb) bt
#0  _umtx_op_err () at /usr/src/lib/libthr/arch/amd64/amd64/_umtx_op_err.S:=
37
#1  0x0000000803c579e4 in __thr_umutex_lock (mtx=3D0x803e7dc78
<_mutex_static_lock>, id=3D101914)
    at /usr/src/lib/libthr/thread/thr_umtx.c:80
#2  0x0000000803c61acc in _thr_umutex_lock (mtx=3D0x803e7dc78
<_mutex_static_lock>, id=3D101914)
    at /usr/src/lib/libthr/thread/thr_umtx.h:123
#3  0x0000000803c619b4 in init_static (thread=3D0x80068b000, mutex=3D0x8013=
48e50)
    at /usr/src/lib/libthr/thread/thr_mutex.c:304
#4  0x0000000803c602f8 in check_and_init_mutex (mutex=3D0x801348e50,
m=3D0x7fffffff2de0)
    at /usr/src/lib/libthr/thread/thr_mutex.c:598
#5  0x0000000803c5f689 in __pthread_mutex_trylock (mutex=3D0x801348e50)
    at /usr/src/lib/libthr/thread/thr_mutex.c:614
#6  0x0000000800d656b9 in malloc_mutex_trylock_final (mutex=3D0x801348e10)
    at /usr/src/contrib/jemalloc/include/jemalloc/internal/mutex.h:144
#7  0x0000000800d59602 in malloc_mutex_lock (tsdn=3D0x80063c088,
mutex=3D0x801348e10)
    at /usr/src/contrib/jemalloc/include/jemalloc/internal/mutex.h:202
#8  0x0000000800d5b6b8 in __je_arena_tcache_fill_small (tsdn=3D0x80063c088,
arena=3D0x801344980,
    tcache=3D0x80063c240, tbin=3D0x80063c2e0, binind=3D6, prof_accumbytes=
=3D0) at
jemalloc_arena.c:1433
#9  0x0000000800cd7013 in __je_tcache_alloc_small_hard (tsdn=3D0x80063c088,
arena=3D0x801344980,
    tcache=3D0x80063c240, tbin=3D0x80063c2e0, binind=3D6,
tcache_success=3D0x7fffffff53f6)
    at jemalloc_tcache.c:93
#10 0x0000000800d8ea3e in tcache_alloc_small (tsd=3D0x80063c088,
arena=3D0x801344980,
    tcache=3D0x80063c240, size=3D96, binind=3D6, zero=3Dtrue, slow_path=3Df=
alse)
    at /usr/src/contrib/jemalloc/include/jemalloc/internal/tcache_inlines.h=
:86
#11 arena_malloc (tsdn=3D0x80063c088, arena=3D0x0, size=3D96, ind=3D6, zero=
=3Dtrue,
tcache=3D0x80063c240,
    slow_path=3Dfalse) at
/usr/src/contrib/jemalloc/include/jemalloc/internal/arena_inlines_b.h:101
#12 iallocztm (tsdn=3D0x80063c088, size=3D96, ind=3D6, zero=3Dtrue, tcache=
=3D0x80063c240,
is_internal=3Dfalse,
    arena=3D0x0, slow_path=3Dfalse)
    at
/usr/src/contrib/jemalloc/include/jemalloc/internal/jemalloc_internal_inlin=
es_c
.h:33
#13 imalloc_no_sample (sopts=3D0x7fffffff5300, dopts=3D0x7fffffff52d0,
tsd=3D0x80063c088, size=3D96,
    usize=3D96, ind=3D6) at jemalloc_jemalloc.c:1654
#14 imalloc_body (sopts=3D0x7fffffff5300, dopts=3D0x7fffffff52d0, tsd=3D0x8=
0063c088)
    at jemalloc_jemalloc.c:1850
#15 imalloc (sopts=3D0x7fffffff5300, dopts=3D0x7fffffff52d0) at
jemalloc_jemalloc.c:1950
#16 __calloc (num=3D1, size=3D96) at jemalloc_jemalloc.c:2064
#17 0x0000000803c5fc0e in mutex_init (mutex=3D0x801348e50,
    mutex_attr=3D0x803e72758 <_pthread_mutexattr_default>, calloc_cb=3D0x80=
0d8bea0
<__calloc>)
    at /usr/src/lib/libthr/thread/thr_mutex.c:292
#18 0x0000000803c619dc in init_static (thread=3D0x80068b000, mutex=3D0x8013=
48e50)
    at /usr/src/lib/libthr/thread/thr_mutex.c:307
#19 0x0000000803c602f8 in check_and_init_mutex (mutex=3D0x801348e50,
m=3D0x7fffffff60d0)
    at /usr/src/lib/libthr/thread/thr_mutex.c:598
#20 0x0000000803c5f689 in __pthread_mutex_trylock (mutex=3D0x801348e50)
    at /usr/src/lib/libthr/thread/thr_mutex.c:614
#21 0x0000000800d656b9 in malloc_mutex_trylock_final (mutex=3D0x801348e10)
    at /usr/src/contrib/jemalloc/include/jemalloc/internal/mutex.h:144
#22 0x0000000800d59602 in malloc_mutex_lock (tsdn=3D0x80063c088,
mutex=3D0x801348e10)
    at /usr/src/contrib/jemalloc/include/jemalloc/internal/mutex.h:202
#23 0x0000000800d5b6b8 in __je_arena_tcache_fill_small (tsdn=3D0x80063c088,
arena=3D0x801344980,
    tcache=3D0x80063c240, tbin=3D0x80063c2e0, binind=3D6, prof_accumbytes=
=3D0) at
jemalloc_arena.c:1433
#24 0x0000000800cd7013 in __je_tcache_alloc_small_hard (tsdn=3D0x80063c088,
arena=3D0x801344980,
    tcache=3D0x80063c240, tbin=3D0x80063c2e0, binind=3D6,
tcache_success=3D0x7fffffff86d6)
    at jemalloc_tcache.c:93
#25 0x0000000800d72886 in tcache_alloc_small (tsd=3D0x80063c088,
arena=3D0x801344980,
    tcache=3D0x80063c240, size=3D88, binind=3D6, zero=3Dfalse, slow_path=3D=
false)
    at /usr/src/contrib/jemalloc/include/jemalloc/internal/tcache_inlines.h=
:86
#26 arena_malloc (tsdn=3D0x80063c088, arena=3D0x0, size=3D88, ind=3D6, zero=
=3Dfalse,
tcache=3D0x80063c240,
    slow_path=3Dfalse) at
/usr/src/contrib/jemalloc/include/jemalloc/internal/arena_inlines_b.h:101
#27 iallocztm (tsdn=3D0x80063c088, size=3D88, ind=3D6, zero=3Dfalse,
tcache=3D0x80063c240, is_internal=3Dfalse,
    arena=3D0x0, slow_path=3Dfalse)
    at
/usr/src/contrib/jemalloc/include/jemalloc/internal/jemalloc_internal_inlin=
es_c
.h:33
#28 imalloc_no_sample (sopts=3D0x7fffffff85e0, dopts=3D0x7fffffff85b0,
tsd=3D0x80063c088, size=3D88,
    usize=3D96, ind=3D6) at jemalloc_jemalloc.c:1654
#29 imalloc_body (sopts=3D0x7fffffff85e0, dopts=3D0x7fffffff85b0, tsd=3D0x8=
0063c088)
    at jemalloc_jemalloc.c:1850
#30 imalloc (sopts=3D0x7fffffff85e0, dopts=3D0x7fffffff85b0) at
jemalloc_jemalloc.c:1950
#31 __malloc (size=3D88) at jemalloc_jemalloc.c:1981
#32 0x00000008033b81a8 in operator new (size=3D88) at
/usr/src/contrib/libc++/src/new.cpp:70
#33 0x000000080803aa89 in llvm::User::operator new(unsigned long, unsigned =
int)
()
   from /usr/local/lib/beignet//libgbe.so
#34 0x0000000806ea6b34 in
clang::CodeGen::CodeGenFunction::StartFunction(clang::GlobalDecl,
clang::QualType, llvm::Function*, clang::CodeGen::CGFunctionInfo const&,
clang::CodeGen::FunctionArgList const&, clang::SourceLocation,
clang::SourceLocation) () from /usr/local/lib/beignet//libgbe.so
#35 0x0000000806ea8551 in
clang::CodeGen::CodeGenFunction::GenerateCode(clang::GlobalDecl,
llvm::Function*, clang::CodeGen::CGFunctionInfo const&) () from
/usr/local/lib/beignet//libgbe.so
#36 0x0000000806eba8d9 in
clang::CodeGen::CodeGenModule::EmitGlobalFunctionDefinition(clang::GlobalDe=
cl,
llvm::GlobalValue*) () from /usr/local/lib/beignet//libgbe.so
#37 0x0000000806eb6774 in
clang::CodeGen::CodeGenModule::EmitGlobalDefinition(clang::GlobalDecl,
llvm::GlobalValue*) () from /usr/local/lib/beignet//libgbe.so
#38 0x0000000806ebc322 in
clang::CodeGen::CodeGenModule::EmitTopLevelDecl(clang::Decl*) ()
   from /usr/local/lib/beignet//libgbe.so
#39 0x0000000806e3c82f in (anonymous
namespace)::CodeGeneratorImpl::HandleTopLevelDecl(clang::DeclGroupRef) () f=
rom
/usr/local/lib/beignet//libgbe.so
#40 0x0000000806e2fb85 in
clang::BackendConsumer::HandleTopLevelDecl(clang::DeclGroupRef) ()
   from /usr/local/lib/beignet//libgbe.so
#41 0x00000008077d0462 in clang::ParseAST(clang::Sema&, bool, bool) ()
   from /usr/local/lib/beignet//libgbe.so
#42 0x0000000806bdc2b9 in clang::FrontendAction::Execute() () from
/usr/local/lib/beignet//libgbe.so
#43 0x0000000806ba2cf1 in
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) ()
   from /usr/local/lib/beignet//libgbe.so
 std::__1::basic_string<char, std::__1::char_traits<char>,
std::__1::allocator<char> >, std::__1::basic_string<char,
std::__1::char_traits<char>, std::__1::allocator<char> >,
std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>,
std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<cha=
r,
std::__1::char_traits<char>, std::__1::allocator<char> > > >&, unsigned lon=
g,
char*, unsigned long*, unsigned int) () from /usr/local/lib/beignet//libgbe=
.so
#45 0x00000008067848b3 in gbe::programNewFromSource(unsigned int, char cons=
t*,
unsigned long, char const*, char*, unsigned long*) () from
/usr/local/lib/beignet//libgbe.so
#46 0x00000008019617c7 in cl_program_build (p=3D0x8006cd1c0, options=3D0x80=
1992f4d
"")
    at src/cl_program.c:626
#47 0x0000000801952782 in clBuildProgram (program=3D0x8006cd1c0, num_device=
s=3D1,
    device_list=3D0x7fffffffe050, options=3D0x801992f4d "", pfn_notify=3D0x=
0,
user_data=3D0x0)
    at src/cl_api.c:835
#48 0x00000008019757b4 in cl_self_test (device=3D0x801bcf2a0
<intel_skl_gt2_device>,
    atomic_in_l3_flag=3DSELF_TEST_PASS) at src/cl_device_id.c:856
#49 0x0000000801975a3e in cl_get_device_ids (platform=3D0x801bcb3d8
<intel_platform_data>,
    device_type=3D4294967295, num_entries=3D0, devices=3D0x0,
num_devices=3D0x8007e8cf0)
    at src/cl_device_id.c:911
#50 0x00000008019554b3 in clGetDeviceIDs (platform=3D0x801bcb3d8
<intel_platform_data>,
    device_type=3D4294967295, num_entries=3D0, devices=3D0x0,
num_devices=3D0x8007e8cf0)
    at src/cl_api_device_id.c:43
#51 0x000000080083e065 in clGetDeviceIDs (platform=3D0x801bcb3d8
<intel_platform_data>,
    device_type=3D4294967295, num_entries=3D0, devices=3D0x0,
num_devices=3D0x8007e8cf0)
    at ocl_icd_loader_gen.c:58
#52 0x0000000000402341 in printPlatformInfo (p=3D0) at src/clinfo.c:459
#53 0x000000000040a3bd in main (argc=3D1, argv=3D0x7fffffffe2b8) at
src/clinfo.c:2676



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