apache / mxnet

Lightweight, Portable, Flexible Distributed/Mobile Deep Learning with Dynamic, Mutation-aware Dataflow Dep Scheduler; for Python, R, Julia, Scala, Go, Javascript and more
https://mxnet.apache.org
Apache License 2.0
20.78k stars 6.79k forks source link

A process crashes when trying to exit normally #17653

Open dmitry-markeshov opened 4 years ago

dmitry-markeshov commented 4 years ago

Description

MxNet version 1.6.0 (manually builded from source)

I run many unit tests through ctest. ctest calls exec() for each test (I believe) and runs a new process where test is running. In most tests MxNet is used. All tests pass, but sometimes I see messages like this:

59: Test command: /home/builder/src/face_sdk/Linux-Release/build/tests/face_sdk_tests "--gtest_filter=face_detector_200.make_face_detector_incorrect_license_format_test" "--gtest_also_run_disabled_tests" "--source_dir=/home/builder/face_sdk/Linux-Release/src" "                             --cmake_generated_dir=/home/builder/src/face_sdk/Linux-Release/build"
59: Test timeout computed to be: 10000000
59: Note: Google Test filter = face_detector_200.make_face_detector_incorrect_license_format_test
59: [==========] Running 1 test from 1 test case.
59: [----------] Global test environment set-up.
59: [----------] 1 test from face_detector_200
59: [ RUN      ] face_detector_200.make_face_detector_incorrect_license_format_test
59: [       OK ] face_detector_200.make_face_detector_incorrect_license_format_test (591 ms)
59: [----------] 1 test from face_detector_200 (591 ms total)
59:
59: [----------] Global test environment tear-down
59: [==========] 1 test from 1 test case ran. (591 ms total)
59: [  PASSED  ] 1 test.
59: terminate called without an active exception
 59/313 Test  #59: face_detector_200.make_face_detector_incorrect_license_format_test ......Child aborted***Exception:   0.69 sec

Back Trace is below:

Error Message

(gdb) bt
#0  0x00007f21dd595337 in raise () from /lib64/libc.so.6
#1  0x00007f21dd596a28 in abort () from /lib64/libc.so.6
#2  0x00007f21ddba37d5 in __gnu_cxx::__verbose_terminate_handler() () from /lib64/libstdc++.so.6
#3  0x00007f21ddba1746 in ?? () from /lib64/libstdc++.so.6
#4  0x00007f21ddba1773 in std::terminate() () from /lib64/libstdc++.so.6
#5  0x0000000003c833fa in std::vector<std::thread, std::allocator<std::thread> >::~vector() ()
#6  0x0000000003d5437f in std::_Sp_counted_ptr<mxnet::engine::ThreadedEnginePerDevice::ThreadWorkerBlock<(dmlc::ConcurrentQueueType)0>*, (__gnu_cxx::_Lock_policy)2>::_M_dispose() ()
#7  0x00000000006215d9 in std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release (this=0x95ae2d0) at /usr/include/c++/4.8.2/bits/shared_ptr_base.h:144
#8  0x0000000003d52bb1 in mxnet::common::LazyAllocArray<mxnet::engine::ThreadedEnginePerDevice::ThreadWorkerBlock<(dmlc::ConcurrentQueueType)0> >::Clear() ()
#9  0x0000000003d55a11 in mxnet::engine::ThreadedEnginePerDevice::StopNoWait() ()
#10 0x0000000003d55b7e in mxnet::engine::ThreadedEnginePerDevice::~ThreadedEnginePerDevice() ()
#11 0x0000000003d55e49 in mxnet::engine::ThreadedEnginePerDevice::~ThreadedEnginePerDevice() ()
#12 0x00000000006215d9 in std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release (this=0x98372c0) at /usr/include/c++/4.8.2/bits/shared_ptr_base.h:144
#13 0x0000000003eb4050 in mxnet::NDArray::Chunk::~Chunk() ()
#14 0x00000000006215d9 in std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release (this=0x7f21ac04b5f0) at /usr/include/c++/4.8.2/bits/shared_ptr_base.h:144
#15 0x0000000003c84405 in std::vector<mxnet::NDArray, std::allocator<mxnet::NDArray> >::~vector() ()
#16 0x0000000003d6139e in mxnet::exec::StorageFallbackOpExecutor::~StorageFallbackOpExecutor() ()
#17 0x00000000006215d9 in std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release (this=0x9d2b270) at /usr/include/c++/4.8.2/bits/shared_ptr_base.h:144
#18 0x0000000003d609d5 in std::vector<std::shared_ptr<mxnet::exec::OpExecutor>, std::allocator<std::shared_ptr<mxnet::exec::OpExecutor> > >::~vector() ()
#19 0x0000000003d6e996 in std::_Function_base::_Base_manager<mxnet::exec::GraphExecutor::CreateCachedSegOpr(unsigned long, unsigned long)::{lambda(mxnet::RunContext, mxnet::engine::CallbackOnComplete)#1}>::_M_manager(std::_Any_data&, std::_Function_base::_Base_manager<mxnet::exec::GraphExecutor::CreateCachedSegOpr(unsigned long, unsigned long)::{lambda(mxnet::RunContext, mxnet::engine::CallbackOnComplete)#1}> const&, std::_Manager_operation) ()
#20 0x0000000003d49995 in std::_Function_handler<void (mxnet::RunContext, mxnet::engine::CallbackOnComplete), mxnet::engine::ThreadedEngine::DeleteOperator(mxnet::engine::Opr*)::{lambda(mxnet::RunContext, mxnet::engine::CallbackOnComplete)#1}>::_M_invoke(std::_Any_data const&, mxnet::RunContext, mxnet::engine::CallbackOnComplete) ()
#21 0x0000000003d53493 in mxnet::engine::ThreadedEngine::ExecuteOprBlock(mxnet::RunContext, mxnet::engine::OprBlock*) ()
#22 0x0000000003d551d4 in std::_Function_handler<void (std::shared_ptr<dmlc::ManualEvent>), mxnet::engine::ThreadedEnginePerDevice::PushToExecute(mxnet::engine::OprBlock*, bool)::{lambda()#1}::operator()() const::{lambda(std::shared_ptr<dmlc::ManualEvent>)#1}>::_M_invoke(std::_Any_data const&, std::shared_ptr<dmlc::ManualEvent>) ()
#23 0x0000000003d52514 in std::thread::_Impl<std::_Bind_simple<std::function<void (std::shared_ptr<dmlc::ManualEvent>)> (std::shared_ptr<dmlc::ManualEvent>)> >::_M_run() ()
#24 0x00007f21ddbf8070 in ?? () from /lib64/libstdc++.so.6
#25 0x00007f21de153e65 in start_thread () from /lib64/libpthread.so.0
#26 0x00007f21dd65d88d in clone () from /lib64/libc.so.6
(gdb) info threads
  Id   Target Id         Frame
  12   Thread 0x7f21bb68ee80 (LWP 31588) _INTERNAL_25_______src_kmp_barrier_cpp_38a91946::__kmp_wait_template<kmp_flag_64, 1, false, true> (this_thr=0x7f21dfc5b4e4 <__kmp_tasking_mode>, flag=0x7f21bb68dbc8, itt_sync_obj=0x10251100000000)
    at ../../src/kmp_wait_release.h:405
  11   Thread 0x7f21db6b0880 (LWP 31576) _INTERNAL_25_______src_kmp_barrier_cpp_38a91946::__kmp_wait_template<kmp_flag_64, 1, false, true> (this_thr=0x7f21dfc5b4e4 <__kmp_tasking_mode>, flag=0x7f21db6af8c8, itt_sync_obj=0x10251100000000)
    at ../../src/kmp_wait_release.h:397
  10   Thread 0x7f21da6ac980 (LWP 31578) 0x00007f21dd642727 in sched_yield () from /lib64/libc.so.6
  9    Thread 0x7f21daeae900 (LWP 31577) _INTERNAL_25_______src_kmp_barrier_cpp_38a91946::__kmp_wait_template<kmp_flag_64, 1, false, true> (this_thr=0x7f21dfc5b4e4 <__kmp_tasking_mode>, flag=0x7f21daead908, itt_sync_obj=0x10251100000000)
    at ../../src/kmp_wait_release.h:405
  8    Thread 0x7f21dbeb2800 (LWP 31575) _INTERNAL_25_______src_kmp_barrier_cpp_38a91946::__kmp_wait_template<kmp_flag_64, 1, false, true> (this_thr=0x7f21dfc5b4e4 <__kmp_tasking_mode>, flag=0x7f21dbeb1888, itt_sync_obj=0x10251100000000)
    at ../../src/kmp_wait_release.h:405
  7    Thread 0x7f21bc692d80 (LWP 31586) 0x00007f21dd642727 in sched_yield () from /lib64/libc.so.6
  6    Thread 0x7f21dfe9ca00 (LWP 31573) 0x0000000003cbf9f0 in dmlc::parameter::ParamManager::~ParamManager() ()
  5    Thread 0x7f21dc6b4780 (LWP 31574) _INTERNAL_25_______src_kmp_barrier_cpp_38a91946::__kmp_wait_template<kmp_flag_64, 1, false, true> (this_thr=0x7f21dfc5b4e4 <__kmp_tasking_mode>, flag=0x7f21dc6b3848, itt_sync_obj=0x10251100000000)
    at ../../src/kmp_wait_release.h:405
  4    Thread 0x7f21bbe90e00 (LWP 31587) _INTERNAL_25_______src_kmp_barrier_cpp_38a91946::__kmp_wait_template<kmp_flag_64, 1, false, true> (this_thr=0x7f21dfc5b4e4 <__kmp_tasking_mode>, flag=0x7f21bbe8fb88, itt_sync_obj=0x10251100000000)
    at ../../src/kmp_wait_release.h:405
  3    Thread 0x7f21bce94d00 (LWP 31585) _INTERNAL_25_______src_kmp_barrier_cpp_38a91946::__kmp_wait_template<kmp_flag_64, 1, false, true> (this_thr=0x7f21dfc5b4e4 <__kmp_tasking_mode>, flag=0x7f21bce93b08, itt_sync_obj=0x10251100000000)
    at ../../src/kmp_wait_release.h:405
  2    Thread 0x7f21bd696c80 (LWP 31584) _INTERNAL_25_______src_kmp_barrier_cpp_38a91946::__kmp_wait_template<kmp_flag_64, 1, false, true> (this_thr=0x7f21dfc5b4e4 <__kmp_tasking_mode>, flag=0x7f21bd695ac8, itt_sync_obj=0x10251100000000)
    at ../../src/kmp_wait_release.h:405
* 1    Thread 0x7f21c37fe700 (LWP 31583) 0x00007f21dd595337 in raise () from /lib64/libc.so.6

Environment

----------Python Info----------
('Version      :', '2.7.5')
('Compiler     :', 'GCC 4.8.5 20150623 (Red Hat 4.8.5-28)')
('Build        :', ('default', 'Jul 13 2018 13:06:57'))
('Arch         :', ('64bit', 'ELF'))
------------Pip Info-----------
No corresponding pip install for current python.
----------MXNet Info-----------
No MXNet installed.
----------System Info----------
('Platform     :', 'Linux-3.10.0-862.11.6.el7.x86_64-x86_64-with-centos-7.5.1804-Core')
('system       :', 'Linux')
('node         :', '9804039b4d8e')
('release      :', '3.10.0-862.11.6.el7.x86_64')
('version      :', '#1 SMP Tue Aug 14 21:49:04 UTC 2018')
----------Hardware Info----------
('machine      :', 'x86_64')
('processor    :', 'x86_64')
Architecture:          x86_64
CPU op-mode(s):        32-bit, 64-bit
Byte Order:            Little Endian
CPU(s):                12
On-line CPU(s) list:   0-11
Thread(s) per core:    2
Core(s) per socket:    6
Socket(s):             1
NUMA node(s):          1
Vendor ID:             GenuineIntel
CPU family:            6
Model:                 158
Model name:            Intel(R) Core(TM) i7-8700K CPU @ 3.70GHz
Stepping:              10
CPU MHz:               799.890
CPU max MHz:           4700.0000
CPU min MHz:           800.0000
BogoMIPS:              7392.00
Virtualization:        VT-x
L1d cache:             32K
L1i cache:             32K
L2 cache:              256K
L3 cache:              12288K
NUMA node0 CPU(s):     0-11
Flags:                 fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch epb intel_pt ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm mpx rdseed adx smap clflushopt xsaveopt xsavec xgetbv1 dtherm ida arat pln pts hwp hwp_notify hwp_act_window hwp_epp spec_ctrl intel_stibp
----------Network Test----------
Setting timeout: 10
Timing for PYPI: https://pypi.python.org/pypi/pip, DNS: 0.1157 sec, LOAD: 1.0584 sec.
Timing for D2L: http://d2l.ai, DNS: 0.0791 sec, LOAD: 0.3457 sec.
Timing for FashionMNIST: https://repo.mxnet.io/gluon/dataset/fashion-mnist/train-labels-idx1-ubyte.gz, DNS: 0.1159 sec, LOAD: 0.8497 sec.
Timing for Conda: https://repo.continuum.io/pkgs/free/, DNS: 0.0763 sec, LOAD: 0.3252 sec.
Timing for MXNet: https://github.com/apache/incubator-mxnet, DNS: 0.0076 sec, LOAD: 0.7661 sec.
Timing for GluonNLP: http://gluon-nlp.mxnet.io, DNS: 0.0682 sec, LOAD: 0.7391 sec.
Timing for D2L (zh-cn): http://zh.d2l.ai, DNS: 0.0339 sec, LOAD: 0.3219 sec.
Timing for GluonNLP GitHub: https://github.com/dmlc/gluon-nlp, DNS: 0.0010 sec, LOAD: 0.6049 sec.
leezu commented 4 years ago

Did you build with cmake or make? Do you have MKL installed on your system?

What's the build configuration? In case it's build with cmake, whats the output of the configuration run?

dmitry-markeshov commented 4 years ago

Did you build with cmake or make?

cmake

Do you have MKL installed on your system?

It's static linked (aslo MxNet static linked too) MKL version is 2019.3.199

What's the build configuration?

The cmake configure command line and output:

/usr/local/bin/cmake -H/home/builder/mxnet -B/home/builder/build/mxnet/build -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local/mxnet -DUSE_OPENMP=ON -DUSE_CUDA=OFF -DUSE_OLDCMAKECUDA=OFF -DUSE_CUDNN=OFF -DBLAS=MKL -DUSE_MKL_IF_AVAILABLE=ON -DUSE_MKLDNN=OFF -DUSE_MKLML_MKL=OFF -DMKL_USE_SINGLE_DYNAMIC_LIBRARY=OFF -DMKL_USE_STATIC_LIBS=ON -DMKL_MULTI_THREADED=ON -DMKL_USE_ILP64=OFF -DMKL_USE_CLUSTER=OFF -DUSE_MKLDNN=OFF -DUSE_OPENCV=OFF -DUSE_CPP_PACKAGE=ON -DDO_NOT_BUILD_EXAMPLES=ON -DBUILD_CPP_EXAMPLES=OFF
-- The C compiler identification is GNU 4.8.5
-- The CXX compiler identification is GNU 4.8.5
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- CMAKE_CROSSCOMPILING FALSE
-- CMAKE_HOST_SYSTEM_PROCESSOR x86_64
-- CMAKE_SYSTEM_PROCESSOR x86_64
-- CMAKE_SYSTEM_NAME Linux
-- CMake version '3.14.3' using generator 'Unix Makefiles'
-- Performing Test SUPPORT_CXX11
-- Performing Test SUPPORT_CXX11 - Success
-- Performing Test SUPPORT_CXX0X
-- Performing Test SUPPORT_CXX0X - Success
-- Performing Test SUPPORT_MSSE3
-- Performing Test SUPPORT_MSSE3 - Success
-- Performing Test SUPPORT_MSSE2
-- Performing Test SUPPORT_MSSE2 - Success
-- Determining F16C support
-- Performing Test COMPILER_SUPPORT_MF16C
-- Performing Test COMPILER_SUPPORT_MF16C - Success
-- F16C enabled
-- Found MKL: /opt/intel/mkl/include
-- Found MKL (include: /opt/intel/mkl/include, lib: -Wl,--start-group /opt/intel/mkl/lib/intel64/libmkl_blas95_lp64.a /opt/intel/mkl/lib/intel64/libmkl_lapack95_lp64.a /opt/intel/mkl/lib/intel64/libmkl_intel_lp64.a /opt/intel/mkl/lib/intel64/libmkl_intel_thread.a /opt/intel/mkl/lib/intel64/libmkl_core.a -Wl,--end-group -Wl,-rpath /usr/local/mxnet/lib /usr/local/mxnet/lib/libiomp5.so -ldl
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.27.1")
-- Could NOT find Jemalloc (missing: JEMALLOC_LIBRARY JEMALLOC_INCLUDE_DIR)
-- OpenCV Disabled
-- Found OpenMP_C: -fopenmp (found version "3.1")
-- Found OpenMP_CXX: -fopenmp (found version "3.1")
-- Found OpenMP: TRUE (found version "3.1")
-- Performing Test OPENMP_HAVE_WERROR_FLAG
-- Performing Test OPENMP_HAVE_WERROR_FLAG - Success
-- Performing Test OPENMP_HAVE_STD_GNUPP11_FLAG
-- Performing Test OPENMP_HAVE_STD_GNUPP11_FLAG - Success
-- Performing Test OPENMP_HAVE_STD_CPP11_FLAG
-- Performing Test OPENMP_HAVE_STD_CPP11_FLAG - Success
-- Found PythonInterp: /usr/bin/python (found version "2.7.5")
-- Cannot find llvm-lit.
-- Please put llvm-lit in your PATH, set OPENMP_LLVM_LIT_EXECUTABLE to its full path, or point OPENMP_LLVM_TOOLS_DIR to its directory.
CMake Warning at 3rdparty/openmp/cmake/OpenMPTesting.cmake:22 (message):
  The check targets will not be available!
Call Stack (most recent call first):
  3rdparty/openmp/cmake/OpenMPTesting.cmake:40 (find_standalone_test_dependencies)
  3rdparty/openmp/CMakeLists.txt:49 (include)

-- Performing Test LIBOMP_HAVE_FNO_EXCEPTIONS_FLAG
-- Performing Test LIBOMP_HAVE_FNO_EXCEPTIONS_FLAG - Success
-- Performing Test LIBOMP_HAVE_FNO_RTTI_FLAG
-- Performing Test LIBOMP_HAVE_FNO_RTTI_FLAG - Success
-- Performing Test LIBOMP_HAVE_X_CPP_FLAG
-- Performing Test LIBOMP_HAVE_X_CPP_FLAG - Success
-- Performing Test LIBOMP_HAVE_WCAST_QUAL_FLAG
-- Performing Test LIBOMP_HAVE_WCAST_QUAL_FLAG - Success
-- Performing Test LIBOMP_HAVE_WNO_UNUSED_FUNCTION_FLAG
-- Performing Test LIBOMP_HAVE_WNO_UNUSED_FUNCTION_FLAG - Success
-- Performing Test LIBOMP_HAVE_WNO_UNUSED_LOCAL_TYPEDEF_FLAG
-- Performing Test LIBOMP_HAVE_WNO_UNUSED_LOCAL_TYPEDEF_FLAG - Failed
-- Performing Test LIBOMP_HAVE_WNO_UNUSED_VALUE_FLAG
-- Performing Test LIBOMP_HAVE_WNO_UNUSED_VALUE_FLAG - Success
-- Performing Test LIBOMP_HAVE_WNO_UNUSED_VARIABLE_FLAG
-- Performing Test LIBOMP_HAVE_WNO_UNUSED_VARIABLE_FLAG - Success
-- Performing Test LIBOMP_HAVE_WNO_SWITCH_FLAG
-- Performing Test LIBOMP_HAVE_WNO_SWITCH_FLAG - Success
-- Performing Test LIBOMP_HAVE_WNO_COVERED_SWITCH_DEFAULT_FLAG
-- Performing Test LIBOMP_HAVE_WNO_COVERED_SWITCH_DEFAULT_FLAG - Failed
-- Performing Test LIBOMP_HAVE_WNO_DEPRECATED_REGISTER_FLAG
-- Performing Test LIBOMP_HAVE_WNO_DEPRECATED_REGISTER_FLAG - Failed
-- Performing Test LIBOMP_HAVE_WNO_SIGN_COMPARE_FLAG
-- Performing Test LIBOMP_HAVE_WNO_SIGN_COMPARE_FLAG - Success
-- Performing Test LIBOMP_HAVE_WNO_GNU_ANONYMOUS_STRUCT_FLAG
-- Performing Test LIBOMP_HAVE_WNO_GNU_ANONYMOUS_STRUCT_FLAG - Failed
-- Performing Test LIBOMP_HAVE_WNO_UNKNOWN_PRAGMAS_FLAG
-- Performing Test LIBOMP_HAVE_WNO_UNKNOWN_PRAGMAS_FLAG - Success
-- Performing Test LIBOMP_HAVE_WNO_MISSING_FIELD_INITIALIZERS_FLAG
-- Performing Test LIBOMP_HAVE_WNO_MISSING_FIELD_INITIALIZERS_FLAG - Success
-- Performing Test LIBOMP_HAVE_WNO_MISSING_BRACES_FLAG
-- Performing Test LIBOMP_HAVE_WNO_MISSING_BRACES_FLAG - Success
-- Performing Test LIBOMP_HAVE_WNO_COMMENT_FLAG
-- Performing Test LIBOMP_HAVE_WNO_COMMENT_FLAG - Success
-- Performing Test LIBOMP_HAVE_WNO_SELF_ASSIGN_FLAG
-- Performing Test LIBOMP_HAVE_WNO_SELF_ASSIGN_FLAG - Failed
-- Performing Test LIBOMP_HAVE_WNO_VLA_EXTENSION_FLAG
-- Performing Test LIBOMP_HAVE_WNO_VLA_EXTENSION_FLAG - Failed
-- Performing Test LIBOMP_HAVE_WNO_FORMAT_PEDANTIC_FLAG
-- Performing Test LIBOMP_HAVE_WNO_FORMAT_PEDANTIC_FLAG - Failed
-- Performing Test LIBOMP_HAVE_WSTRINGOP_OVERFLOW_FLAG
-- Performing Test LIBOMP_HAVE_WSTRINGOP_OVERFLOW_FLAG - Failed
-- Performing Test LIBOMP_HAVE_MSSE2_FLAG
-- Performing Test LIBOMP_HAVE_MSSE2_FLAG - Success
-- Performing Test LIBOMP_HAVE_FTLS_MODEL_FLAG
-- Performing Test LIBOMP_HAVE_FTLS_MODEL_FLAG - Success
-- Performing Test LIBOMP_HAVE_MMIC_FLAG
-- Performing Test LIBOMP_HAVE_MMIC_FLAG - Failed
-- Performing Test LIBOMP_HAVE_M32_FLAG
-- Performing Test LIBOMP_HAVE_M32_FLAG - Failed
-- Performing Test LIBOMP_HAVE_X_FLAG
-- Performing Test LIBOMP_HAVE_X_FLAG - Success
-- Performing Test LIBOMP_HAVE_WARN_SHARED_TEXTREL_FLAG
-- Performing Test LIBOMP_HAVE_WARN_SHARED_TEXTREL_FLAG - Success
-- Performing Test LIBOMP_HAVE_AS_NEEDED_FLAG
-- Performing Test LIBOMP_HAVE_AS_NEEDED_FLAG - Success
-- Performing Test LIBOMP_HAVE_VERSION_SCRIPT_FLAG
-- Performing Test LIBOMP_HAVE_VERSION_SCRIPT_FLAG - Success
-- Performing Test LIBOMP_HAVE_STATIC_LIBGCC_FLAG
-- Performing Test LIBOMP_HAVE_STATIC_LIBGCC_FLAG - Success
-- Performing Test LIBOMP_HAVE_Z_NOEXECSTACK_FLAG
-- Performing Test LIBOMP_HAVE_Z_NOEXECSTACK_FLAG - Success
-- Performing Test LIBOMP_HAVE_FINI_FLAG
-- Performing Test LIBOMP_HAVE_FINI_FLAG - Success
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Found Perl: /usr/bin/perl (found version "5.16.3")
-- Performing Test LIBOMP_HAVE_VERSION_SYMBOLS
-- Performing Test LIBOMP_HAVE_VERSION_SYMBOLS - Success
-- Performing Test LIBOMP_HAVE___BUILTIN_FRAME_ADDRESS
-- Performing Test LIBOMP_HAVE___BUILTIN_FRAME_ADDRESS - Success
-- Performing Test LIBOMP_HAVE_WEAK_ATTRIBUTE
-- Performing Test LIBOMP_HAVE_WEAK_ATTRIBUTE - Success
-- Looking for include files windows.h, psapi.h
-- Looking for include files windows.h, psapi.h - not found
-- Looking for EnumProcessModules in psapi
-- Looking for EnumProcessModules in psapi - not found
-- LIBOMP: Operating System     -- Linux
-- LIBOMP: Target Architecture  -- x86_64
-- LIBOMP: Build Type           -- Release
-- LIBOMP: Library Kind         -- SHARED
-- LIBOMP: Library Type         -- normal
-- LIBOMP: Fortran Modules      -- FALSE
-- LIBOMP: Build                -- 20140926
-- LIBOMP: Use Stats-gathering  -- FALSE
-- LIBOMP: Use Debugger-support -- FALSE
-- LIBOMP: Use ITT notify       -- TRUE
-- LIBOMP: Use OMPT-support     -- TRUE
-- LIBOMP: Use OMPT-optional  -- TRUE
-- LIBOMP: Use Adaptive locks   -- TRUE
-- LIBOMP: Use quad precision   -- TRUE
-- LIBOMP: Use TSAN-support     -- FALSE
-- LIBOMP: Use Hwloc library    -- FALSE
-- Looking for sqrt in m
-- Looking for sqrt in m - found
-- Looking for __atomic_load_1
-- Looking for __atomic_load_1 - not found
-- Looking for __atomic_load_1 in atomic
-- Looking for __atomic_load_1 in atomic - not found
-- check-libomp does nothing.
-- check-ompt does nothing.
-- check-openmp does nothing.
USE_LAPACK is ON
-- Could NOT find Jemalloc (missing: JEMALLOC_LIBRARY JEMALLOC_INCLUDE_DIR)
CMake Warning at 3rdparty/googletest/googletest/CMakeLists.txt:47 (project):
  VERSION keyword not followed by a value or was followed by a value that
  expanded to nothing.

-- Found GTest: gtest
-- Looking for clock_gettime in rt
-- Looking for clock_gettime in rt - found
-- Looking for fopen64
-- Looking for fopen64 - not found
-- Looking for C++ include cxxabi.h
-- Looking for C++ include cxxabi.h - found
-- Looking for nanosleep
-- Looking for nanosleep - found
-- Looking for backtrace
-- Looking for backtrace - found
-- backtrace facility detected in default set of libraries
-- Found Backtrace: /usr/include
-- Check if the system is big endian
-- Searching 16 bit integer
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for stddef.h
-- Looking for stddef.h - found
-- Check size of unsigned short
-- Check size of unsigned short - done
-- Using unsigned short
-- Check if the system is big endian - little endian
-- /home/builder/mxnet/3rdparty/dmlc-core/cmake/build_config.h.in -> include/dmlc/build_config.h
-- Found OpenMP_C: -fopenmp (found version "3.1")
-- Found OpenMP_CXX: -fopenmp (found version "3.1")
CMake Warning at CMakeLists.txt:818 (message):
  OpenCV_VERSION_MAJOR: , version 3 with imgcodecs is required for im2rec,
  im2rec will not be available

-- Configuring done
-- Generating done
CMake Warning:
  Manually-specified variables were not used by the project:

    DO_NOT_BUILD_EXAMPLES
    USE_MKLML_MKL
    USE_OLDCMAKECUDA

-- Build files have been written to: /home/builder/build/mxnet/build

Also I used own FindMKL.cmake (changed were made for mkl static linkage)
FindMKL.zip

leezu commented 4 years ago

Could you try deleting the 3rdparty/openmp directory before configuring and building. There is an issue where both libiomp and libomp are linked when enabling MKL: https://github.com/apache/incubator-mxnet/issues/17641

dmitry-markeshov commented 4 years ago

Tryed. Unfortunately didn't help.

/usr/local/bin/cmake -H/home/builder/mxnet -B/home/builder/build/mxnet/build -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local/mxnet -DUSE_OPENMP=ON -DUSE_CUDA=OFF -DUSE_OLDCMAKECUDA=OFF -DUSE_CUDNN=OFF -DBLAS=MKL -DUSE_MKL_IF_AVAILABLE=ON -DUSE_MKLDNN=OFF -DUSE_MKLML_MKL=OFF -DMKL_USE_SINGLE_DYNAMIC_LIBRARY=OFF -DMKL_USE_STATIC_LIBS=ON -DMKL_MULTI_THREADED=ON -DMKL_USE_ILP64=OFF -DMKL_USE_CLUSTER=OFF -DUSE_MKLDNN=OFF -DUSE_OPENCV=OFF -DUSE_CPP_PACKAGE=ON -DDO_NOT_BUILD_EXAMPLES=ON -DBUILD_CPP_EXAMPLES=OFF
-- The C compiler identification is GNU 4.8.5
-- The CXX compiler identification is GNU 4.8.5
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- CMAKE_CROSSCOMPILING FALSE
-- CMAKE_HOST_SYSTEM_PROCESSOR x86_64
-- CMAKE_SYSTEM_PROCESSOR x86_64
-- CMAKE_SYSTEM_NAME Linux
-- CMake version '3.14.3' using generator 'Unix Makefiles'
-- Performing Test SUPPORT_CXX11
-- Performing Test SUPPORT_CXX11 - Success
-- Performing Test SUPPORT_CXX0X
-- Performing Test SUPPORT_CXX0X - Success
-- Performing Test SUPPORT_MSSE3
-- Performing Test SUPPORT_MSSE3 - Success
-- Performing Test SUPPORT_MSSE2
-- Performing Test SUPPORT_MSSE2 - Success
-- Determining F16C support
-- Performing Test COMPILER_SUPPORT_MF16C
-- Performing Test COMPILER_SUPPORT_MF16C - Success
-- F16C enabled
-- Found MKL: /opt/intel/mkl/include
-- Found MKL (include: /opt/intel/mkl/include, lib: -Wl,--start-group /opt/intel/mkl/lib/intel64/libmkl_blas95_lp64.a /opt/intel/mkl/lib/intel64/libmkl_lapack95_lp64.a /opt/intel/mkl/lib/intel64/libmkl_intel_lp64.a /opt/intel/mkl/lib/intel64/libmkl_intel_thread.a /opt/intel/mkl/lib/intel64/libmkl_core.a -Wl,--end-group -Wl,-rpath /usr/local/mxnet/lib /usr/local/mxnet/lib/libiomp5.so -ldl
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.27.1")
-- Could NOT find Jemalloc (missing: JEMALLOC_LIBRARY JEMALLOC_INCLUDE_DIR)
-- OpenCV Disabled
-- Found OpenMP_C: -fopenmp (found version "3.1")
-- Found OpenMP_CXX: -fopenmp (found version "3.1")
-- Found OpenMP: TRUE (found version "3.1")
USE_LAPACK is ON
-- Could NOT find Jemalloc (missing: JEMALLOC_LIBRARY JEMALLOC_INCLUDE_DIR)
CMake Warning at 3rdparty/googletest/googletest/CMakeLists.txt:47 (project):
  VERSION keyword not followed by a value or was followed by a value that
  expanded to nothing.

-- Found PythonInterp: /usr/bin/python (found version "2.7.5")
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - found
-- Found Threads: TRUE
-- Found GTest: gtest
-- Looking for clock_gettime in rt
-- Looking for clock_gettime in rt - found
-- Looking for fopen64
-- Looking for fopen64 - not found
-- Looking for C++ include cxxabi.h
-- Looking for C++ include cxxabi.h - found
-- Looking for nanosleep
-- Looking for nanosleep - found
-- Looking for backtrace
-- Looking for backtrace - found
-- backtrace facility detected in default set of libraries
-- Found Backtrace: /usr/include
-- Check if the system is big endian
-- Searching 16 bit integer
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for stddef.h
-- Looking for stddef.h - found
-- Check size of unsigned short
-- Check size of unsigned short - done
-- Using unsigned short
-- Check if the system is big endian - little endian
-- /home/builder/mxnet/3rdparty/dmlc-core/cmake/build_config.h.in -> include/dmlc/build_config.h
-- Found OpenMP_C: -fopenmp (found version "3.1")
-- Found OpenMP_CXX: -fopenmp (found version "3.1")
CMake Warning at CMakeLists.txt:818 (message):
  OpenCV_VERSION_MAJOR: , version 3 with imgcodecs is required for im2rec,
  im2rec will not be available

-- Configuring done
-- Generating done
CMake Warning:
  Manually-specified variables were not used by the project:

    DO_NOT_BUILD_EXAMPLES
    USE_MKLML_MKL
    USE_OLDCMAKECUDA

-- Build files have been written to: /home/builder/build/mxnet/build

Will try to debug.

dmitry-markeshov commented 4 years ago

After these changes process exits without crash:

diff --git a/src/engine/threaded_engine_perdevice.cc b/src/engine/threaded_engine_perdevice.cc
index bcb101e..adaf4c1 100644
--- a/src/engine/threaded_engine_perdevice.cc
+++ b/src/engine/threaded_engine_perdevice.cc
@@ -55,7 +55,7 @@ class ThreadedEnginePerDevice : public ThreadedEngine {
     this->Start();
   }
   ~ThreadedEnginePerDevice() noexcept(false) {
-    this->StopNoWait();
+    this->Stop();
   }

   void StopNoWait() {

Could someone explain why is there StopNoWait ?

leezu commented 4 years ago

cc: @eric-haibin-lin