Сбой Python EXC_BAD_ACCESS - PullRequest
0 голосов
/ 01 мая 2018

Я установил Matlab Engine и получил ошибку сегментации во время работы start_matlab, а не во время import matlab.engine:

import matlab.engine
matlab.engine.start_matlab()

Python устанавливается с использованием brew (brew install python). Вот журнал из Mac OSX High Sierra:

Process:               Python [1174]
Path:                  /usr/local/Cellar/python@2/2.7.14_3/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python
Identifier:            Python
Version:               2.7.14 (2.7.14)
Code Type:             X86-64 (Native)
Parent Process:        bash [1148]
Responsible:           Python [1174]
User ID:               501

Date/Time:             2018-05-01 16:19:01.750 +0700
OS Version:            Mac OS X 10.13.4 (17E199)
Report Version:        12
Anonymous UUID:        885790DC-B32C-0363-903C-837A7C285AF3


Time Awake Since Boot: 1700 seconds

System Integrity Protection: enabled

Crashed Thread:        3

Exception Type:        EXC_BAD_ACCESS (SIGSEGV)
Exception Codes:       KERN_INVALID_ADDRESS at 0x0000000000000090
Exception Note:        EXC_CORPSE_NOTIFY

Termination Signal:    Segmentation fault: 11
Termination Reason:    Namespace SIGNAL, Code 0xb
Terminating Process:   exc handler [0]

VM Regions Near 0x90:
--> 
    __TEXT                 000000010d445000-000000010d447000 [    8K] r-x/rwx SM=COW  /usr/local/Cellar/python@2/2.7.14_3/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python

Thread 0:: Dispatch queue: com.apple.main-thread
0   libsystem_kernel.dylib          0x00007fff62b96a1e __psynch_cvwait + 10
1   libsystem_pthread.dylib         0x00007fff62d5f589 _pthread_cond_wait + 732
2   libc++.1.dylib                  0x00007fff609a4d43 std::__1::condition_variable::__do_timed_wait(std::__1::unique_lock<std::__1::mutex>&, std::__1::chrono::time_point<std::__1::chrono::system_clock, std::__1::chrono::duration<long long, std::__1::ratio<1l, 1000000000l> > >) + 93
3   libmwengine_api.dylib           0x000000010dd623c3 0x10dd4c000 + 91075
4   libmwengine_api.dylib           0x000000010dd622e8 0x10dd4c000 + 90856
5   libmwengine_api.dylib           0x000000010dd4fdef engine_api::waitMATLAB(unsigned long long, double) + 271
6   matlabengineforpython2_7.so     0x000000010d8a3413 MatlabEngine::waitForMATLAB(_object*, _object*) + 67
7   org.python.python               0x000000010d4d10bc PyEval_EvalFrameEx + 13307
8   org.python.python               0x000000010d4d4759 fast_function + 196
9   org.python.python               0x000000010d4d0c28 PyEval_EvalFrameEx + 12135
10  org.python.python               0x000000010d4cdaaa PyEval_EvalCodeEx + 1562
11  org.python.python               0x000000010d4d47b7 fast_function + 290
12  org.python.python               0x000000010d4d0c28 PyEval_EvalFrameEx + 12135
13  org.python.python               0x000000010d4cdaaa PyEval_EvalCodeEx + 1562
14  org.python.python               0x000000010d4d47b7 fast_function + 290
15  org.python.python               0x000000010d4d0c28 PyEval_EvalFrameEx + 12135
16  org.python.python               0x000000010d4cdaaa PyEval_EvalCodeEx + 1562
17  org.python.python               0x000000010d4d47b7 fast_function + 290
18  org.python.python               0x000000010d4d0c28 PyEval_EvalFrameEx + 12135
19  org.python.python               0x000000010d4cdaaa PyEval_EvalCodeEx + 1562
20  org.python.python               0x000000010d4cd48a PyEval_EvalCode + 32
21  org.python.python               0x000000010d4eca2f run_mod + 49
22  org.python.python               0x000000010d4ec86c PyRun_InteractiveOneFlags + 344
23  org.python.python               0x000000010d4ec30f PyRun_InteractiveLoopFlags + 87
24  org.python.python               0x000000010d4ec224 PyRun_AnyFileExFlags + 60
25  org.python.python               0x000000010d4fe030 Py_Main + 3136
26  libdyld.dylib                   0x00007fff62a46015 start + 1

Thread 1:
0   libsystem_kernel.dylib          0x00007fff62b97292 __workq_kernreturn + 10
1   libsystem_pthread.dylib         0x00007fff62d5e20e _pthread_wqthread + 1552
2   libsystem_pthread.dylib         0x00007fff62d5dbe9 start_wqthread + 13

Thread 2:
0   libsystem_kernel.dylib          0x00007fff62b97292 __workq_kernreturn + 10
1   libsystem_pthread.dylib         0x00007fff62d5e009 _pthread_wqthread + 1035
2   libsystem_pthread.dylib         0x00007fff62d5dbe9 start_wqthread + 13

Thread 3 Crashed:
0   libmwmvm.dylib                  0x00000001107b6538 mvm::detail::DefaultRemoteFactory::privateReadHelloReply(std::__1::unique_ptr<foundation::msg_svc::transport::sync::IOStreamTransport, std::__1::default_delete<foundation::msg_svc::transport::sync::IOStreamTransport> > const&) + 40
1   libmwmvm.dylib                  0x00000001107b6ad7 mvm::detail::DefaultRemoteFactory::protectedLaunch() + 87
2   libmwmvm.dylib                  0x00000001107e170b mvm::detail::MatlabFactory::create(mwboost::shared_ptr<mvm::detail::SessionImpl> const&, mvm::FactoryOptions const&, mvm::ShutdownPolicy, bool, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) + 315
3   libmwmvm.dylib                  0x00000001107e1555 mvm::MatlabFactory::createFactory(mwboost::shared_ptr<mvm::Session> const&, mvm::FactoryOptions const&, mvm::ShutdownPolicy, bool, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) + 53
4   libmwengine_api.dylib           0x000000010dd4df56 0x10dd4c000 + 8022
5   libmwengine_api.dylib           0x000000010dd61844 0x10dd4c000 + 88132
6   libmwengine_api.dylib           0x000000010dd616aa 0x10dd4c000 + 87722
7   libmwengine_api.dylib           0x000000010dd61951 void* std::__1::__thread_proxy<std::__1::tuple<void (std::__1::__async_assoc_state<unsigned long long, std::__1::__async_func<unsigned long long (*)(std::__1::vector<std::__1::basic_string<char16_t, std::__1::char_traits<char16_t>, std::__1::allocator<char16_t> >, std::__1::allocator<std::__1::basic_string<char16_t, std::__1::char_traits<char16_t>, std::__1::allocator<char16_t> > > >), std::__1::vector<std::__1::basic_string<char16_t, std::__1::char_traits<char16_t>, std::__1::allocator<char16_t> >, std::__1::allocator<std::__1::basic_string<char16_t, std::__1::char_traits<char16_t>, std::__1::allocator<char16_t> > > > > >::*)(), std::__1::__async_assoc_state<unsigned long long, std::__1::__async_func<unsigned long long (*)(std::__1::vector<std::__1::basic_string<char16_t, std::__1::char_traits<char16_t>, std::__1::allocator<char16_t> >, std::__1::allocator<std::__1::basic_string<char16_t, std::__1::char_traits<char16_t>, std::__1::allocator<char16_t> > > >), std::__1::vector<std::__1::basic_string<char16_t, std::__1::char_traits<char16_t>, std::__1::allocator<char16_t> >, std::__1::allocator<std::__1::basic_string<char16_t, std::__1::char_traits<char16_t>, std::__1::allocator<char16_t> > > > > >*> >(void*) + 113
8   libsystem_pthread.dylib         0x00007fff62d5e661 _pthread_body + 340
9   libsystem_pthread.dylib         0x00007fff62d5e50d _pthread_start + 377
10  libsystem_pthread.dylib         0x00007fff62d5dbf9 thread_start + 13

Thread 3 crashed with X86 Thread State (64-bit):
  rax: 0x0000000000000000  rbx: 0x0000700000c46a08  rcx: 0x00000000000000b0  rdx: 0x00000000ffffffff
  rdi: 0x0000700000c46850  rsi: 0x00007fc939d3b200  rbp: 0x0000700000c46950  rsp: 0x0000700000c46910
   r8: 0x0000000000000086   r9: 0xffffffff00000000  r10: 0x000000000000001c  r11: 0x0000000000000202
  r12: 0x00007fc93b802000  r13: 0x0000000000000001  r14: 0x0000700000c469f0  r15: 0x8e1ae967067d00d6
  rip: 0x00000001107b6538  rfl: 0x0000000000010206  cr2: 0x0000000000000090

Logical CPU:     3
Error Code:      0x00000004
Trap Number:     14
...