Error in mex file which is properly used before

1 view (last 30 days)
I used a code found in a website ( https://people.csail.mit.edu/celiu/OpticalFlow/ ) to compute optical flow using matlab, this code contains mex file.
I used it many times and was working properly but suddenly an error shown with a message asking me to end working of the matlab file! The error is shown below:
------------------------------------------------------------------------
Access violation detected at Wed Feb 22 00:10:53 2017
------------------------------------------------------------------------
Configuration:
Crash Decoding : Disabled
Crash Mode : continue (default)
Current Graphics Driver: Unknown software
Fault Count: 1
Abnormal termination:
Access violation
Register State (from fault):
RAX = 88009c5767345d04 RBX = 000000005dd6ed68
RCX = 000000005dd6ed68 RDX = 0000000004029c50
RSP = 0000000004029960 RBP = 0000000004029a09
RSI = 0000000000000030 RDI = 0000000000000000
R8 = 0000000000000000 R9 = 000007fefab31000
R10 = 0000000000000001 R11 = 0000000000000090
R12 = 0000000004029b28 R13 = 000007fefab31150
R14 = 0000000004029c50 R15 = 0000000000000001
RIP = 000007fefab3e3d8 EFL = 00010202
CS = 0033 FS = 0053 GS = 002b
Stack Trace (from fault):
[ 0] 0x000007fefab3e3d8 D:\Dataset\OpticalFlow\mex\Coarse2FineTwoFrames.mexw64+00058328 mexFunction+00040504
[ 1] 0x000007fefab3db37 D:\DatasetOpticalFlow\mex\Coarse2FineTwoFrames.mexw64+00056119 mexFunction+00038295
[ 2] 0x000007fefab347a6 D:\Dataset\OpticalFlow\mex\Coarse2FineTwoFrames.mexw64+00018342 mexFunction+00000518
[ 3] 0x00000000fc5f77d1 C:\Program Files\MATLAB\R2016a\bin\win64\libmex.dll+00096209 mexRunMexFile+00000129
[ 4] 0x00000000fc5f6d12 C:\Program Files\MATLAB\R2016a\bin\win64\libmex.dll+00093458 inSwapMexfileReader+00000434
[ 5] 0x00000000fc5f6966 C:\Program Files\MATLAB\R2016a\bin\win64\libmex.dll+00092518 mexUnlock+00004774
[ 6] 0x0000000007ff5d1f C:\Program Files\MATLAB\R2016a\bin\win64\m_dispatcher.dll+00089375 Mfh_file::dispatch_fh_impl+00000527
[ 7] 0x0000000007ff5f0e C:\Program Files\MATLAB\R2016a\bin\win64\m_dispatcher.dll+00089870 Mfh_file::dispatch_fh+00000062
[ 8] 0x0000000007ff3e15 C:\Program Files\MATLAB\R2016a\bin\win64\m_dispatcher.dll+00081429 Mfunction_handle::dispatch+00000933
[ 9] 0x0000000008d32033 C:\Program Files\MATLAB\R2016a\bin\win64\m_lxe.dll+00335923
[ 10] 0x0000000008ed3e0d C:\Program Files\MATLAB\R2016a\bin\win64\m_lxe.dll+02047501 boost::serialization::singleton<boost::archive::detail::pointer_oserializer<boost::archive::binaryTerm_oarchive,ir::IrTree> >::get_instance+00665693
[ 11] 0x0000000008ed3d6a C:\Program Files\MATLAB\R2016a\bin\win64\m_lxe.dll+02047338 boost::serialization::singleton<boost::archive::detail::pointer_oserializer<boost::archive::binaryTerm_oarchive,ir::IrTree> >::get_instance+00665530
[ 12] 0x0000000008ed3e48 C:\Program Files\MATLAB\R2016a\bin\win64\m_lxe.dll+02047560 boost::serialization::singleton<boost::archive::detail::pointer_oserializer<boost::archive::binaryTerm_oarchive,ir::IrTree> >::get_instance+00665752
[ 13] 0x0000000008db428f C:\Program Files\MATLAB\R2016a\bin\win64\m_lxe.dll+00869007 boost::serialization::singleton<boost::archive::detail::pointer_iserializer<boost::archive::binaryTerm_iarchive,ir::IrTree> >::get_instance+00069131
[ 14] 0x0000000008db4ef6 C:\Program Files\MATLAB\R2016a\bin\win64\m_lxe.dll+00872182 boost::serialization::singleton<boost::archive::detail::pointer_iserializer<boost::archive::binaryTerm_iarchive,ir::IrTree> >::get_instance+00072306
[ 15] 0x0000000008db6237 C:\Program Files\MATLAB\R2016a\bin\win64\m_lxe.dll+00877111 boost::serialization::singleton<boost::archive::detail::pointer_iserializer<boost::archive::binaryTerm_iarchive,ir::IrTree> >::get_instance+00077235
[ 16] 0x0000000008db6c05 C:\Program Files\MATLAB\R2016a\bin\win64\m_lxe.dll+00879621 boost::serialization::singleton<boost::archive::detail::pointer_iserializer<boost::archive::binaryTerm_iarchive,ir::IrTree> >::get_instance+00079745
[ 17] 0x0000000008db642f C:\Program Files\MATLAB\R2016a\bin\win64\m_lxe.dll+00877615 boost::serialization::singleton<boost::archive::detail::pointer_iserializer<boost::archive::binaryTerm_iarchive,ir::IrTree> >::get_instance+00077739
[ 18] 0x0000000008db613a C:\Program Files\MATLAB\R2016a\bin\win64\m_lxe.dll+00876858 boost::serialization::singleton<boost::archive::detail::pointer_iserializer<boost::archive::binaryTerm_iarchive,ir::IrTree> >::get_instance+00076982
[ 19] 0x0000000008dade5b C:\Program Files\MATLAB\R2016a\bin\win64\m_lxe.dll+00843355 boost::serialization::singleton<boost::archive::detail::pointer_iserializer<boost::archive::binaryTerm_iarchive,ir::IrTree> >::get_instance+00043479
[ 20] 0x0000000008dabd27 C:\Program Files\MATLAB\R2016a\bin\win64\m_lxe.dll+00834855 boost::serialization::singleton<boost::archive::detail::pointer_iserializer<boost::archive::binaryTerm_iarchive,ir::IrTree> >::get_instance+00034979
[ 21] 0x0000000008dab1c2 C:\Program Files\MATLAB\R2016a\bin\win64\m_lxe.dll+00831938 boost::serialization::singleton<boost::archive::detail::pointer_iserializer<boost::archive::binaryTerm_iarchive,ir::IrTree> >::get_instance+00032062
[ 22] 0x0000000008cfee82 C:\Program Files\MATLAB\R2016a\bin\win64\m_lxe.dll+00126594
[ 23] 0x0000000008cff107 C:\Program Files\MATLAB\R2016a\bin\win64\m_lxe.dll+00127239
[ 24] 0x0000000007ff5e95 C:\Program Files\MATLAB\R2016a\bin\win64\m_dispatcher.dll+00089749 Mfh_file::dispatch_fh_impl+00000901
[ 25] 0x0000000007ff5f0e C:\Program Files\MATLAB\R2016a\bin\win64\m_dispatcher.dll+00089870 Mfh_file::dispatch_fh+00000062
[ 26] 0x0000000007ff3e15 C:\Program Files\MATLAB\R2016a\bin\win64\m_dispatcher.dll+00081429 Mfunction_handle::dispatch+00000933
[ 27] 0x0000000008d32033 C:\Program Files\MATLAB\R2016a\bin\win64\m_lxe.dll+00335923
[ 28] 0x0000000008ed8114 C:\Program Files\MATLAB\R2016a\bin\win64\m_lxe.dll+02064660 boost::serialization::singleton<boost::archive::detail::pointer_oserializer<boost::archive::binaryTerm_oarchive,ir::IrTree> >::get_instance+00682852
[ 29] 0x0000000008db428f C:\Program Files\MATLAB\R2016a\bin\win64\m_lxe.dll+00869007 boost::serialization::singleton<boost::archive::detail::pointer_iserializer<boost::archive::binaryTerm_iarchive,ir::IrTree> >::get_instance+00069131
[ 30] 0x0000000008db4ef6 C:\Program Files\MATLAB\R2016a\bin\win64\m_lxe.dll+00872182 boost::serialization::singleton<boost::archive::detail::pointer_iserializer<boost::archive::binaryTerm_iarchive,ir::IrTree> >::get_instance+00072306
[ 31] 0x0000000008db6237 C:\Program Files\MATLAB\R2016a\bin\win64\m_lxe.dll+00877111 boost::serialization::singleton<boost::archive::detail::pointer_iserializer<boost::archive::binaryTerm_iarchive,ir::IrTree> >::get_instance+00077235
[ 32] 0x0000000008db6c05 C:\Program Files\MATLAB\R2016a\bin\win64\m_lxe.dll+00879621 boost::serialization::singleton<boost::archive::detail::pointer_iserializer<boost::archive::binaryTerm_iarchive,ir::IrTree> >::get_instance+00079745
[ 33] 0x0000000008db642f C:\Program Files\MATLAB\R2016a\bin\win64\m_lxe.dll+00877615 boost::serialization::singleton<boost::archive::detail::pointer_iserializer<boost::archive::binaryTerm_iarchive,ir::IrTree> >::get_instance+00077739
[ 34] 0x0000000008db613a C:\Program Files\MATLAB\R2016a\bin\win64\m_lxe.dll+00876858 boost::serialization::singleton<boost::archive::detail::pointer_iserializer<boost::archive::binaryTerm_iarchive,ir::IrTree> >::get_instance+00076982
[ 35] 0x0000000008dade5b C:\Program Files\MATLAB\R2016a\bin\win64\m_lxe.dll+00843355 boost::serialization::singleton<boost::archive::detail::pointer_iserializer<boost::archive::binaryTerm_iarchive,ir::IrTree> >::get_instance+00043479
[ 36] 0x0000000008dabd27 C:\Program Files\MATLAB\R2016a\bin\win64\m_lxe.dll+00834855 boost::serialization::singleton<boost::archive::detail::pointer_iserializer<boost::archive::binaryTerm_iarchive,ir::IrTree> >::get_instance+00034979
[ 37] 0x0000000008dab1c2 C:\Program Files\MATLAB\R2016a\bin\win64\m_lxe.dll+00831938 boost::serialization::singleton<boost::archive::detail::pointer_iserializer<boost::archive::binaryTerm_iarchive,ir::IrTree> >::get_instance+00032062
[ 38] 0x0000000008d39d47 C:\Program Files\MATLAB\R2016a\bin\win64\m_lxe.dll+00367943
[ 39] 0x0000000008d39681 C:\Program Files\MATLAB\R2016a\bin\win64\m_lxe.dll+00366209
[ 40] 0x0000000008d39810 C:\Program Files\MATLAB\R2016a\bin\win64\m_lxe.dll+00366608
[ 41] 0x0000000008eed395 C:\Program Files\MATLAB\R2016a\bin\win64\m_lxe.dll+02151317 boost::serialization::singleton<boost::archive::detail::pointer_oserializer<boost::archive::binaryTerm_oarchive,ir::IrTree> >::get_instance+00769509
[ 42] 0x0000000008eed31e C:\Program Files\MATLAB\R2016a\bin\win64\m_lxe.dll+02151198 boost::serialization::singleton<boost::archive::detail::pointer_oserializer<boost::archive::binaryTerm_oarchive,ir::IrTree> >::get_instance+00769390
[ 43] 0x0000000008d0dad1 C:\Program Files\MATLAB\R2016a\bin\win64\m_lxe.dll+00187089
[ 44] 0x0000000008180241 C:\Program Files\MATLAB\R2016a\bin\win64\m_interpreter.dll+00787009 inEvalCmdWithLocalReturn+00000065
[ 45] 0x00000000fb6056cd C:\Program Files\MATLAB\R2016a\bin\win64\libmwbridge.dll+00087757 mnGetPrompt+00005933
[ 46] 0x00000000fb606473 C:\Program Files\MATLAB\R2016a\bin\win64\libmwbridge.dll+00091251 mnParser+00001091
[ 47] 0x0000000008b099d1 C:\Program Files\MATLAB\R2016a\bin\win64\mcr.dll+00235985 mcr::runtime::setInterpreterThreadToCurrent+00025585
[ 48] 0x0000000008b08967 C:\Program Files\MATLAB\R2016a\bin\win64\mcr.dll+00231783 mcr::runtime::setInterpreterThreadToCurrent+00021383
[ 49] 0x0000000008b089e3 C:\Program Files\MATLAB\R2016a\bin\win64\mcr.dll+00231907 mcr::runtime::setInterpreterThreadToCurrent+00021507
[ 50] 0x0000000008b092d1 C:\Program Files\MATLAB\R2016a\bin\win64\mcr.dll+00234193 mcr::runtime::setInterpreterThreadToCurrent+00023793
[ 51] 0x00000000fd01ea57 C:\Program Files\MATLAB\R2016a\bin\win64\iqm.dll+00584279 iqm::UserEvalPlugin::pre+00030535
[ 52] 0x00000000fd02b3ac C:\Program Files\MATLAB\R2016a\bin\win64\iqm.dll+00635820 iqm::UserEvalPlugin::pre+00082076
[ 53] 0x00000000fd018bf0 C:\Program Files\MATLAB\R2016a\bin\win64\iqm.dll+00560112 iqm::UserEvalPlugin::pre+00006368
[ 54] 0x00000000fd02ddaa C:\Program Files\MATLAB\R2016a\bin\win64\iqm.dll+00646570 iqm::UserEvalPlugin::pre+00092826
[ 55] 0x00000000fcffbd07 C:\Program Files\MATLAB\R2016a\bin\win64\iqm.dll+00441607 iqm::PackagedTaskPlugin::PackagedTaskPlugin+00000727
[ 56] 0x00000000fcffc35f C:\Program Files\MATLAB\R2016a\bin\win64\iqm.dll+00443231 iqm::PackagedTaskPlugin::execute+00000575
[ 57] 0x00000000fcffbd79 C:\Program Files\MATLAB\R2016a\bin\win64\iqm.dll+00441721 iqm::PackagedTaskPlugin::PackagedTaskPlugin+00000841
[ 58] 0x00000000fcffc1d4 C:\Program Files\MATLAB\R2016a\bin\win64\iqm.dll+00442836 iqm::PackagedTaskPlugin::execute+00000180
[ 59] 0x0000000008b1b4a5 C:\Program Files\MATLAB\R2016a\bin\win64\mcr.dll+00308389 mcrRegisterExternalFunction+00024629
[ 60] 0x00000000fcfd62ea C:\Program Files\MATLAB\R2016a\bin\win64\iqm.dll+00287466 iqm::Iqm::setupIqmFcnPtrs+00069674
[ 61] 0x00000000fcfd61d7 C:\Program Files\MATLAB\R2016a\bin\win64\iqm.dll+00287191 iqm::Iqm::setupIqmFcnPtrs+00069399
[ 62] 0x00000000fcfbbae1 C:\Program Files\MATLAB\R2016a\bin\win64\iqm.dll+00178913 iqm::Iqm::deliver+00003409
[ 63] 0x00000000fcfbc9df C:\Program Files\MATLAB\R2016a\bin\win64\iqm.dll+00182751 iqm::Iqm::deliver+00007247
[ 64] 0x00000000045214d3 C:\Program Files\MATLAB\R2016a\bin\win64\libmwservices.dll+01774803 services::system_events::PpeDispatchHook::dispatchOne+00031459
[ 65] 0x000000000452e933 C:\Program Files\MATLAB\R2016a\bin\win64\libmwservices.dll+01829171 sysq::addProcessPendingEventsUnitTestHook+00005491
[ 66] 0x000000000452eb10 C:\Program Files\MATLAB\R2016a\bin\win64\libmwservices.dll+01829648 sysq::addProcessPendingEventsUnitTestHook+00005968
[ 67] 0x0000000004530665 C:\Program Files\MATLAB\R2016a\bin\win64\libmwservices.dll+01836645 sysq::getCondition+00003813
[ 68] 0x0000000004532422 C:\Program Files\MATLAB\R2016a\bin\win64\libmwservices.dll+01844258 svWS_ProcessPendingEvents+00000162
[ 69] 0x0000000008b09d0d C:\Program Files\MATLAB\R2016a\bin\win64\mcr.dll+00236813 mcr::runtime::setInterpreterThreadToCurrent+00026413
[ 70] 0x0000000008b0a3fa C:\Program Files\MATLAB\R2016a\bin\win64\mcr.dll+00238586 mcr::runtime::setInterpreterThreadToCurrent+00028186
[ 71] 0x0000000008b01a05 C:\Program Files\MATLAB\R2016a\bin\win64\mcr.dll+00203269 mcr_process_events+00008629
[ 72] 0x0000000008b03462 C:\Program Files\MATLAB\R2016a\bin\win64\mcr.dll+00210018 mcr_process_events+00015378
[ 73] 0x00000000063b93be C:\Program Files\MATLAB\R2016a\bin\win64\MVMLocal.dll+00234430 mvm_server::inproc::LocalFactory::terminate+00071182
[ 74] 0x00000000fa93cd89 C:\Program Files\MATLAB\R2016a\bin\win64\mvm.dll+01101193 mvm::detail::initLocalMvmHack+00000521
[ 75] 0x00000000fa93d355 C:\Program Files\MATLAB\R2016a\bin\win64\mvm.dll+01102677 mvm::detail::SessionImpl::privateSession+00000373
[ 76] 0x00000000fa93d561 C:\Program Files\MATLAB\R2016a\bin\win64\mvm.dll+01103201 mvm::detail::SessionImpl::privateSession+00000897
[ 77] 0x0000000140006fd5 C:\Program Files\MATLAB\R2016a\bin\win64\MATLAB.exe+00028629
[ 78] 0x0000000140007661 C:\Program Files\MATLAB\R2016a\bin\win64\MATLAB.exe+00030305
[ 79] 0x00000000771459cd C:\Windows\system32\kernel32.dll+00088525 BaseThreadInitThunk+00000013
[ 80] 0x000000007737a561 C:\Windows\SYSTEM32\ntdll.dll+00173409 RtlUserThreadStart+00000033
This error was detected while a MEX-file was running. If the MEX-file
is not an official MathWorks function, please examine its source code
for errors. Please consult the External Interfaces Guide for information
on debugging MEX-files.
If this problem is reproducible, please submit a Service Request via:
http://www.mathworks.com/support/contact_us/
A technical support engineer might contact you with further information.

Answers (1)

Jan
Jan on 22 Feb 2017
This means, that there is an error in Coarse2FineTwoFrames.mexw64. Either this function contains a bug, or it is called with inproper inputs. Contacting the author is the best idea, when the error is reproducible.
  2 Comments
Mammo Image
Mammo Image on 22 Feb 2017
Edited: Mammo Image on 22 Feb 2017
Is it possible the reason is improper input, as when I am using it alone there is no problem happened! But the thing is, I used it with the same input many times and it was working. is it possible to be memory issue??
Jan
Jan on 22 Feb 2017
Yes, of course a cell of your RAM could be damaged. Then the problem will not be reproducuble and your operating system should crash from time to time also. If could be a problem of the hard disk also, when a bit of the Mex file was changed by cosmic rays. But such problems are very rare. And after 35 years of experiences with computers, the term "working properly but suddenly" is a strong indicator that a substantial change of the program has happend, although the user is not aware of this. So it is more likely to check this at first: What has changed since it ran successfully? Afterwards run a memory test.

Sign in to comment.

Categories

Find more on MATLAB Compiler in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!