MATLAB Answers

Calling python module from matlab causes segmentation fault in h5py

26 views (last 30 days)
Philip Warrick
Philip Warrick on 27 Feb 2017
Commented: Kaixuan Chen on 11 Jan 2020
I was able to call my Python module from a Matlab system(...) call, but now I want to call it in memory using the Matlab Python interface.
From other posts I surmise that the Matlab and Python versions of the hdf5 library are different, but how do I avoid the conflict?
I am running
  • Matlab 2016b for Win64 and
  • Python 3.5.2 (Anaconda)
Here's a partial list of my python module versions (especially hdf5 and h5py)
D:\>conda list
# packages in environment at C:\Program Files\Anaconda3\envs\myEnv:
#
...
h5py 2.6.0 np111py35_2
hdf4 4.2.12 vc14_0 [vc14] conda-forge
hdf5 1.8.15.1 vc14_4 [vc14]
...
numpy 1.12.0 <pip>
Matlab's version of hdf5 is 1.8.12:
>> [majv, minv, rel] = H5.get_libversion()
majv =
1
minv =
8
rel =
12
>>
Below is the Matlab stack dump.
Thanks.
MATLAB crash file:C:\Users\philip\AppData\Local\Temp\matlab_crash_dump.14724-1:
------------------------------------------------------------------------
Access violation detected at Mon Feb 27 13:22:59 2017
------------------------------------------------------------------------
Configuration:
Crash Decoding : Disabled - No sandbox or build area path
Crash Mode : continue (default)
Current Graphics Driver: Unknown hardware
Default Encoding : windows-1252
Deployed : false
Graphics card 1 : NVIDIA ( 0x10de ) NVIDIA TITAN X (Pascal) Version 21.21.13.7653
Graphics card 2 : NVIDIA ( 0x10de ) NVIDIA TITAN X (Pascal) Version 21.21.13.7653
Host Name : RDTITAN
MATLAB Architecture : win64
MATLAB Entitlement ID: 688568
MATLAB Root : C:\Program Files\MATLAB\R2016b
MATLAB Version : 9.1.0.441655 (R2016b)
OpenGL : hardware
Operating System : Microsoft Windows 10 Pro
Processor ID : x86 Family 6 Model 79 Stepping 1, GenuineIntel
Virtual Machine : Java 1.7.0_60-b19 with Oracle Corporation Java HotSpot(TM) 64-Bit Server VM mixed mode
Window System : Version 10.0 (Build 14393)
Fault Count: 1
Abnormal termination:
Access violation
Register State (from fault):
RAX = 000000003e0a9558 RBX = 0000000000000000
RCX = 0000000003000059 RDX = 0000000000000000
RSP = 00000000043f9178 RBP = 00000000e465c408
RSI = 00000000f6cd59d0 RDI = 00000000abf80af8
R8 = 00007ff9b227d730 R9 = 00000000a3200000
R10 = 000000000000001f R11 = 00000000b3641c20
R12 = 00000000430bbb70 R13 = 00007ff9b2274fa0
R14 = 00000000043f9288 R15 = 0000000000000000
RIP = 0000000000000000 EFL = 00010206
CS = 0033 FS = 0053 GS = 002b
Stack Trace (from fault):
[ 0] 0x0000000000000000 <unknown-module>+00000000
[ 1] 0x00007ff9b2275039 C:\Program Files\Anaconda3\envs\tensorflowGPU\lib\site-packages\h5py\_conv.cp35-win_amd64.pyd+00020537 PyInit__conv+00006969
[ 2] 0x00007ff9b2274fa9 C:\Program Files\Anaconda3\envs\tensorflowGPU\lib\site-packages\h5py\_conv.cp35-win_amd64.pyd+00020393 PyInit__conv+00006825
[ 3] 0x00000000a3389b77 C:\Program Files\Anaconda3\envs\tensorflowGPU\python35.dll+01612663 PyEval_GetFuncDesc+00000455
[ 4] 0x00000000a3386aeb C:\Program Files\Anaconda3\envs\tensorflowGPU\python35.dll+01600235 PyEval_EvalFrameEx+00012923
[ 5] 0x00000000a33889de C:\Program Files\Anaconda3\envs\tensorflowGPU\python35.dll+01608158 PyEval_EvalFrameEx+00020846
[ 6] 0x00000000a3383858 C:\Program Files\Anaconda3\envs\tensorflowGPU\python35.dll+01587288 PyEval_EvalCode+00000056
[ 7] 0x00000000a337f073 C:\Program Files\Anaconda3\envs\tensorflowGPU\python35.dll+01568883 PyAST_FromNode+00033331
[ 8] 0x00000000a337d522 C:\Program Files\Anaconda3\envs\tensorflowGPU\python35.dll+01561890 PyAST_FromNode+00026338
[ 9] 0x00000000a330e2c2 C:\Program Files\Anaconda3\envs\tensorflowGPU\python35.dll+01106626 PyCFunction_Call+00000290
[ 10] 0x00000000a338a6fd C:\Program Files\Anaconda3\envs\tensorflowGPU\python35.dll+01615613 PyEval_GetFuncDesc+00003405
[ 11] 0x00000000a3386b90 C:\Program Files\Anaconda3\envs\tensorflowGPU\python35.dll+01600400 PyEval_EvalFrameEx+00013088
[ 12] 0x00000000a33889de C:\Program Files\Anaconda3\envs\tensorflowGPU\python35.dll+01608158 PyEval_EvalFrameEx+00020846
[ 13] 0x00000000a3389fb0 C:\Program Files\Anaconda3\envs\tensorflowGPU\python35.dll+01613744 PyEval_GetFuncDesc+00001536
[ 14] 0x00000000a3389de1 C:\Program Files\Anaconda3\envs\tensorflowGPU\python35.dll+01613281 PyEval_GetFuncDesc+00001073
[ 15] 0x00000000a3386aeb C:\Program Files\Anaconda3\envs\tensorflowGPU\python35.dll+01600235 PyEval_EvalFrameEx+00012923
[ 16] 0x00000000a3389f28 C:\Program Files\Anaconda3\envs\tensorflowGPU\python35.dll+01613608 PyEval_GetFuncDesc+00001400
[ 17] 0x00000000a3389de1 C:\Program Files\Anaconda3\envs\tensorflowGPU\python35.dll+01613281 PyEval_GetFuncDesc+00001073
[ 18] 0x00000000a3386aeb C:\Program Files\Anaconda3\envs\tensorflowGPU\python35.dll+01600235 PyEval_EvalFrameEx+00012923
[ 19] 0x00000000a3389f28 C:\Program Files\Anaconda3\envs\tensorflowGPU\python35.dll+01613608 PyEval_GetFuncDesc+00001400
[ 20] 0x00000000a3389de1 C:\Program Files\Anaconda3\envs\tensorflowGPU\python35.dll+01613281 PyEval_GetFuncDesc+00001073
[ 21] 0x00000000a3386aeb C:\Program Files\Anaconda3\envs\tensorflowGPU\python35.dll+01600235 PyEval_EvalFrameEx+00012923
[ 22] 0x00000000a3389f28 C:\Program Files\Anaconda3\envs\tensorflowGPU\python35.dll+01613608 PyEval_GetFuncDesc+00001400
[ 23] 0x00000000a3389de1 C:\Program Files\Anaconda3\envs\tensorflowGPU\python35.dll+01613281 PyEval_GetFuncDesc+00001073
[ 24] 0x00000000a3386aeb C:\Program Files\Anaconda3\envs\tensorflowGPU\python35.dll+01600235 PyEval_EvalFrameEx+00012923
[ 25] 0x00000000a33889de C:\Program Files\Anaconda3\envs\tensorflowGPU\python35.dll+01608158 PyEval_EvalFrameEx+00020846
[ 26] 0x00000000a32f84f1 C:\Program Files\Anaconda3\envs\tensorflowGPU\python35.dll+01017073 PyFunction_SetAnnotations+00002929
[ 27] 0x00000000a32c5df8 C:\Program Files\Anaconda3\envs\tensorflowGPU\python35.dll+00810488 PyObject_Call+00000120
[ 28] 0x00000000a32c6508 C:\Program Files\Anaconda3\envs\tensorflowGPU\python35.dll+00812296 PyObject_CallMethodIdObjArgs+00000152
[ 29] 0x00000000a33a674d C:\Program Files\Anaconda3\envs\tensorflowGPU\python35.dll+01730381 PyImport_ImportModuleLevelObject+00001981
[ 30] 0x00000000a337df9f C:\Program Files\Anaconda3\envs\tensorflowGPU\python35.dll+01564575 PyAST_FromNode+00029023
[ 31] 0x00000000a330e1d0 C:\Program Files\Anaconda3\envs\tensorflowGPU\python35.dll+01106384 PyCFunction_Call+00000048
[ 32] 0x00000000a32c5df8 C:\Program Files\Anaconda3\envs\tensorflowGPU\python35.dll+00810488 PyObject_Call+00000120
[ 33] 0x00000000a338992c C:\Program Files\Anaconda3\envs\tensorflowGPU\python35.dll+01612076 PyEval_CallObjectWithKeywords+00000204
[ 34] 0x00000000a3386168 C:\Program Files\Anaconda3\envs\tensorflowGPU\python35.dll+01597800 PyEval_EvalFrameEx+00010488
[ 35] 0x00000000a33889de C:\Program Files\Anaconda3\envs\tensorflowGPU\python35.dll+01608158 PyEval_EvalFrameEx+00020846
[ 36] 0x00000000a3389fb0 C:\Program Files\Anaconda3\envs\tensorflowGPU\python35.dll+01613744 PyEval_GetFuncDesc+00001536
[ 37] 0x00000000a3389de1 C:\Program Files\Anaconda3\envs\tensorflowGPU\python35.dll+01613281 PyEval_GetFuncDesc+00001073
[ 38] 0x00000000a3386aeb C:\Program Files\Anaconda3\envs\tensorflowGPU\python35.dll+01600235 PyEval_EvalFrameEx+00012923
[ 39] 0x00000000a33889de C:\Program Files\Anaconda3\envs\tensorflowGPU\python35.dll+01608158 PyEval_EvalFrameEx+00020846
[ 40] 0x00000000a3389fb0 C:\Program Files\Anaconda3\envs\tensorflowGPU\python35.dll+01613744 PyEval_GetFuncDesc+00001536
[ 41] 0x00000000a3389de1 C:\Program Files\Anaconda3\envs\tensorflowGPU\python35.dll+01613281 PyEval_GetFuncDesc+00001073
[ 42] 0x00000000a3386aeb C:\Program Files\Anaconda3\envs\tensorflowGPU\python35.dll+01600235 PyEval_EvalFrameEx+00012923
[ 43] 0x00000000a33889de C:\Program Files\Anaconda3\envs\tensorflowGPU\python35.dll+01608158 PyEval_EvalFrameEx+00020846
[ 44] 0x00000000a3389fb0 C:\Program Files\Anaconda3\envs\tensorflowGPU\python35.dll+01613744 PyEval_GetFuncDesc+00001536
[ 45] 0x00000000a3389de1 C:\Program Files\Anaconda3\envs\tensorflowGPU\python35.dll+01613281 PyEval_GetFuncDesc+00001073
[ 46] 0x00000000a3386aeb C:\Program Files\Anaconda3\envs\tensorflowGPU\python35.dll+01600235 PyEval_EvalFrameEx+00012923
[ 47] 0x00000000a33889de C:\Program Files\Anaconda3\envs\tensorflowGPU\python35.dll+01608158 PyEval_EvalFrameEx+00020846
[ 48] 0x00000000a3389fb0 C:\Program Files\Anaconda3\envs\tensorflowGPU\python35.dll+01613744 PyEval_GetFuncDesc+00001536
[ 49] 0x00000000a3389de1 C:\Program Files\Anaconda3\envs\tensorflowGPU\python35.dll+01613281 PyEval_GetFuncDesc+00001073
[ 50] 0x00000000a3386aeb C:\Program Files\Anaconda3\envs\tensorflowGPU\python35.dll+01600235 PyEval_EvalFrameEx+00012923
[ 51] 0x00000000a33889de C:\Program Files\Anaconda3\envs\tensorflowGPU\python35.dll+01608158 PyEval_EvalFrameEx+00020846
[ 52] 0x00000000a3389fb0 C:\Program Files\Anaconda3\envs\tensorflowGPU\python35.dll+01613744 PyEval_GetFuncDesc+00001536
[ 53] 0x00000000a3389de1 C:\Program Files\Anaconda3\envs\tensorflowGPU\python35.dll+01613281 PyEval_GetFuncDesc+00001073
[ 54] 0x00000000a3386aeb C:\Program Files\Anaconda3\envs\tensorflowGPU\python35.dll+01600235 PyEval_EvalFrameEx+00012923
[ 55] 0x00000000a33889de C:\Program Files\Anaconda3\envs\tensorflowGPU\python35.dll+01608158 PyEval_EvalFrameEx+00020846
[ 56] 0x00000000a3389fb0 C:\Program Files\Anaconda3\envs\tensorflowGPU\python35.dll+01613744 PyEval_GetFuncDesc+00001536
[ 57] 0x00000000a3389de1 C:\Program Files\Anaconda3\envs\tensorflowGPU\python35.dll+01613281 PyEval_GetFuncDesc+00001073
[ 58] 0x00000000a3386aeb C:\Program Files\Anaconda3\envs\tensorflowGPU\python35.dll+01600235 PyEval_EvalFrameEx+00012923
[ 59] 0x00000000a33889de C:\Program Files\Anaconda3\envs\tensorflowGPU\python35.dll+01608158 PyEval_EvalFrameEx+00020846
[ 60] 0x00000000a3389fb0 C:\Program Files\Anaconda3\envs\tensorflowGPU\python35.dll+01613744 PyEval_GetFuncDesc+00001536
[ 61] 0x00000000a3389de1 C:\Program Files\Anaconda3\envs\tensorflowGPU\python35.dll+01613281 PyEval_GetFuncDesc+00001073
[ 62] 0x00000000a3386aeb C:\Program Files\Anaconda3\envs\tensorflowGPU\python35.dll+01600235 PyEval_EvalFrameEx+00012923
[ 63] 0x00000000a3389f28 C:\Program Files\Anaconda3\envs\tensorflowGPU\python35.dll+01613608 PyEval_GetFuncDesc+00001400
[ 64] 0x00000000a3389de1 C:\Program Files\Anaconda3\envs\tensorflowGPU\python35.dll+01613281 PyEval_GetFuncDesc+00001073
[ 65] 0x00000000a3386aeb C:\Program Files\Anaconda3\envs\tensorflowGPU\python35.dll+01600235 PyEval_EvalFrameEx+00012923
[ 66] 0x00000000a33889de C:\Program Files\Anaconda3\envs\tensorflowGPU\python35.dll+01608158 PyEval_EvalFrameEx+00020846
[ 67] 0x00000000a32f84f1 C:\Program Files\Anaconda3\envs\tensorflowGPU\python35.dll+01017073 PyFunction_SetAnnotations+00002929
[ 68] 0x00000000a32c5df8 C:\Program Files\Anaconda3\envs\tensorflowGPU\python35.dll+00810488 PyObject_Call+00000120
[ 69] 0x00000000a8014d2f C:\Program Files\MATLAB\R2016b\bin\win64\pycli.dll+00085295
[ 70] 0x00000000a801142b C:\Program Files\MATLAB\R2016b\bin\win64\pycli.dll+00070699
[ 71] 0x00000000a80230cb C:\Program Files\MATLAB\R2016b\bin\win64\pycli.dll+00143563
[ 72] 0x000000001dab946a C:\Program Files\MATLAB\R2016b\bin\win64\mcos_impl.dll+00103530
[ 73] 0x000000001dab8fbd C:\Program Files\MATLAB\R2016b\bin\win64\mcos_impl.dll+00102333
[ 74] 0x000000001dab8791 C:\Program Files\MATLAB\R2016b\bin\win64\mcos_impl.dll+00100241
[ 75] 0x000000001daf0dbe C:\Program Files\MATLAB\R2016b\bin\win64\mcos_impl.dll+00331198 mcos::plugins::init__pm_init+00015206
[ 76] 0x000000001dac00e5 C:\Program Files\MATLAB\R2016b\bin\win64\mcos_impl.dll+00131301
[ 77] 0x0000000015c061c5 C:\Program Files\MATLAB\R2016b\bin\win64\mcos.dll+00090565 omDirectCallMethod+00000069
[ 78] 0x0000000018af485b C:\Program Files\MATLAB\R2016b\bin\win64\libmwlxeindexing.dll+00084059 MathWorks::lxe::IIndexingContext::HasSubsrefForDot+00002743
[ 79] 0x0000000018af5f1c C:\Program Files\MATLAB\R2016b\bin\win64\libmwlxeindexing.dll+00089884 MathWorks::lxe::concatenate+00002460
[ 80] 0x0000000018af23a4 C:\Program Files\MATLAB\R2016b\bin\win64\libmwlxeindexing.dll+00074660 MathWorks::lxe::at_rdot_guarantee_id_1+00001028
[ 81] 0x0000000018af23a4 C:\Program Files\MATLAB\R2016b\bin\win64\libmwlxeindexing.dll+00074660 MathWorks::lxe::at_rdot_guarantee_id_1+00001028
[ 82] 0x0000000018af6d40 C:\Program Files\MATLAB\R2016b\bin\win64\libmwlxeindexing.dll+00093504 MathWorks::lxe::DereferenceRplaceToXvalueZeroOutputs+00000044
[ 83] 0x0000000018af6c5f C:\Program Files\MATLAB\R2016b\bin\win64\libmwlxeindexing.dll+00093279 MathWorks::lxe::at_rparen0+00000383
[ 84] 0x0000000016b7ef7a C:\Program Files\MATLAB\R2016b\bin\win64\m_lxe.dll+01896314 boost::serialization::singleton<boost::serialization::void_cast_detail::void_caster_primitive<ir::IrTree,MathWorks::utl::attachment> >::get_instance+00341054
[ 85] 0x0000000016a9728f C:\Program Files\MATLAB\R2016b\bin\win64\m_lxe.dll+00946831 boost::serialization::singleton<boost::archive::detail::iserializer<boost::archive::binaryTerm_iarchive,ir::IrTree> >::get_instance+00857755
[ 86] 0x0000000016a97b75 C:\Program Files\MATLAB\R2016b\bin\win64\m_lxe.dll+00949109 boost::serialization::singleton<boost::archive::detail::iserializer<boost::archive::binaryTerm_iarchive,ir::IrTree> >::get_instance+00860033
[ 87] 0x0000000016a99151 C:\Program Files\MATLAB\R2016b\bin\win64\m_lxe.dll+00954705 boost::serialization::singleton<boost::archive::detail::iserializer<boost::archive::binaryTerm_iarchive,ir::IrTree> >::get_instance+00865629
[ 88] 0x0000000016a99c95 C:\Program Files\MATLAB\R2016b\bin\win64\m_lxe.dll+00957589 boost::serialization::singleton<boost::archive::detail::iserializer<boost::archive::binaryTerm_iarchive,ir::IrTree> >::get_instance+00868513
[ 89] 0x0000000016a9932f C:\Program Files\MATLAB\R2016b\bin\win64\m_lxe.dll+00955183 boost::serialization::singleton<boost::archive::detail::iserializer<boost::archive::binaryTerm_iarchive,ir::IrTree> >::get_instance+00866107
[ 90] 0x0000000016a9940d C:\Program Files\MATLAB\R2016b\bin\win64\m_lxe.dll+00955405 boost::serialization::singleton<boost::archive::detail::iserializer<boost::archive::binaryTerm_iarchive,ir::IrTree> >::get_instance+00866329
[ 91] 0x0000000016a88041 C:\Program Files\MATLAB\R2016b\bin\win64\m_lxe.dll+00884801 boost::serialization::singleton<boost::archive::detail::iserializer<boost::archive::binaryTerm_iarchive,ir::IrTree> >::get_instance+00795725
[ 92] 0x0000000016a09eab C:\Program Files\MATLAB\R2016b\bin\win64\m_lxe.dll+00368299 boost::serialization::singleton<boost::archive::detail::iserializer<boost::archive::binaryTerm_iarchive,ir::IrTree> >::get_instance+00279223
[ 93] 0x0000000016a09740 C:\Program Files\MATLAB\R2016b\bin\win64\m_lxe.dll+00366400 boost::serialization::singleton<boost::archive::detail::iserializer<boost::archive::binaryTerm_iarchive,ir::IrTree> >::get_instance+00277324
[ 94] 0x0000000016a03f8f C:\Program Files\MATLAB\R2016b\bin\win64\m_lxe.dll+00343951 boost::serialization::singleton<boost::archive::detail::iserializer<boost::archive::binaryTerm_iarchive,ir::IrTree> >::get_instance+00254875
[ 95] 0x0000000016a03aa1 C:\Program Files\MATLAB\R2016b\bin\win64\m_lxe.dll+00342689 boost::serialization::singleton<boost::archive::detail::iserializer<boost::archive::binaryTerm_iarchive,ir::IrTree> >::get_instance+00253613
[ 96] 0x0000000016a03991 C:\Program Files\MATLAB\R2016b\bin\win64\m_lxe.dll+00342417 boost::serialization::singleton<boost::archive::detail::iserializer<boost::archive::binaryTerm_iarchive,ir::IrTree> >::get_instance+00253341
[ 97] 0x0000000016b903e9 C:\Program Files\MATLAB\R2016b\bin\win64\m_lxe.dll+01967081 boost::serialization::singleton<boost::archive::detail::oserializer<boost::archive::polymorphic_oarchive,foundation::msg_svc::eventmgr::BaseEvent> >::get_instance+00003353
[ 98] 0x0000000016b90372 C:\Program Files\MATLAB\R2016b\bin\win64\m_lxe.dll+01966962 boost::serialization::singleton<boost::archive::detail::oserializer<boost::archive::polymorphic_oarchive,foundation::msg_svc::eventmgr::BaseEvent> >::get_instance+00003234
[ 99] 0x0000000016a52a61 C:\Program Files\MATLAB\R2016b\bin\win64\m_lxe.dll+00666209 boost::serialization::singleton<boost::archive::detail::iserializer<boost::archive::binaryTerm_iarchive,ir::IrTree> >::get_instance+00577133
[100] 0x000000001603b3bd C:\Program Files\MATLAB\R2016b\bin\win64\m_interpreter.dll+00504765 inEvalCmdWithLocalReturn+00000065
[101] 0x00000000fb608ced C:\Program Files\MATLAB\R2016b\bin\win64\libmwbridge.dll+00101613 mnGetPrompt+00012957
[102] 0x00000000fb609ba3 C:\Program Files\MATLAB\R2016b\bin\win64\libmwbridge.dll+00105379 mnParser+00001091
[103] 0x0000000015cc6841 C:\Program Files\MATLAB\R2016b\bin\win64\mcr.dll+00223297 mcr::runtime::setInterpreterThreadToCurrent+00025585
[104] 0x0000000015cc57d7 C:\Program Files\MATLAB\R2016b\bin\win64\mcr.dll+00219095 mcr::runtime::setInterpreterThreadToCurrent+00021383
[105] 0x0000000015cc5853 C:\Program Files\MATLAB\R2016b\bin\win64\mcr.dll+00219219 mcr::runtime::setInterpreterThreadToCurrent+00021507
[106] 0x0000000015cc6141 C:\Program Files\MATLAB\R2016b\bin\win64\mcr.dll+00221505 mcr::runtime::setInterpreterThreadToCurrent+00023793
[107] 0x00000000fd01d347 C:\Program Files\MATLAB\R2016b\bin\win64\iqm.dll+00578375 iqm::UserEvalPlugin::pre+00030679
[108] 0x00000000fd029e7c C:\Program Files\MATLAB\R2016b\bin\win64\iqm.dll+00630396 iqm::UserEvalPlugin::pre+00082700
[109] 0x00000000fd017480 C:\Program Files\MATLAB\R2016b\bin\win64\iqm.dll+00554112 iqm::UserEvalPlugin::pre+00006416
[110] 0x00000000fd02c99a C:\Program Files\MATLAB\R2016b\bin\win64\iqm.dll+00641434 iqm::UserEvalPlugin::pre+00093738
[111] 0x00000000fcff9a37 C:\Program Files\MATLAB\R2016b\bin\win64\iqm.dll+00432695 iqm::PackagedTaskPlugin::PackagedTaskPlugin+00000727
[112] 0x00000000fcffa08f C:\Program Files\MATLAB\R2016b\bin\win64\iqm.dll+00434319 iqm::PackagedTaskPlugin::execute+00000575
[113] 0x00000000fcff9aa9 C:\Program Files\MATLAB\R2016b\bin\win64\iqm.dll+00432809 iqm::PackagedTaskPlugin::PackagedTaskPlugin+00000841
[114] 0x00000000fcff9f04 C:\Program Files\MATLAB\R2016b\bin\win64\iqm.dll+00433924 iqm::PackagedTaskPlugin::execute+00000180
[115] 0x00000000fcfd42fa C:\Program Files\MATLAB\R2016b\bin\win64\iqm.dll+00279290 iqm::Iqm::setupIqmFcnPtrs+00071530
[116] 0x00000000fcfd41d3 C:\Program Files\MATLAB\R2016b\bin\win64\iqm.dll+00278995 iqm::Iqm::setupIqmFcnPtrs+00071235
[117] 0x00000000fcfb9e5a C:\Program Files\MATLAB\R2016b\bin\win64\iqm.dll+00171610 iqm::Iqm::deliver+00003274
[118] 0x00000000fcfbad2f C:\Program Files\MATLAB\R2016b\bin\win64\iqm.dll+00175407 iqm::Iqm::deliver+00007071
[119] 0x0000000100108173 C:\Program Files\MATLAB\R2016b\bin\win64\libmwservices.dll+01147251 services::system_events::PpeDispatchHook::dispatchOne+00019059
[120] 0x000000010010c3a3 C:\Program Files\MATLAB\R2016b\bin\win64\libmwservices.dll+01164195 sysq::addProcessPendingEventsUnitTestHook+00001923
[121] 0x000000010010c580 C:\Program Files\MATLAB\R2016b\bin\win64\libmwservices.dll+01164672 sysq::addProcessPendingEventsUnitTestHook+00002400
[122] 0x000000010010d685 C:\Program Files\MATLAB\R2016b\bin\win64\libmwservices.dll+01169029 sysq::getCondition+00002917
[123] 0x000000010010e4b2 C:\Program Files\MATLAB\R2016b\bin\win64\libmwservices.dll+01172658 svWS_ProcessPendingEvents+00000162
[124] 0x0000000015cc6b7d C:\Program Files\MATLAB\R2016b\bin\win64\mcr.dll+00224125 mcr::runtime::setInterpreterThreadToCurrent+00026413
[125] 0x0000000015cc726a C:\Program Files\MATLAB\R2016b\bin\win64\mcr.dll+00225898 mcr::runtime::setInterpreterThreadToCurrent+00028186
[126] 0x0000000015cbe385 C:\Program Files\MATLAB\R2016b\bin\win64\mcr.dll+00189317 mcr_process_events+00010293
[127] 0x0000000015cc02d2 C:\Program Files\MATLAB\R2016b\bin\win64\mcr.dll+00197330 mcr_process_events+00018306

  1 Comment

Philip Warrick
Philip Warrick on 28 Feb 2017
Addendum: I can cause this fault with this single command in Matlab:
tryThis = py.h5py.h5py

Sign in to comment.

Answers (4)

Mason Freed
Mason Freed on 9 Mar 2017
Philip, did you get an answer to this question? I'm having exactly the same issue: segfault when doing anything with h5py, and I'm also using Anaconda 3.5. I don't want to go through the trouble of installing another distribution, unless I knew it would solve this problem. (Installing Python and getting it "hooked up" to Matlab is non-trivial and quite frustrating.) Let me know if you found any workaround!

  0 Comments

Sign in to comment.


Robert Snoeberger
Robert Snoeberger on 3 Mar 2017
Could you rebuild h5py with hdf5 version 1.8.12?

  1 Comment

Philip Warrick
Philip Warrick on 3 Mar 2017
From the h5py website:
"Installing from source on Windows is effectively impossible because of the C library dependencies involved."
I looked instead for an older h5py version that bundled hdf5 1.8.12 but that's hard to track down or determine.

Sign in to comment.


Sid Jhaveri
Sid Jhaveri on 2 Mar 2017
Hi Philip,
MATLAB does not support Python Anaconda. Please download and install 64-bit CPython implementation of Python from https://www.python.org/downloads/.

  1 Comment

Philip Warrick
Philip Warrick on 3 Mar 2017
As I understand it, Anaconda is just a repackaging of CPython with better tools to manage environments. So I expect that I would run into the same conflict with CPython. The question is how to deal with the conflict. It seems that it is possible on linux/os-x with the preload environment variable. The question is how to do it on Windows.

Sign in to comment.


Martin Andersen
Martin Andersen on 16 Dec 2017
I encountered a similar problem with the Linux version of MATLAB, and the issue turned out to be a library conflict similar to the one reported in this thread. The issue in my case was that MATLAB's MKL library was being loaded instead of the BLAS library that the Python extension was supposed to use. A fix is either to set the LD_PRELOAD environment variable before starting MATLAB or to run the following line before loading any Python modules:
py.sys.setdlopenflags(int32(10)); % Set RTLD_NOW and RTLD_DEEPBIND
The function sys.setdlopenflags is Unix-only, and unfortunately I do not know if a similar fix is available in Windows.
As a remark, I should mention that the above call to py.sys.setdlopenflags does not seem to have the desired effect if Python has already been loaded (see pyversion). Curiously, that appears to imply that it has to run as a script since any function that calls Python somehow seems to "preload" Python: if you create and call the following function first thing after launching MATLAB,
function my_init()
pyversion
py.sys.setdlopenflags(int32(10));
pyversion
end
you will see that both calls to pyversion return loaded equal to 1. However, if you instead create and run the following script (after restarting MATLAB)
pyversion
py.sys.setdlopenflags(int32(10));
pyversion
then the first call to pyversion returns loaded equal to 0 whereas the second call returns loaded equal to 1.

  5 Comments

Show 2 older comments
Michael Thieme
Michael Thieme on 18 Oct 2018
Ann, any luck on implementing this solution on Windows? I just went down a rabit hole of dll injection, but I'm hoping there is a better solution to this issue.

Sign in to comment.

Sign in to answer this question.