C++部分的Enforce failed
Created by: FisherOuch
您好,我在进行 PaddleHub LAC 的测试中出现了报错如下:
C++ Callstacks: Enforce failed. Expected posix_memalign(&p, alignment, size) == 0, but received posix_memalign(&p, alignment, size):12 != 0:0.
因个人对程序本身和C++方面不太熟悉想向您请教问题出现的可能原因。 测试中使用了 Python 的 flask 框架做成了分词接口,在经过27w多次分词后发生的报错。 完整报错信息如下:
Traceback (most recent call last): File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 2446, in wsgi_app response = self.full_dispatch_request() File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1951, in full_dispatch_request rv = self.handle_user_exception(e) File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1820, in handle_user_exception reraise(exc_type, exc_value, tb) File "/usr/local/lib/python3.6/site-packages/flask/compat.py", line 39, in reraise raise value File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1949, in full_dispatch_request rv = self.dispatch_request() File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1935, in dispatch_request return self.view_functionsrule.endpoint File "/root/PaddleLAC/lexical_analysis/infer_test.py", line 78, in tokenize results = lac.lexical_analysis(data={"text": article_list}, batch_size=len(article_list)) File "/usr/local/lib/python3.6/site-packages/paddlehub/module/module.py", line 484, in call return_numpy=False) File "/usr/local/lib/python3.6/site-packages/paddle/fluid/executor.py", line 651, in run use_program_cache=use_program_cache) File "/usr/local/lib/python3.6/site-packages/paddle/fluid/executor.py", line 749, in run exe.run(program.desc, scope, 0, True, True, fetch_var_name) paddle.fluid.core_avx.EnforceNotMet: Invoke operator gru error. Python Callstacks: C++ Callstacks: Enforce failed. Expected posix_memalign(&p, alignment, size) == 0, but received posix_memalign(&p, alignment, size):12 != 0:0. Alloc 256333568 error! at [/paddle/paddle/fluid/memory/detail/system_allocator.cc:57] PaddlePaddle Call Stacks: 0 0x2b13dc647b78p void paddle::platform::EnforceNotMet::Initstd::string(std::string, char const*, int) + 360 1 0x2b13dda11337p paddle::memory::detail::AlignedMalloc(unsigned long) + 295 2 0x2b13dda115f7p paddle::memory::detail::CPUAllocator::Alloc(unsigned long*, unsigned long) + 39 3 0x2b13dda0ea0ap paddle::memory::detail::BuddyAllocator::RefillPool(unsigned long) + 58 4 0x2b13dda0f21fp paddle::memory::detail::BuddyAllocator::Alloc(unsigned long) + 719 5 0x2b13dd9eff05p void* paddle::memory::legacy::Allocpaddle::platform::CPUPlace(paddle::platform::CPUPlace const&, unsigned long) + 181 6 0x2b13dd9f0c35p paddle::memory::allocation::LegacyAllocator::AllocateImpl(unsigned long) + 405 7 0x2b13dd9ec533p paddle::memory::allocation::AllocatorFacade::Alloc(boost::variant<paddle::platform::CUDAPlace, paddle::platform::CPUPlace, paddle::platform::CUDAPinnedPlace, boost::detail::variant::void, boost::detail::variant::void, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_> const&, unsigned long) + 227 8 0x2b13dd9ec72ep paddle::memory::allocation::AllocatorFacade::AllocShared(boost::variant<paddle::platform::CUDAPlace, paddle::platform::CPUPlace, paddle::platform::CUDAPinnedPlace, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_> const&, unsigned long) + 30 9 0x2b13dd9d066cp paddle::memory::AllocShared(boost::variant<paddle::platform::CUDAPlace, paddle::platform::CPUPlace, paddle::platform::CUDAPinnedPlace, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_> const&, unsigned long) + 44 10 0x2b13dd9c9554p paddle::framework::Tensor::mutable_data(boost::variant<paddle::platform::CUDAPlace, paddle::platform::CPUPlace, paddle::platform::CUDAPinnedPlace, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_>, paddle::framework::proto::VarType_Type, unsigned long) + 148 11 0x2b13dc8a983ap float* paddle::framework::Tensor::mutable_data(boost::variant<paddle::platform::CUDAPlace, paddle::platform::CPUPlace, paddle::platform::CUDAPinnedPlace, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_>, unsigned long) + 74 12 0x2b13dce35772p paddle::operators::GRUCPUKernel::BatchCompute(paddle::framework::ExecutionContext const&) const + 482 13 0x2b13dce37533p std::Function_handler<void (paddle::framework::ExecutionContext const&), paddle::framework::OpKernelRegistrarFunctor<paddle::platform::CPUPlace, false, 0ul, paddle::operators::GRUCPUKernel, paddle::operators::GRUCPUKernel >::operator()(char const*, char const*, int) const::{lambda(paddle::framework::ExecutionContext const&)#1 (closed)}>::M_invoke(std::Any_data const&, paddle::framework::ExecutionContext const&) + 35 14 0x2b13dd98e547p paddle::framework::OperatorWithKernel::RunImpl(paddle::framework::Scope const&, boost::variant<paddle::platform::CUDAPlace, paddle::platform::CPUPlace, paddle::platform::CUDAPinnedPlace, boost::detail::variant::void, boost::detail::variant::void, boost::detail::variant::void, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_> const&, paddle::framework::RuntimeContext*) const + 375 15 0x2b13dd98ecb1p paddle::framework::OperatorWithKernel::RunImpl(paddle::framework::Scope const&, boost::variant<paddle::platform::CUDAPlace, paddle::platform::CPUPlace, paddle::platform::CUDAPinnedPlace, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_> const&) const + 529 16 0x2b13dd98cb5bp paddle::framework::OperatorBase::Run(paddle::framework::Scope const&, boost::variant<paddle::platform::CUDAPlace, paddle::platform::CPUPlace, paddle::platform::CUDAPinnedPlace, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_> const&) + 267 17 0x2b13dc7c6c9ep paddle::framework::Executor::RunPreparedContext(paddle::framework::ExecutorPrepareContext*, paddle::framework::Scope*, bool, bool, bool) + 206 18 0x2b13dc7c9d1fp paddle::framework::Executor::Run(paddle::framework::ProgramDesc const&, paddle::framework::Scope*, int, bool, bool, std::vector<std::string, std::allocatorstd::string > const&, bool) + 143 19 0x2b13dc639e9dp 20 0x2b13dc67697ep 21 0x4aadf7p _PyCFunction_FastCallKeywords + 775 22 0x541a15p 23 0x547191p _PyEval_EvalFrameDefault + 17665 24 0x5418c1p 25 0x541bbfp 26 0x54701dp _PyEval_EvalFrameDefault + 17293 27 0x5418c1p 28 0x541bbfp 29 0x54701dp _PyEval_EvalFrameDefault + 17293 30 0x5418c1p 31 0x54b116p _PyFunction_FastCallDict + 342 32 0x45224fp _PyObject_FastCallDict + 495 33 0x45234bp _PyObject_Call_Prepend + 203 34 0x452102p _PyObject_FastCallDict + 162 35 0x5a508ep 36 0x452102p _PyObject_FastCallDict + 162 37 0x452604p _PyObject_FastCallKeywords + 212 38 0x541a15p 39 0x54701dp _PyEval_EvalFrameDefault + 17293 40 0x5418c1p 41 0x5427bdp PyEval_EvalCodeEx + 109 42 0x482017p 43 0x451f20p PyObject_Call + 96 44 0x546f1cp _PyEval_EvalFrameDefault + 17036 45 0x540bb1p 46 0x541de7p 47 0x547191p _PyEval_EvalFrameDefault + 17665 48 0x540bb1p 49 0x541de7p 50 0x547191p _PyEval_EvalFrameDefault + 17665 51 0x540bb1p 52 0x541de7p 53 0x547191p _PyEval_EvalFrameDefault + 17665 54 0x540bb1p 55 0x54b1f6p _PyFunction_FastCallDict + 566 56 0x45224fp _PyObject_FastCallDict + 495 57 0x45234bp _PyObject_Call_Prepend + 203 58 0x451f20p PyObject_Call + 96 59 0x4c6093p 60 0x452102p _PyObject_FastCallDict + 162 61 0x541a15p 62 0x547191p _PyEval_EvalFrameDefault + 17665 63 0x5418c1p 64 0x54b116p _PyFunction_FastCallDict + 342 65 0x45224fp _PyObject_FastCallDict + 495 66 0x45234bp _PyObject_Call_Prepend + 203 67 0x451f20p PyObject_Call + 96 68 0x4c6093p 69 0x452102p _PyObject_FastCallDict + 162 70 0x541a15p 71 0x547191p _PyEval_EvalFrameDefault + 17665 72 0x540bb1p 73 0x541de7p 74 0x547191p _PyEval_EvalFrameDefault + 17665 75 0x475fecp _PyGen_Send + 124 76 0x549290p _PyEval_EvalFrameDefault + 26112 77 0x475fecp _PyGen_Send + 124 78 0x2b13b74db5bfp 79 0x451f20p PyObject_Call + 96 80 0x546f1cp _PyEval_EvalFrameDefault + 17036 81 0x540bb1p 82 0x541de7p 83 0x547191p _PyEval_EvalFrameDefault + 17665 84 0x540bb1p 85 0x541de7p 86 0x547191p _PyEval_EvalFrameDefault + 17665 87 0x540bb1p 88 0x541de7p 89 0x547191p _PyEval_EvalFrameDefault + 17665 90 0x540bb1p 91 0x541de7p 92 0x547191p _PyEval_EvalFrameDefault + 17665 93 0x5418c1p 94 0x542700p PyEval_EvalCode + 96 95 0x426738p PyRun_FileExFlags + 360 96 0x42691dp PyRun_SimpleFileExFlags + 221 97 0x43bb9ap Py_Main + 3402 98 0x41d922p main + 354 99 0x2b13aaecab35p __libc_start_main + 245