[Bug 220767] lang/beignet: hangs if not linked against libpthread after jemalloc 5.0.0 update

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

[Bug 220767] lang/beignet: hangs if not linked against libpthread after jemalloc 5.0.0 update

bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=220767

            Bug ID: 220767
           Summary: lang/beignet: hangs if not linked against libpthread
                    after jemalloc 5.0.0 update
           Product: Ports & Packages
           Version: Latest
          Hardware: Any
                OS: Any
            Status: New
          Keywords: needs-qa, regression
          Severity: Affects Only Me
          Priority: ---
         Component: Individual Port(s)
          Assignee: [hidden email]
          Reporter: [hidden email]
                CC: [hidden email], [hidden email],
                    [hidden email]
          Assignee: [hidden email]
             Flags: maintainer-feedback?([hidden email])

After base r319971 some applications not already linked against threading
library started to hang in [umtxn] state. It affects at least Beignet. However,
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=/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                            
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_buffer
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=0x803e7dc78
<_mutex_static_lock>, id=101914)
    at /usr/src/lib/libthr/thread/thr_umtx.c:80
#2  0x0000000803c61acc in _thr_umutex_lock (mtx=0x803e7dc78
<_mutex_static_lock>, id=101914)
    at /usr/src/lib/libthr/thread/thr_umtx.h:123
#3  0x0000000803c619b4 in init_static (thread=0x80068b000, mutex=0x801348e50)
    at /usr/src/lib/libthr/thread/thr_mutex.c:304
#4  0x0000000803c602f8 in check_and_init_mutex (mutex=0x801348e50,
m=0x7fffffff2de0)
    at /usr/src/lib/libthr/thread/thr_mutex.c:598
#5  0x0000000803c5f689 in __pthread_mutex_trylock (mutex=0x801348e50)
    at /usr/src/lib/libthr/thread/thr_mutex.c:614
#6  0x0000000800d656b9 in malloc_mutex_trylock_final (mutex=0x801348e10)
    at /usr/src/contrib/jemalloc/include/jemalloc/internal/mutex.h:144
#7  0x0000000800d59602 in malloc_mutex_lock (tsdn=0x80063c088,
mutex=0x801348e10)
    at /usr/src/contrib/jemalloc/include/jemalloc/internal/mutex.h:202
#8  0x0000000800d5b6b8 in __je_arena_tcache_fill_small (tsdn=0x80063c088,
arena=0x801344980,
    tcache=0x80063c240, tbin=0x80063c2e0, binind=6, prof_accumbytes=0) at
jemalloc_arena.c:1433
#9  0x0000000800cd7013 in __je_tcache_alloc_small_hard (tsdn=0x80063c088,
arena=0x801344980,
    tcache=0x80063c240, tbin=0x80063c2e0, binind=6,
tcache_success=0x7fffffff53f6)
    at jemalloc_tcache.c:93
#10 0x0000000800d8ea3e in tcache_alloc_small (tsd=0x80063c088,
arena=0x801344980,
    tcache=0x80063c240, size=96, binind=6, zero=true, slow_path=false)
    at /usr/src/contrib/jemalloc/include/jemalloc/internal/tcache_inlines.h:86
#11 arena_malloc (tsdn=0x80063c088, arena=0x0, size=96, ind=6, zero=true,
tcache=0x80063c240,
    slow_path=false) at
/usr/src/contrib/jemalloc/include/jemalloc/internal/arena_inlines_b.h:101
#12 iallocztm (tsdn=0x80063c088, size=96, ind=6, zero=true, tcache=0x80063c240,
is_internal=false,
    arena=0x0, slow_path=false)
    at
/usr/src/contrib/jemalloc/include/jemalloc/internal/jemalloc_internal_inlines_c.h:33
#13 imalloc_no_sample (sopts=0x7fffffff5300, dopts=0x7fffffff52d0,
tsd=0x80063c088, size=96,
    usize=96, ind=6) at jemalloc_jemalloc.c:1654
#14 imalloc_body (sopts=0x7fffffff5300, dopts=0x7fffffff52d0, tsd=0x80063c088)
    at jemalloc_jemalloc.c:1850
#15 imalloc (sopts=0x7fffffff5300, dopts=0x7fffffff52d0) at
jemalloc_jemalloc.c:1950
#16 __calloc (num=1, size=96) at jemalloc_jemalloc.c:2064
#17 0x0000000803c5fc0e in mutex_init (mutex=0x801348e50,
    mutex_attr=0x803e72758 <_pthread_mutexattr_default>, calloc_cb=0x800d8bea0
<__calloc>)
    at /usr/src/lib/libthr/thread/thr_mutex.c:292
#18 0x0000000803c619dc in init_static (thread=0x80068b000, mutex=0x801348e50)
    at /usr/src/lib/libthr/thread/thr_mutex.c:307
#19 0x0000000803c602f8 in check_and_init_mutex (mutex=0x801348e50,
m=0x7fffffff60d0)
    at /usr/src/lib/libthr/thread/thr_mutex.c:598
#20 0x0000000803c5f689 in __pthread_mutex_trylock (mutex=0x801348e50)
    at /usr/src/lib/libthr/thread/thr_mutex.c:614
#21 0x0000000800d656b9 in malloc_mutex_trylock_final (mutex=0x801348e10)
    at /usr/src/contrib/jemalloc/include/jemalloc/internal/mutex.h:144
#22 0x0000000800d59602 in malloc_mutex_lock (tsdn=0x80063c088,
mutex=0x801348e10)
    at /usr/src/contrib/jemalloc/include/jemalloc/internal/mutex.h:202
#23 0x0000000800d5b6b8 in __je_arena_tcache_fill_small (tsdn=0x80063c088,
arena=0x801344980,
    tcache=0x80063c240, tbin=0x80063c2e0, binind=6, prof_accumbytes=0) at
jemalloc_arena.c:1433
#24 0x0000000800cd7013 in __je_tcache_alloc_small_hard (tsdn=0x80063c088,
arena=0x801344980,
    tcache=0x80063c240, tbin=0x80063c2e0, binind=6,
tcache_success=0x7fffffff86d6)
    at jemalloc_tcache.c:93
#25 0x0000000800d72886 in tcache_alloc_small (tsd=0x80063c088,
arena=0x801344980,
    tcache=0x80063c240, size=88, binind=6, zero=false, slow_path=false)
    at /usr/src/contrib/jemalloc/include/jemalloc/internal/tcache_inlines.h:86
#26 arena_malloc (tsdn=0x80063c088, arena=0x0, size=88, ind=6, zero=false,
tcache=0x80063c240,
    slow_path=false) at
/usr/src/contrib/jemalloc/include/jemalloc/internal/arena_inlines_b.h:101
#27 iallocztm (tsdn=0x80063c088, size=88, ind=6, zero=false,
tcache=0x80063c240, is_internal=false,
    arena=0x0, slow_path=false)
    at
/usr/src/contrib/jemalloc/include/jemalloc/internal/jemalloc_internal_inlines_c.h:33
#28 imalloc_no_sample (sopts=0x7fffffff85e0, dopts=0x7fffffff85b0,
tsd=0x80063c088, size=88,
    usize=96, ind=6) at jemalloc_jemalloc.c:1654
#29 imalloc_body (sopts=0x7fffffff85e0, dopts=0x7fffffff85b0, tsd=0x80063c088)
    at jemalloc_jemalloc.c:1850
#30 imalloc (sopts=0x7fffffff85e0, dopts=0x7fffffff85b0) at
jemalloc_jemalloc.c:1950
#31 __malloc (size=88) at jemalloc_jemalloc.c:1981
#32 0x00000008033b81a8 in operator new (size=88) 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::GlobalDecl,
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) () from
/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<char,
std::__1::char_traits<char>, std::__1::allocator<char> > > >&, unsigned long,
char*, unsigned long*, unsigned int) () from /usr/local/lib/beignet//libgbe.so
#45 0x00000008067848b3 in gbe::programNewFromSource(unsigned int, char const*,
unsigned long, char const*, char*, unsigned long*) () from
/usr/local/lib/beignet//libgbe.so
#46 0x00000008019617c7 in cl_program_build (p=0x8006cd1c0, options=0x801992f4d
"")
    at src/cl_program.c:626
#47 0x0000000801952782 in clBuildProgram (program=0x8006cd1c0, num_devices=1,
    device_list=0x7fffffffe050, options=0x801992f4d "", pfn_notify=0x0,
user_data=0x0)
    at src/cl_api.c:835
#48 0x00000008019757b4 in cl_self_test (device=0x801bcf2a0
<intel_skl_gt2_device>,
    atomic_in_l3_flag=SELF_TEST_PASS) at src/cl_device_id.c:856
#49 0x0000000801975a3e in cl_get_device_ids (platform=0x801bcb3d8
<intel_platform_data>,
    device_type=4294967295, num_entries=0, devices=0x0,
num_devices=0x8007e8cf0)
    at src/cl_device_id.c:911
#50 0x00000008019554b3 in clGetDeviceIDs (platform=0x801bcb3d8
<intel_platform_data>,
    device_type=4294967295, num_entries=0, devices=0x0,
num_devices=0x8007e8cf0)
    at src/cl_api_device_id.c:43
#51 0x000000080083e065 in clGetDeviceIDs (platform=0x801bcb3d8
<intel_platform_data>,
    device_type=4294967295, num_entries=0, devices=0x0,
num_devices=0x8007e8cf0)
    at ocl_icd_loader_gen.c:58
#52 0x0000000000402341 in printPlatformInfo (p=0) at src/clinfo.c:459
#53 0x000000000040a3bd in main (argc=1, argv=0x7fffffffe2b8) at
src/clinfo.c:2676

--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-threads
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

[Bug 220767] lang/beignet: hangs if not linked against libpthread after jemalloc 5.0.0 update

bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=220767

--- Comment #1 from Jan Beich <[hidden email]> ---
Created attachment 184402
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=184402&action=edit
"bt full" output

--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-threads
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

[Bug 220767] lang/beignet: hangs if consumer is not linked against libpthread after jemalloc 5.0.0 update

bugzilla-noreply
In reply to this post by bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=220767

Jan Beich <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|lang/beignet: hangs if not  |lang/beignet: hangs if
                   |linked against libpthread   |consumer is not linked
                   |after jemalloc 5.0.0 update |against libpthread after
                   |                            |jemalloc 5.0.0 update

--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-threads
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

[Bug 220767] lang/beignet: hangs if consumer is not linked against libpthread after jemalloc 5.0.0 update

bugzilla-noreply
In reply to this post by bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=220767

Alexey Dokuchaev <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[hidden email]

--- Comment #2 from Alexey Dokuchaev <[hidden email]> ---
The same thing happens with `games/quake2lnx'.  Similarly, if I link it
explicitly against libpthread or run it as ``env LD_PRELOAD=/lib/libthr.so.3
quake2 ...'' it starts normally.

I'm reluctant to make changes to the port though before we know what particular
change in jemalloc is breaking previously working code (ports), and if that
code just worked by accident, or the bug had sneaked into jemalloc 5.0.0.

--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-threads
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

[Bug 220767] lang/beignet: hangs if consumer is not linked against libpthread after jemalloc 5.0.0 update

bugzilla-noreply
In reply to this post by bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=220767

--- Comment #3 from Alexey Dokuchaev <[hidden email]> ---
Last two comments in https://github.com/jemalloc/jemalloc/issues/907 (October
10th-ish) might or might not be related.

--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-threads
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

[Bug 220767] lang/beignet: hangs if consumer is not linked against libpthread after jemalloc 5.0.0 update

bugzilla-noreply
In reply to this post by bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=220767

--- Comment #4 from Jan Beich <[hidden email]> ---
Do we have tests for base r276630? For one, jemalloc 5.0.0 changed

  bool
  malloc_mutex_first_thread(void)
  {

  #ifdef JEMALLOC_MUTEX_INIT_CB
          postpone_init = false;
          while (postponed_mutexes != NULL) {
                  if (_pthread_mutex_init_calloc_cb(&postponed_mutexes->lock,
                      bootstrap_calloc) != 0)
                          return (true);
                  postponed_mutexes = postponed_mutexes->postponed_next;
          }
  #endif
          return (false);
  }

into

  bool
  malloc_mutex_first_thread(void) {

  #ifndef JEMALLOC_MUTEX_INIT_CB
          return (malloc_mutex_first_thread());
  #else
          return (false);
  #endif
  }

--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-threads
To unsubscribe, send any mail to "[hidden email]"