Matlab crashing on loading library

3 views (last 30 days)
Henrik Helmius
Henrik Helmius on 27 Feb 2017
Hi!
I'm trying to interface with an USB-oscilloscope (Handyscope HS3). I got some code working last week but today every attempt to load the library required seems to cause matlab to crash. Not even the example code from the manufacturer seems to work.
Whenever I try running the code I get the message "MATLAB has encountered an internal problem and needs to close". I'm fairly certain that the problem occurs while using loadlib.
EDIT I've attached the example code I'm trying to run
This is the stack trace produced by matlab while trying to run the example from the manufacturer
Stack Trace (from fault):
[ 0] 0x00007ffbca747788 C:\WINDOWS\System32\KERNELBASE.dll+00096136 RaiseException+00000104
[ 1] 0x000000000583f466 C:\Users\Henrik\Documents\GitHub\WIRELESS-COMMUNICATION\tester\oscilloscope\HS3.dll+00062566
[ 2] 0x000000000583f49c C:\Users\Henrik\Documents\GitHub\WIRELESS-COMMUNICATION\tester\oscilloscope\HS3.dll+00062620
[ 3] 0x0000000005b218db C:\Users\Henrik\Documents\GitHub\WIRELESS-COMMUNICATION\tester\oscilloscope\HS3.dll+03086555 TMethodImplementationIntercept+02492443
[ 4] 0x0000000005b1d604 C:\Users\Henrik\Documents\GitHub\WIRELESS-COMMUNICATION\tester\oscilloscope\HS3.dll+03069444 TMethodImplementationIntercept+02475332
[ 5] 0x0000000005b1d28c C:\Users\Henrik\Documents\GitHub\WIRELESS-COMMUNICATION\tester\oscilloscope\HS3.dll+03068556 TMethodImplementationIntercept+02474444
[ 6] 0x0000000005b1f3aa C:\Users\Henrik\Documents\GitHub\WIRELESS-COMMUNICATION\tester\oscilloscope\HS3.dll+03077034 TMethodImplementationIntercept+02482922
[ 7] 0x0000000005b1abcd C:\Users\Henrik\Documents\GitHub\WIRELESS-COMMUNICATION\tester\oscilloscope\HS3.dll+03058637 TMethodImplementationIntercept+02464525
[ 8] 0x0000000005b23d56 C:\Users\Henrik\Documents\GitHub\WIRELESS-COMMUNICATION\tester\oscilloscope\HS3.dll+03095894 InitInstrument+00000438
[ 9] 0x00007ffbbdbb1037 C:\Users\Henrik\AppData\Local\Temp\tp43213cbf_6571_43dc_90d0_03df0cbcf01e\HS3_thunk_pcwin64.dll+00004151 uint16uint16Thunk+00000055
[ 10] 0x00000000044d13a2 C:\Program Files\MATLAB\R2015a\bin\win64\libmwcli.dll+00005026
[ 11] 0x00000000044d80d5 C:\Program Files\MATLAB\R2015a\bin\win64\libmwcli.dll+00032981
[ 12] 0x00000000044db785 C:\Program Files\MATLAB\R2015a\bin\win64\libmwcli.dll+00046981
[ 13] 0x00000000044f2012 C:\Program Files\MATLAB\R2015a\bin\win64\libmwcli.dll+00139282 PointerMapSize+00072146
[ 14] 0x00000000044f309e C:\Program Files\MATLAB\R2015a\bin\win64\libmwcli.dll+00143518 PointerMapSize+00076382
[ 15] 0x0000000010cc2f5e C:\Program Files\MATLAB\R2015a\bin\win64\m_dispatcher.dll+00077662 mdLogging::log_function_exit+00000110
[ 16] 0x0000000010cc295c C:\Program Files\MATLAB\R2015a\bin\win64\m_dispatcher.dll+00076124 Mfunction_handle::dispatch+00000476
[ 17] 0x0000000010e39597 C:\Program Files\MATLAB\R2015a\bin\win64\m_interpreter.dll+00103831 in_is_matlab_function+00048455
[ 18] 0x0000000010f531a7 C:\Program Files\MATLAB\R2015a\bin\win64\m_interpreter.dll+01257895 inIsKeyword+00027799
[ 19] 0x0000000010e3b69a C:\Program Files\MATLAB\R2015a\bin\win64\m_interpreter.dll+00112282 in_is_matlab_function+00056906
[ 20] 0x0000000010f0684f C:\Program Files\MATLAB\R2015a\bin\win64\m_interpreter.dll+00944207 MathWorks::MException::MExceptionEnvelope::MCOSClassID+00000991
[ 21] 0x0000000010f067b1 C:\Program Files\MATLAB\R2015a\bin\win64\m_interpreter.dll+00944049 MathWorks::MException::MExceptionEnvelope::MCOSClassID+00000833
[ 22] 0x0000000010e7da75 C:\Program Files\MATLAB\R2015a\bin\win64\m_interpreter.dll+00383605 inGetCurrentWS+00155269
[ 23] 0x0000000010e7ce8c C:\Program Files\MATLAB\R2015a\bin\win64\m_interpreter.dll+00380556 inGetCurrentWS+00152220
[ 24] 0x0000000010e7b6e9 C:\Program Files\MATLAB\R2015a\bin\win64\m_interpreter.dll+00374505 inGetCurrentWS+00146169
[ 25] 0x0000000010cc2757 C:\Program Files\MATLAB\R2015a\bin\win64\m_dispatcher.dll+00075607 Mfh_file::dispatch_fh+00000743
[ 26] 0x0000000010cc2a7e C:\Program Files\MATLAB\R2015a\bin\win64\m_dispatcher.dll+00076414 Mfunction_handle::dispatch+00000766
[ 27] 0x0000000010f0b268 C:\Program Files\MATLAB\R2015a\bin\win64\m_interpreter.dll+00963176 inAnonymousFunction+00000360
[ 28] 0x0000000010f0b864 C:\Program Files\MATLAB\R2015a\bin\win64\m_interpreter.dll+00964708 inAnonymousFunction+00001892
[ 29] 0x0000000010f0ba25 C:\Program Files\MATLAB\R2015a\bin\win64\m_interpreter.dll+00965157 inAnonymousFunction+00002341
[ 30] 0x0000000010f0b9f2 C:\Program Files\MATLAB\R2015a\bin\win64\m_interpreter.dll+00965106 inAnonymousFunction+00002290
[ 31] 0x0000000010f0b9a7 C:\Program Files\MATLAB\R2015a\bin\win64\m_interpreter.dll+00965031 inAnonymousFunction+00002215
[ 32] 0x0000000010ebf6bd C:\Program Files\MATLAB\R2015a\bin\win64\m_interpreter.dll+00652989 inGetCallersWorkSpace+00001805
[ 33] 0x0000000010eb854d C:\Program Files\MATLAB\R2015a\bin\win64\m_interpreter.dll+00623949 inEvalCmdWithLocalReturn+00000285
[ 34] 0x0000000010eb8471 C:\Program Files\MATLAB\R2015a\bin\win64\m_interpreter.dll+00623729 inEvalCmdWithLocalReturn+00000065
[ 35] 0x0000000010eb8415 C:\Program Files\MATLAB\R2015a\bin\win64\m_interpreter.dll+00623637 inEvalCmd+00001605
[ 36] 0x0000000010eb7c32 C:\Program Files\MATLAB\R2015a\bin\win64\m_interpreter.dll+00621618 inEvalCmdWithLocalReturnInDesiredWSAndPublishEvents+00000066
[ 37] 0x000000001092fbba C:\Program Files\MATLAB\R2015a\bin\win64\iqm.dll+00261050 iqm::InternalEvalPlugin::inEvalCmdWithLocalReturn+00000170
[ 38] 0x000000001092f82c C:\Program Files\MATLAB\R2015a\bin\win64\iqm.dll+00260140 iqm::InternalEvalPlugin::execute+00000252
[ 39] 0x00000000fa709d28 C:\Program Files\MATLAB\R2015a\bin\win64\nativejmi.dll+00236840 nativejmi::JmiIIP::serializeExplicit+00004504
[ 40] 0x00000000fa73bb8f C:\Program Files\MATLAB\R2015a\bin\win64\nativejmi.dll+00441231 NativeLabCmdWinSetup+00199087
[ 41] 0x0000000010924e9a C:\Program Files\MATLAB\R2015a\bin\win64\iqm.dll+00216730 iqm::Iqm::setupIqmFcnPtrs+00027338
[ 42] 0x0000000010924d86 C:\Program Files\MATLAB\R2015a\bin\win64\iqm.dll+00216454 iqm::Iqm::setupIqmFcnPtrs+00027062
[ 43] 0x0000000010914a79 C:\Program Files\MATLAB\R2015a\bin\win64\iqm.dll+00150137 iqm::Iqm::deliver+00001113
[ 44] 0x00000000fb5f85c8 C:\Program Files\MATLAB\R2015a\bin\win64\libmwbridge.dll+00034248 ioReadLine+00000280
[ 45] 0x00000000fb5f83d2 C:\Program Files\MATLAB\R2015a\bin\win64\libmwbridge.dll+00033746 ioCmdLineEditSave+00011986
[ 46] 0x00000000fb5f849b C:\Program Files\MATLAB\R2015a\bin\win64\libmwbridge.dll+00033947 ioReadLine+00000107
[ 47] 0x00000000fb5feef5 C:\Program Files\MATLAB\R2015a\bin\win64\libmwbridge.dll+00061173 mnDebugPrompt+00001509
[ 48] 0x00000000fb5fea2a C:\Program Files\MATLAB\R2015a\bin\win64\libmwbridge.dll+00059946 mnDebugPrompt+00000282
[ 49] 0x00000000fb5ff18e C:\Program Files\MATLAB\R2015a\bin\win64\libmwbridge.dll+00061838 mnParser+00000462
[ 50] 0x00000000fd0e13d4 C:\Program Files\MATLAB\R2015a\bin\win64\mcr.dll+00398292 mcrInstance::mnParser_on_interpreter_thread+00000036
[ 51] 0x00000000fd0a9757 C:\Program Files\MATLAB\R2015a\bin\win64\mcr.dll+00169815 mcr::runtime::setInterpreterThreadToCurrent+00019751
[ 52] 0x00000000fd0a9793 C:\Program Files\MATLAB\R2015a\bin\win64\mcr.dll+00169875 mcr::runtime::setInterpreterThreadToCurrent+00019811
[ 53] 0x00000000fd0a9f91 C:\Program Files\MATLAB\R2015a\bin\win64\mcr.dll+00171921 mcr::runtime::setInterpreterThreadToCurrent+00021857
[ 54] 0x00000000fab5d216 C:\Program Files\MATLAB\R2015a\bin\win64\uiw.dll+00512534 UIW_AttachThreadInput+00001270
[ 55] 0x00000000fab5caa5 C:\Program Files\MATLAB\R2015a\bin\win64\uiw.dll+00510629 wsd_to_MSW+00004373
[ 56] 0x00000000fab5cb29 C:\Program Files\MATLAB\R2015a\bin\win64\uiw.dll+00510761 wsd_to_MSW+00004505
[ 57] 0x00007ffbcd2128cf C:\WINDOWS\System32\USER32.dll+00207055 EmptyClipboard+00000751
[ 58] 0x00007ffbcd1ff339 C:\WINDOWS\System32\USER32.dll+00127801 GetPropW+00000697
[ 59] 0x00007ffbcd1ff2b6 C:\WINDOWS\System32\USER32.dll+00127670 GetPropW+00000566
[ 60] 0x00007ffbcd819c54 C:\WINDOWS\SYSTEM32\ntdll.dll+00695380 KiUserCallbackDispatcher+00000036
[ 61] 0x00007ffbca9a10c4 C:\WINDOWS\System32\win32u.dll+00004292 NtUserPeekMessage+00000020
[ 62] 0x00007ffbcd1fe5bd C:\WINDOWS\System32\USER32.dll+00124349 PeekMessageW+00000397
[ 63] 0x00007ffbcd1fe3a3 C:\WINDOWS\System32\USER32.dll+00123811 PeekMessageA+00000163
[ 64] 0x00000000fab09bdb C:\Program Files\MATLAB\R2015a\bin\win64\uiw.dll+00170971 UIW_ShowMenuItem+00005179
[ 65] 0x00000000fab5db52 C:\Program Files\MATLAB\R2015a\bin\win64\uiw.dll+00514898 UIW_SuspendAttachThreadInput+00000466
[ 66] 0x0000000010602c83 C:\Program Files\MATLAB\R2015a\bin\win64\libmwservices.dll+01256579 services::system_events::PpeDispatchHook::dispatchOne+00032291
[ 67] 0x000000001060e6f5 C:\Program Files\MATLAB\R2015a\bin\win64\libmwservices.dll+01304309 sysq::addProcessPendingEventsUnitTestHook+00005813
[ 68] 0x000000001060e7a0 C:\Program Files\MATLAB\R2015a\bin\win64\libmwservices.dll+01304480 sysq::addProcessPendingEventsUnitTestHook+00005984
[ 69] 0x0000000010610595 C:\Program Files\MATLAB\R2015a\bin\win64\libmwservices.dll+01312149 sysq::getCondition+00004629
[ 70] 0x0000000010611f52 C:\Program Files\MATLAB\R2015a\bin\win64\libmwservices.dll+01318738 svWS_ProcessPendingEvents+00000162
[ 71] 0x00000000fd0aa6ad C:\Program Files\MATLAB\R2015a\bin\win64\mcr.dll+00173741 mcr::runtime::setInterpreterThreadToCurrent+00023677
[ 72] 0x00000000fd0ab31a C:\Program Files\MATLAB\R2015a\bin\win64\mcr.dll+00176922 mcr::runtime::setInterpreterThreadToCurrent+00026858
[ 73] 0x00000000fd0a2f75 C:\Program Files\MATLAB\R2015a\bin\win64\mcr.dll+00143221 mcr_process_events+00007557
[ 74] 0x00000000fd0a4882 C:\Program Files\MATLAB\R2015a\bin\win64\mcr.dll+00149634 mcr_process_events+00013970
[ 75] 0x00000000156db49d C:\Program Files\MATLAB\R2015a\bin\win64\MVMLocal.dll+00177309 mvm_server::inproc::LocalFactory::terminate+00048141
[ 76] 0x00000000fa8fa27a C:\Program Files\MATLAB\R2015a\bin\win64\mvm.dll+00828026 mvm::detail::initLocalMvmHack+00000490
[ 77] 0x00000000fa8fa838 C:\Program Files\MATLAB\R2015a\bin\win64\mvm.dll+00829496 mvm::detail::SessionImpl::privateSession+00000376
[ 78] 0x00000000fa8faa88 C:\Program Files\MATLAB\R2015a\bin\win64\mvm.dll+00830088 mvm::detail::SessionImpl::privateSession+00000968
[ 79] 0x000000014000630d C:\Program Files\MATLAB\R2015a\bin\win64\MATLAB.exe+00025357
[ 80] 0x0000000140007dd0 C:\Program Files\MATLAB\R2015a\bin\win64\MATLAB.exe+00032208
[ 81] 0x00007ffbcb078364 C:\WINDOWS\System32\KERNEL32.DLL+00033636 BaseThreadInitThunk+00000020
[ 82] 0x00007ffbcd7d70d1 C:\WINDOWS\SYSTEM32\ntdll.dll+00422097 RtlUserThreadStart+00000033

Answers (2)

Ankita Nargundkar
Ankita Nargundkar on 6 Mar 2017
You can contact MathWorks technical support for further assistance.

Philip Borghesani
Philip Borghesani on 6 Mar 2017
The crash is in the com control for the Handyscope (oscilloscope\HS3.dll). I suggest contacting support for it or starting by seeing if any demos or programs that use the scope but don't use MATLAB are still working, Then work up from there.

Community Treasure Hunt

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

Start Hunting!