MATLAB Answers

After Mex compilation fails, Matlab crashes and doesn't open again

5 views (last 30 days)
Johan
Johan on 14 May 2014
Answered: James Tursa on 22 May 2017
Hello
I've recently been trying to create a c++ file to compile via Matlab's mex command. Every now and then I do something so wrong that Matlab crashes while compiling the file or running it, which wasn't a problem before because I could just open Matlab and try again. Now, however, I can do this only a few times before Matlab refuses to open at all; the splash screen shows, and then nothing happens. Even reinstalling Matlab has no effect.
I honestly have no idea what's going on, and any help would be appreciated. Find below the latest error log file (created when trying to open Matlab and it fails), as well as the c++ code that seems to be the cause of this (please note that it is an as yet incomplete version of the lgwt.m function written by Greg von Winckel available for download from Mathworks that I'm trying to duplicate in c++ as a start - so I don't claim the code for myself, only the errors).
So my questions are: 1) How do I fix Matlab? 2) What do I do to prevent it from happening again? 3) Anything obviously wrong with my c code?
Thank you for your attention in advance
================================== Error log: ==================================-
  1. A fatal error has been detected by the Java Runtime Environment:#
  2. EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x0000000077a308c5, pid=484, tid=4432#
  3. JRE version: 6.0_17-b04
  4. Java VM: Java HotSpot™ 64-Bit Server VM (14.3-b01 mixed mode windows-amd64 )
  5. Problematic frame:
  6. C [ntdll.dll+0x508c5]#
  7. If you would like to submit a bug report, please visit:
  8. http://java.sun.com/webapps/bugreport/crash.jsp#
--------------- T H R E A D ---------------
Current thread (0x000000000658d000): JavaThread "main" [_thread_in_Java, id=4432, stack(0x0000000000030000,0x0000000004030000)]
siginfo: ExceptionCode=0xc0000005, reading address 0xffffffffffffffff
Registers: EAX=0x000000000402c6c8, EBX=0x0000000000000002, ECX=0x000000000402c798, EDX=0x000000000402c708 ESP=0x000000000402c6b8, EBP=0x000007feeaf27710, ESI=0x0000000000000020, EDI=0x0000000000000000 EIP=0x0000000077a308c5, EFLAGS=0x0000000000010202
Top of Stack: (sp=0x000000000402c6b8) 0x000000000402c6b8: 0000000000000202 00000000779eb219 0x000000000402c6c8: 000007fffffde000 0000000000000003 0x000000000402c6d8: 000007feff3613d2 0000000000000510 0x000000000402c6e8: 0000000000000003 00000000520a6d88 0x000000000402c6f8: 0000000000000000 0000000000000510 0x000000000402c708: 0000000004030000 0000000004020000 0x000000000402c718: 0000000000000003 00000000408fc1a0 0x000000000402c728: 0000000000000050 00000000408fc1a0 0x000000000402c738: 000000007899a566 000000000658d470 0x000000000402c748: 0000000000000003 0000000058c8c010 0x000000000402c758: 000000005cffcef0 0000000000000000 0x000000000402c768: 000000000402c950 000000000402c980 0x000000000402c778: 0000000000000000 0000000300000003 0x000000000402c788: 000000005cfeef30 000000005cfeef90 0x000000000402c798: 000000000402cfa0 000000003d75f7cc 0x000000000402c7a8: 000000003d75ec90 0000000000000000
Instructions: (pc=0x0000000077a308c5) 0x0000000077a308b5: 00 00 4c 89 b1 e8 00 00 00 4c 89 b9 f0 00 00 00 0x0000000077a308c5: 0f ae 81 00 01 00 00 0f 29 81 a0 01 00 00 0f 29
Stack: [0x0000000000030000,0x0000000004030000], sp=0x000000000402c6b8, free space=65521k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C [ntdll.dll+0x508c5]
Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) v blob 0x000000003d717039 j sun.misc.URLClassPath$JarLoader.ensureOpen()V+4 j sun.misc.URLClassPath$JarLoader.getResource(Ljava/lang/String;Z)Lsun/misc/Resource;+21 j sun.misc.URLClassPath.getResource(Ljava/lang/String;Z)Lsun/misc/Resource;+53 j sun.misc.URLClassPath.getResource(Ljava/lang/String;)Lsun/misc/Resource;+3 j java.lang.ClassLoader.getBootstrapResource(Ljava/lang/String;)Ljava/net/URL;+15 j java.lang.ClassLoader.getResource(Ljava/lang/String;)Ljava/net/URL;+20 j java.lang.ClassLoader.getResource(Ljava/lang/String;)Ljava/net/URL;+12 j java.lang.ClassLoader.getResourceAsStream(Ljava/lang/String;)Ljava/io/InputStream;+2 j java.util.ResourceBundle$RBClassLoader.getResourceAsStream(Ljava/lang/String;)Ljava/io/InputStream;+10 j java.util.ResourceBundle$Control$1.run()Ljava/io/InputStream;+55 j java.util.ResourceBundle$Control$1.run()Ljava/lang/Object;+1 v ~StubRoutines::call_stub j java.security.AccessController.doPrivileged(Ljava/security/PrivilegedExceptionAction;)Ljava/lang/Object;+0 j java.util.ResourceBundle$Control.newBundle(Ljava/lang/String;Ljava/util/Locale;Ljava/lang/String;Ljava/lang/ClassLoader;Z)Ljava/util/ResourceBundle;+136 j java.util.ResourceBundle.loadBundle(Ljava/util/ResourceBundle$CacheKey;Ljava/util/List;Ljava/util/ResourceBundle$Control;Z)Ljava/util/ResourceBundle;+83 j java.util.ResourceBundle.findBundle(Ljava/util/ResourceBundle$CacheKey;Ljava/util/List;Ljava/util/List;ILjava/util/ResourceBundle$Control;Ljava/util/ResourceBundle;)Ljava/util/ResourceBundle;+331 j java.util.ResourceBundle.getBundleImpl(Ljava/lang/String;Ljava/util/Locale;Ljava/lang/ClassLoader;Ljava/util/ResourceBundle$Control;)Ljava/util/ResourceBundle;+187 j java.util.ResourceBundle.getBundle(Ljava/lang/String;Ljava/util/Locale;Ljava/util/ResourceBundle$Control;)Ljava/util/ResourceBundle;+6 j javax.swing.UIDefaults.getResourceCache(Ljava/util/Locale;)Ljava/util/Map;+70 j javax.swing.UIDefaults.getFromResourceBundle(Ljava/lang/Object;Ljava/util/Locale;)Ljava/lang/Object;+50 j javax.swing.UIDefaults.get(Ljava/lang/Object;)Ljava/lang/Object;+17 j com.sun.java.swing.plaf.windows.WindowsLookAndFeel.initVistaComponentDefaults(Ljavax/swing/UIDefaults;)V+85 j com.sun.java.swing.plaf.windows.WindowsLookAndFeel.initComponentDefaults(Ljavax/swing/UIDefaults;)V+14507 j javax.swing.plaf.basic.BasicLookAndFeel.getDefaults()Ljavax/swing/UIDefaults;+25 j javax.swing.UIManager.setLookAndFeel(Ljavax/swing/LookAndFeel;)V+79 j javax.swing.UIManager.setLookAndFeel(Ljava/lang/String;)V+37 j com.mathworks.mwswing.plaf.PlafUtils.setLookAndFeel()V+21 j com.mathworks.mwswing.MJStartupForDesktop.init()V+32 j com.mathworks.mwswing.MJStartupForDesktop.<clinit>()V+17 v ~StubRoutines::call_stub j java.lang.Class.forName0(Ljava/lang/String;ZLjava/lang/ClassLoader;)Ljava/lang/Class;+0 j java.lang.Class.forName(Ljava/lang/String;)Ljava/lang/Class;+5 j com.mathworks.util.PostVMInit$StartupClass.init(ZZ)V+28 j com.mathworks.util.PostVMInit.perform(ZZ)V+31 v ~StubRoutines::call_stub
--------------- P R O C E S S ---------------
Java Threads: ( => current thread ) 0x0000000058eb6800 JavaThread "com.google.common.base.internal.Finalizer" daemon [_thread_blocked, id=4264, stack(0x00000000b8000000,0x00000000bc000000)] 0x0000000058c67000 JavaThread "Image Fetcher 0" daemon [_thread_blocked, id=4456, stack(0x00000000b4000000,0x00000000b8000000)] 0x000000005cea6800 JavaThread "AWT-Windows" daemon [_thread_in_native, id=2424, stack(0x00000000b0000000,0x00000000b4000000)] 0x000000005cea3800 JavaThread "AWT-Shutdown" [_thread_blocked, id=4588, stack(0x00000000ac000000,0x00000000b0000000)] 0x000000005ce95000 JavaThread "Java2D Disposer" daemon [_thread_blocked, id=2152, stack(0x00000000a8000000,0x00000000ac000000)] 0x000000005c812800 JavaThread "Timer-0" [_thread_blocked, id=4564, stack(0x00000000a4000000,0x00000000a8000000)] 0x000000005c873000 JavaThread "EventMgr Dispatcher" daemon [_thread_in_native, id=4064, stack(0x00000000a0000000,0x00000000a4000000)] 0x0000000058caa800 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=4724, stack(0x0000000098000000,0x000000009c000000)] 0x0000000058ca9000 JavaThread "CompilerThread1" daemon [_thread_blocked, id=1160, stack(0x0000000094000000,0x0000000098000000)] 0x0000000058ca5000 JavaThread "CompilerThread0" daemon [_thread_blocked, id=2932, stack(0x0000000090000000,0x0000000094000000)] 0x0000000058c9e800 JavaThread "Attach Listener" daemon [_thread_blocked, id=4468, stack(0x000000008c000000,0x0000000090000000)] 0x0000000058bba800 JavaThread "Finalizer" daemon [_thread_blocked, id=2100, stack(0x0000000088000000,0x000000008c000000)] 0x0000000058bb9800 JavaThread "Reference Handler" daemon [_thread_blocked, id=680, stack(0x0000000084000000,0x0000000088000000)] =>0x000000000658d000 JavaThread "main" [_thread_in_Java, id=4432, stack(0x0000000000030000,0x0000000004030000)]
Other Threads: 0x0000000058bae000 VMThread [stack: 0x0000000080000000,0x0000000084000000] [id=4944] 0x0000000058cd6800 WatcherThread [stack: 0x000000009c000000,0x00000000a0000000] [id=2784]
VM state:not at safepoint (normal execution)
VM Mutex/Monitor currently owned by a thread: None
Heap PSYoungGen total 14336K, used 10160K [0x00000000519e0000, 0x00000000529e0000, 0x0000000054ae0000) eden space 12288K, 82% used [0x00000000519e0000,0x00000000523cc2c0,0x00000000525e0000) from space 2048K, 0% used [0x00000000527e0000,0x00000000527e0000,0x00000000529e0000) to space 2048K, 0% used [0x00000000525e0000,0x00000000525e0000,0x00000000527e0000) PSOldGen total 49152K, used 0K [0x00000000486e0000, 0x000000004b6e0000, 0x00000000519e0000) object space 49152K, 0% used [0x00000000486e0000,0x00000000486e0000,0x000000004b6e0000) PSPermGen total 32768K, used 8598K [0x00000000406e0000, 0x00000000426e0000, 0x00000000486e0000) object space 32768K, 26% used [0x00000000406e0000,0x0000000040f45a60,0x00000000426e0000)
Dynamic libraries: 0x0000000140000000 - 0x0000000140028000 C:\Program Files\MATLAB\R2013a\bin\win64\MATLAB.exe 0x00000000779e0000 - 0x0000000077b89000 C:\Windows\SYSTEM32\ntdll.dll 0x00000000777c0000 - 0x00000000778df000 C:\Windows\system32\kernel32.dll 0x000007fefd9e0000 - 0x000007fefda4b000 C:\Windows\system32\KERNELBASE.dll 0x0000000074460000 - 0x0000000074515000 C:\Program Files\MATLAB\R2013a\bin\win64\libut.dll 0x00000000758a0000 - 0x000000007595f000 C:\Program Files\MATLAB\R2013a\bin\win64\libmwi18n.dll 0x0000000180000000 - 0x000000018000d000 C:\Program Files\MATLAB\R2013a\bin\win64\libmwresource_core.dll 0x000000006c480000 - 0x000000006c518000 C:\Program Files\MATLAB\R2013a\bin\win64\MSVCP100.dll 0x000000006c3a0000 - 0x000000006c472000 C:\Program Files\MATLAB\R2013a\bin\win64\MSVCR100.dll 0x000000006e7f0000 - 0x000000006e7fe000 C:\Program Files\MATLAB\R2013a\bin\win64\boost_date_time-vc100-mt-1_49.dll 0x000000006d3e0000 - 0x000000006d40c000 C:\Program Files\MATLAB\R2013a\bin\win64\boost_filesystem-vc100-mt-1_49.dll 0x000000006e850000 - 0x000000006e859000 C:\Program Files\MATLAB\R2013a\bin\win64\boost_system-vc100-mt-1_49.dll 0x000007fefdd00000 - 0x000007fefdddb000 C:\Windows\system32\ADVAPI32.dll 0x000007feff360000 - 0x000007feff3ff000 C:\Windows\system32\msvcrt.dll 0x000007feffcd0000 - 0x000007feffcef000 C:\Windows\SYSTEM32\sechost.dll 0x000007feff230000 - 0x000007feff35d000 C:\Windows\system32\RPCRT4.dll 0x000000006d410000 - 0x000000006d435000 C:\Program Files\MATLAB\R2013a\bin\win64\LIBEXPAT.dll 0x000000005dd60000 - 0x000000005deea000 C:\Program Files\MATLAB\R2013a\bin\win64\icuin49.dll 0x000000005e130000 - 0x000000005e26e000 C:\Program Files\MATLAB\R2013a\bin\win64\icuuc49.dll 0x000000005a270000 - 0x000000005b392000 C:\Program Files\MATLAB\R2013a\bin\win64\icudt49.dll 0x000000006e5c0000 - 0x000000006e5d0000 C:\Program Files\MATLAB\R2013a\bin\win64\icuio49.dll 0x0000000073f70000 - 0x0000000074112000 C:\Program Files\MATLAB\R2013a\bin\win64\libmwfl.dll 0x000000007a350000 - 0x000000007a737000 C:\Program Files\MATLAB\R2013a\bin\win64\libmwMATLAB_res.dll 0x0000000069e90000 - 0x0000000069f6f000 C:\Program Files\MATLAB\R2013a\bin\win64\boost_regex-vc100-mt-1_49.dll 0x00000000778e0000 - 0x00000000779da000 C:\Windows\system32\USER32.dll 0x000007feff950000 - 0x000007feff9b7000 C:\Windows\system32\GDI32.dll 0x000007feff570000 - 0x000007feff57e000 C:\Windows\system32\LPK.dll 0x000007feff800000 - 0x000007feff8c9000 C:\Windows\system32\USP10.dll 0x000000006e070000 - 0x000000006e081000 C:\Program Files\MATLAB\R2013a\bin\win64\boost_signals-vc100-mt-1_49.dll 0x000000006cda0000 - 0x000000006cdb1000 C:\Program Files\MATLAB\R2013a\bin\win64\boost_thread-vc100-mt-1_49.dll 0x000007fef6950000 - 0x000007fef69dc000 C:\Program Files\MATLAB\R2013a\bin\win64\boost_log-vc100-mt-1_49.dll 0x0000000077ba0000 - 0x0000000077ba7000 C:\Windows\system32\PSAPI.DLL 0x000007fefef00000 - 0x000007fefef4d000 C:\Windows\system32\WS2_32.dll 0x000007feff480000 - 0x000007feff488000 C:\Windows\system32\NSI.dll 0x000007fef73d0000 - 0x000007fef7403000 C:\Program Files\MATLAB\R2013a\bin\win64\tbb.dll 0x000007feffa50000 - 0x000007feffa69000 C:\Windows\system32\imagehlp.dll 0x000007fefc230000 - 0x000007fefc25c000 C:\Windows\system32\POWRPROF.dll 0x000007feff620000 - 0x000007feff7f7000 C:\Windows\system32\SETUPAPI.dll 0x000007fefdca0000 - 0x000007fefdcd6000 C:\Windows\system32\CFGMGR32.dll 0x000007feff490000 - 0x000007feff567000 C:\Windows\system32\OLEAUT32.dll 0x000007fefdde0000 - 0x000007fefdfe3000 C:\Windows\system32\ole32.dll 0x000007fefdce0000 - 0x000007fefdcfa000 C:\Windows\system32\DEVOBJ.dll 0x0000000004230000 - 0x0000000004251000 C:\Program Files\MATLAB\R2013a\bin\win64\libmwmfl_scalar.dll 0x000007fef6f10000 - 0x000007fef7035000 C:\Windows\system32\dbghelp.dll 0x0000000004260000 - 0x000000000458f000 C:\Program Files\MATLAB\R2013a\bin\win64\libmwservices.dll 0x0000000075a20000 - 0x0000000075b0b000 C:\Program Files\MATLAB\R2013a\bin\win64\libmx.dll 0x000007fef73a0000 - 0x000007fef73c8000 C:\Program Files\MATLAB\R2013a\bin\win64\tbbmalloc.dll 0x000000006cd80000 - 0x000000006cd97000 C:\Program Files\MATLAB\R2013a\bin\win64\zlib1.dll 0x0000000004590000 - 0x00000000045de000 C:\Program Files\MATLAB\R2013a\bin\win64\libmwregexp.dll 0x0000000075f10000 - 0x0000000075f57000 C:\Program Files\MATLAB\R2013a\bin\win64\mpath.dll 0x000000007b680000 - 0x000000007bc66000 C:\Program Files\MATLAB\R2013a\bin\win64\mlutil.dll 0x00000000754d0000 - 0x0000000075547000 C:\Program Files\MATLAB\R2013a\bin\win64\xmlcore.dll 0x000000005db10000 - 0x000000005dd51000 C:\Program Files\MATLAB\R2013a\bin\win64\xerces-c_2_7.dll 0x00000000045e0000 - 0x0000000004602000 C:\Program Files\MATLAB\R2013a\bin\win64\libmwMATLAB_settings_res.dll 0x000007fef78b0000 - 0x000007fef78c0000 C:\Program Files\MATLAB\R2013a\bin\win64\boost_iostreams-vc100-mt-1_49.dll 0x000007feee1d0000 - 0x000007feee216000 C:\Program Files\MATLAB\R2013a\bin\win64\boost_serialization-vc100-mt-1_49.dll 0x000007fefe170000 - 0x000007fefeef8000 C:\Windows\system32\SHELL32.dll 0x000007feff8d0000 - 0x000007feff941000 C:\Windows\system32\SHLWAPI.dll 0x0000000004120000 - 0x0000000004126000 C:\Program Files\MATLAB\R2013a\bin\win64\libmwnativedisplay.dll 0x000007fef9e50000 - 0x000007fef9ef0000 C:\Windows\WinSxS\amd64_microsoft.windows.common-controls_6595b64144ccf1df_5.82.7601.18201_none_a4d3b9377117c3df\COMCTL32.dll 0x000007feff580000 - 0x000007feff617000 C:\Windows\system32\COMDLG32.dll 0x000007fefb030000 - 0x000007fefb046000 C:\Windows\system32\NETAPI32.dll 0x000007fefce30000 - 0x000007fefce3c000 C:\Windows\system32\netutils.dll 0x000007fefd480000 - 0x000007fefd4a3000 C:\Windows\system32\srvcli.dll 0x000007fefb010000 - 0x000007fefb025000 C:\Windows\system32\wkscli.dll 0x0000000074970000 - 0x0000000074a18000 C:\Program Files\MATLAB\R2013a\bin\win64\mcr.dll 0x0000000075000000 - 0x00000000753b1000 C:\Program Files\MATLAB\R2013a\bin\win64\iqm.dll 0x0000000074e80000 - 0x0000000074f30000 C:\Program Files\MATLAB\R2013a\bin\win64\m_dispatcher.dll 0x0000000004610000 - 0x0000000004e18000 C:\Program Files\MATLAB\R2013a\bin\win64\m_interpreter.dll 0x0000000004e20000 - 0x0000000004e44000 C:\Program Files\MATLAB\R2013a\bin\win64\libmex.dll 0x0000000075430000 - 0x00000000754ab000 C:\Program Files\MATLAB\R2013a\bin\win64\profiler.dll 0x0000000004e50000 - 0x00000000050d3000 C:\Program Files\MATLAB\R2013a\bin\win64\libmwmathutil.dll 0x0000000079f40000 - 0x0000000079f66000 C:\Program Files\MATLAB\R2013a\bin\win64\libmwmathrng.dll 0x00000000050e0000 - 0x00000000050f0000 C:\Program Files\MATLAB\R2013a\bin\win64\libmwmfl_rng.dll 0x0000000074c10000 - 0x0000000074cf8000 C:\Program Files\MATLAB\R2013a\bin\win64\libmwmathcore.dll 0x0000000076160000 - 0x00000000761c3000 C:\Program Files\MATLAB\R2013a\bin\win64\libmwspmatrix.dll 0x000000007b0a0000 - 0x000000007b2f6000 C:\Program Files\MATLAB\R2013a\bin\win64\mcos.dll 0x0000000075ea0000 - 0x0000000075f02000 C:\Program Files\MATLAB\R2013a\bin\win64\libmwcholmod.dll 0x0000000005100000 - 0x000000000510d000 C:\Program Files\MATLAB\R2013a\bin\win64\libmwamd.dll 0x000000005da60000 - 0x000000005db03000 C:\Windows\WinSxS\amd64_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.30729.6161_none_08e61857a83bc251\MSVCR90.dll 0x0000000005120000 - 0x000000000512c000 C:\Program Files\MATLAB\R2013a\bin\win64\libmwcolamd.dll 0x000000007a290000 - 0x000000007a2a3000 C:\Program Files\MATLAB\R2013a\bin\win64\libmwblas.dll 0x000000007a310000 - 0x000000007a325000 C:\Program Files\MATLAB\R2013a\bin\win64\libmwbinder.dll 0x0000000005140000 - 0x000000000514b000 C:\Program Files\MATLAB\R2013a\bin\win64\libmwompwrapper.dll 0x0000000075820000 - 0x000000007589e000 C:\Program Files\MATLAB\R2013a\bin\win64\libmwlapack.dll 0x000000007a1b0000 - 0x000000007a1d0000 C:\Program Files\MATLAB\R2013a\bin\win64\m_pcodeio.dll 0x0000000079b10000 - 0x0000000079b6c000 C:\Program Files\MATLAB\R2013a\bin\win64\m_ir.dll 0x0000000078ed0000 - 0x0000000079579000 C:\Program Files\MATLAB\R2013a\bin\win64\m_parser.dll 0x000000007a2f0000 - 0x000000007a307000 C:\Program Files\MATLAB\R2013a\bin\win64\ir_xfmr.dll 0x0000000005150000 - 0x0000000005160000 C:\Program Files\MATLAB\R2013a\bin\win64\mtok.dll 0x000000007a130000 - 0x000000007a158000 C:\Program Files\MATLAB\R2013a\bin\win64\m_pcodegen.dll 0x0000000079fb0000 - 0x0000000079fdf000 C:\Program Files\MATLAB\R2013a\bin\win64\libmwbridge.dll 0x0000000074f40000 - 0x0000000074ff6000 C:\Program Files\MATLAB\R2013a\bin\win64\udd.dll 0x0000000073cc0000 - 0x0000000073e0e000 C:\Program Files\MATLAB\R2013a\bin\win64\libmwgui.dll 0x000000007a1d0000 - 0x000000007a1f4000 C:\Program Files\MATLAB\R2013a\bin\win64\graphics_util.dll 0x000007feecb60000 - 0x000007feecc18000 C:\Program Files\MATLAB\R2013a\bin\win64\libtex_base.dll 0x0000000005160000 - 0x0000000005aa3000 C:\Program Files\MATLAB\R2013a\bin\win64\hg.dll 0x0000000076100000 - 0x000000007615a000 C:\Program Files\MATLAB\R2013a\bin\win64\libmat.dll 0x0000000072d30000 - 0x0000000072f38000 C:\Program Files\MATLAB\R2013a\bin\win64\hdf5dll.dll 0x0000000075710000 - 0x00000000757d8000 C:\Program Files\MATLAB\R2013a\bin\win64\jmi.dll 0x0000000005ac0000 - 0x0000000005ace000 C:\Program Files\MATLAB\R2013a\bin\win64\nativejava_services.dll 0x0000000005ad0000 - 0x0000000005b10000 C:\Program Files\MATLAB\R2013a\bin\win64\libmwhardcopy.dll 0x0000000075c70000 - 0x0000000075cce000 C:\Program Files\MATLAB\R2013a\bin\win64\libuij.dll 0x0000000072f50000 - 0x000000007318f000 C:\Program Files\MATLAB\R2013a\bin\win64\hgdatatypes.dll 0x0000000005b10000 - 0x0000000005bfb000 C:\Program Files\MATLAB\R2013a\bin\win64\hgutils.dll 0x0000000005c00000 - 0x0000000005cae000 C:\Program Files\MATLAB\R2013a\bin\win64\udd_mi.dll 0x0000000005cb0000 - 0x0000000005ce6000 C:\Program Files\MATLAB\R2013a\bin\win64\libmwgbtutils.dll 0x0000000005cf0000 - 0x0000000005d04000 C:\Program Files\MATLAB\R2013a\bin\win64\libmwgbt.dll 0x0000000005d10000 - 0x0000000005fde000 C:\Program Files\MATLAB\R2013a\bin\win64\uiw.dll 0x0000000005fe0000 - 0x0000000005fe9000 C:\Program Files\MATLAB\R2013a\bin\win64\uinone.dll 0x0000000005ff0000 - 0x0000000006016000 C:\Program Files\MATLAB\R2013a\bin\win64\libmwnativefiledialogs.dll 0x0000000006020000 - 0x000000000602c000 C:\Program Files\MATLAB\R2013a\bin\win64\libmwplatform_res.dll 0x000007fef8760000 - 0x000007fef8778000 C:\Windows\system32\MPR.dll 0x000000005bf70000 - 0x000000005c4cd000 C:\Program Files\MATLAB\R2013a\bin\win64\mfc100.dll 0x000007fefa560000 - 0x000007fefa567000 C:\Windows\system32\MSIMG32.dll 0x000007fef9dd0000 - 0x000007fef9e41000 C:\Windows\system32\WINSPOOL.DRV 0x0000000006030000 - 0x000000000604d000 C:\Program Files\MATLAB\R2013a\bin\win64\mwoles05.DLL 0x0000000006050000 - 0x00000000060bc000 C:\Program Files\MATLAB\R2013a\bin\win64\comcli.dll 0x000000006cd50000 - 0x000000006cd7b000 C:\Program Files\MATLAB\R2013a\bin\win64\ATL100.DLL 0x00000000060c0000 - 0x00000000060cc000 C:\Program Files\MATLAB\R2013a\bin\win64\mlautoregister.dll 0x00000000060d0000 - 0x0000000006226000 C:\Program Files\MATLAB\R2013a\bin\win64\mvm.dll 0x000007fefd800000 - 0x000007fefd857000 C:\Windows\system32\apphelp.dll 0x000007feeacf0000 - 0x000007feeb157000 C:\Windows\AppPatch\AppPatch64\AcXtrnal.DLL 0x000007feff9c0000 - 0x000007feff9ee000 C:\Windows\system32\IMM32.DLL 0x000007fefeff0000 - 0x000007feff0f9000 C:\Windows\system32\MSCTF.dll 0x000007fefc310000 - 0x000007fefc366000 C:\Windows\system32\UxTheme.dll 0x000007fefb400000 - 0x000007fefb418000 C:\Windows\system32\dwmapi.dll 0x000000006e5b0000 - 0x000000006e5bd000 C:\Program Files\MATLAB\R2013a\bin\win64\MFC100ENU.DLL
VM Arguments: jvm_args: -XX:PermSize=32m -Xms64m -XX:NewRatio=3 -XX:MaxPermSize=128m -Xmx196m -XX:MaxDirectMemorySize=2147400000 -Dsun.java2d.noddraw=true -Dsun.awt.nopixfmt=true -Xshare:off -Xrs -Dsun.awt.disableMixing=true -Djava.library.path=C:\Program Files\MATLAB\R2013a\bin\win64;C:\Program Files\MATLAB\R2013a\sys\jxbrowser\win64\lib vfprintf abort java_command: unknown Launcher Type: generic
Environment Variables: PATH=C:\Program Files (x86)\Common Files\ArchestrA\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files (x86)\MiKTeX 2.9\miktex/bin;C:\Program Files (x86)\Mendeley Desktop\wordPlugin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\MATLAB\R2013a\bin;C:\Program Files\MATLAB\R2012a\bin;QUARTUS_ROOTDIR\bin;QUARTUS_ROOTDIR\eda\sim_lib\excalibur\swift\lib\pcnt.lib;QESS_ROOTDIR\bin;C:\Program Files (x86)\Samsung\Samsung PC Studio 3\;C:\Program Files (x86)\Common Files\Roxio Shared\9.0\DLLShared\;C:\Program Files\Microsoft Windows Performance Toolkit\ USERNAME=jovdmerwe OS=Windows_NT PROCESSOR_IDENTIFIER=Intel64 Family 6 Model 23 Stepping 10, GenuineIntel
--------------- S Y S T E M ---------------
OS: Windows 7 Build 7601 Service Pack 1
CPU:total 4 (4 cores per cpu, 1 threads per core) family 6 model 23 stepping 10, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3, sse4.1
Memory: 4k page, physical 4060784k(2111452k free), swap 8119704k(5907348k free)
vm_info: Java HotSpot™ 64-Bit Server VM (14.3-b01) for windows-amd64 JRE (1.6.0_17-b04), built on Oct 11 2009 00:46:08 by "java_re" with MS VC++ 8.0
time: Wed May 14 10:17:56 2014 elapsed time: 0 seconds
================================== C++ code: ==================================
#include "mex.h" #include "math.h"
void mexFunction(int nlhs,mxArray *plhs[],int nrhs,const mxArray *prhs[]) {
int i, k, N, N1, N2;
const double pi = 3.1415926535897;
double a, b, dx, tr, eps;
mxArray *xu, *y, *L, *Lp, *y0;
N=(int)*mxGetPr(prhs[0])-1;
N1=N+1;
N2=N+2;
a=-1;
b=1;
dx=(b-a)/(N1-1);
xu=mxCreateNumericArray(1, &N1, mxDOUBLE_CLASS, mxREAL);
for (i=0;i<=N1;i++)
{
((double*)mxGetPr(xu))[i]=a;
a=a+dx;
}
y0=mxCreateNumericArray(1, &N1, mxDOUBLE_CLASS, mxREAL);
y=mxCreateNumericArray(1, &N1, mxDOUBLE_CLASS, mxREAL);
for (i=0;i<=N1;i++)
{
((double*)mxGetPr(y0))[i]=2;
((double*)mxGetPr(y))[i]=cos((2*i+1)*pi/(2*N+2))+(0.27/N1)*sin(pi*((double*)mxGetPr(xu))[i]*N/N2);
}
L=mxCreateDoubleMatrix(N1, N2, mxREAL);
Lp=mxCreateNumericArray(1, &N1, mxDOUBLE_CLASS, mxREAL);
tr=0;
for (i=0;i<=N1;i++)
{
if (tr<=abs(((double*)mxGetPr(y))[i]-((double*)mxGetPr(y0))[i]))
{
tr=abs(((double*)mxGetPr(y))[i]-((double*)mxGetPr(y0))[i]);
}
}
for (i=0;i<N1;i++)
{
((double*)mxGetPr(L))[i]=1;
((double*)mxGetPr(L))[i+N1]=((double*)mxGetPr(y))[i];
((double*)mxGetPr(Lp))[i+N1]=1;
}
for (k=2;k<=N1;k++)
{
for (i=0;i<N1;i++)
{
((double*)mxGetPr(L))[i+N1*(k)]=((2*k-1)*((double*)mxGetPr(y))[i]*((double*)mxGetPr(L))[i+N1*(k-1)]-(k-1)*((double*)mxGetPr(L))[i+N1*(k-2)])/k;
}
}
}

Answers (2)

Ariel Cohen
Ariel Cohen on 22 May 2017
Edited: Ariel Cohen on 22 May 2017
Try to solve it by:
  1. Reboot and then login as local admin
  2. Rename the user profile you used with MATLAB, for example:
In windows XP, user profile can be found at c:\Document and Settings\<user_profile>\
In windows 7 and above, user profile can be found at c:\users\<user_profile>
Then, rename it to <user_profile>old (add the "old" to the directory name).
Log out from administrator account and login to the user account. A new user profile will be created. (You can copy the Desktop and Documents from the "old" profile to the "new" one). Now, try using MATLAB again. Maybe it will work...
This is the solution I am using for users that have the same issue.

James Tursa
James Tursa on 22 May 2017
Lp=mxCreateNumericArray(1, &N1, mxDOUBLE_CLASS, mxREAL);
:
for (i=0;i<N1;i++)
{
:
((double*)mxGetPr(Lp))[i+N1]=1;
Lp has only N1 elements, but you are writing beyond N1 elements and corrupting memory.

Community Treasure Hunt

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

Start Hunting!