Clear Filters
Clear Filters

Why livescript code disappeared after a failed run?

8 views (last 30 days)
Hi,
While running a Licescript code, MATLAB stopped and I got some error lines (attached+a screenshot), and the script turned blank (the entire code disappeared).
After relaunching MATLAB it got back
(a) Anyone encountered this problem?
(b) I'm worried it might happen again; In case the code won't be restored automatically when I relaunch the program, are there more efficient ways of restoring it except using the command window history?
Thanks
full error lines documentation:
GLReadBufferUtil.readPixels: readPixels error 0x502 840x630, PixelAttributes[fmt 0x80e1, type 0x1401, BGRA8888], AWTGLPixelBuffer[PixelAttributes[fmt 0x80e1, type 0x1401, BGRA8888], dim 840x630x1, pack true, disposed false, valid true, buffer[bytes 2116800, elemSize 4, java.nio.HeapIntBuffer[pos=0 lim=529200 cap=529200]], allowRowStride true, image [840x630, BufferedImage@247896d: type = 1 DirectColorModel: rmask=ff0000 gmask=ff00 bmask=ff amask=0 IntegerInterleavedRaster: width = 840 height = 630 #Bands = 3 xOff = 0 yOff = 0 dataOffset[0] 0]], sz 2116800
GLReadBufferUtil.readPixels: readPixels error 0x502 840x630, PixelAttributes[fmt 0x80e1, type 0x1401, BGRA8888], AWTGLPixelBuffer[PixelAttributes[fmt 0x80e1, type 0x1401, BGRA8888], dim 840x630x1, pack true, disposed false, valid true, buffer[bytes 2116800, elemSize 4, java.nio.HeapIntBuffer[pos=0 lim=529200 cap=529200]], allowRowStride true, image [840x630, BufferedImage@247896d: type = 1 DirectColorModel: rmask=ff0000 gmask=ff00 bmask=ff amask=0 IntegerInterleavedRaster: width = 840 height = 630 #Bands = 3 xOff = 0 yOff = 0 dataOffset[0] 0]], sz 2116800
render process terminated: null
java.lang.NoSuchFieldError: TS_PROCESS_OOM
Exception in thread "AWT-EventQueue-0": com.jogamp.opengl.GLException: Not initialized: ResizeableImpl[Initialized false, realized true, texUnit 0, samples 8,
Factory jogamp.opengl.windows.wgl.WindowsWGLDrawableFactory@3b49c5ea,
Handle 0x5801170b,
Caps GLCaps[wgl vid 8 arb: rgba 8/8/8/1, opaque, accum-rgba 0/0/0/0, dp/st/ms 16/0/8, sample-ext default, dbl, mono , hw, GLProfile[GL4bc/GL4bc.hw], offscr[fbo]],
fboI back 0, front 0, num 0,
FBO front read 0, null,
FBO back write 0, null,
Surface GDISurface[ displayHandle 0x0
, surfaceHandle 0x5801170b
, size 840x630
, UOB[ OWNS_SURFACE | OWNS_DEVICE | WINDOW_INVISIBLE ]
, WindowsWGLGraphicsConfiguration[DefaultGraphicsScreen[WindowsGraphicsDevice[type .windows, connection decon, unitID 0, handle 0x0, owner false, NullToolkitLock[obj 0x3d6c7653]], idx 0], pfdID 8, ARB-Choosen true,
requested GLCaps[rgba 8/8/8/1, opaque, accum-rgba 0/0/0/0, dp/st/ms 16/0/8, sample-ext default, dbl, mono , hw, GLProfile[GL4bc/GL4bc.hw], on-scr[.]],
chosen GLCaps[wgl vid 8 arb: rgba 8/8/8/1, opaque, accum-rgba 0/0/0/0, dp/st/ms 16/0/8, sample-ext default, dbl, mono , hw, GLProfile[GL4bc/GL4bc.hw], offscr[fbo]]]
, surfaceLock <4689eea6, 71182595>[count 1, qsz 0, owner <AWT-EventQueue-0>]
, GDIDummyUpstreamSurfaceHook[pixel 840x630]
, upstreamSurface false ]]
at jogamp.opengl.GLFBODrawableImpl.contextMadeCurrent(GLFBODrawableImpl.java:405)
at jogamp.opengl.GLContextImpl.contextMadeCurrent(GLContextImpl.java:850)
at jogamp.opengl.GLContextImpl.makeCurrent(GLContextImpl.java:709)
at jogamp.opengl.GLContextImpl.makeCurrent(GLContextImpl.java:580)
at jogamp.opengl.GLDrawableHelper.disposeGL(GLDrawableHelper.java:1198)
at jogamp.opengl.GLAutoDrawableBase.destroyImplInLock(GLAutoDrawableBase.java:371)
at com.jogamp.opengl.GLAutoDrawableDelegate.destroyImplInLock(GLAutoDrawableDelegate.java:185)
at jogamp.opengl.GLAutoDrawableBase.defaultDestroy(GLAutoDrawableBase.java:344)
at com.jogamp.opengl.GLAutoDrawableDelegate.destroy(GLAutoDrawableDelegate.java:180)
at com.mathworks.hg.peer.JSSGLOffScreenAutoDrawable.dispose(JSSGLOffScreenAutoDrawable.java:132)
at com.mathworks.hg.peer.GraphicsPeer$2.run(GraphicsPeer.java:189)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
at java.awt.EventQueue.access$500(EventQueue.java:97)
at java.awt.EventQueue$3.run(EventQueue.java:709)
at java.awt.EventQueue$3.run(EventQueue.java:703)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:205)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)

Answers (1)

Tushar
Tushar on 25 Sep 2023
Hi Yohay,
I understand that you are facing problems with restoring your lost Live Script code if MATLAB crashes due to some errors.
I tried to reproduce the issue at my end. I noticed:
  • For MATLAB Scripts (.m): MATLAB prompts us to save the code when we execute it. In case MATLAB crashes, our work is already saved in this scenario.
  • For MATLAB Live Scripts (.mlx): However, with Live Scripts, MATLAB does not save the code before executing it. Consequently, if MATLAB crashes, your work would be lost, which is the issue you are facing.
Hence, it is recommended to save the Live Script file before executing it to avoid such issues. If you forget to save the code and MATLAB crashes after executing the Live Script, you can find the autosaved Live Script here (applicable only to Windows machines):
  • Navigate to the '%temp%' folder. You can search for this in Windows Explorer or Start.
  • Locate the 'Editor_xxxxx' folder.
  • Inside this folder, you will find a Script file (.m) containing only the code section, not the text section of the Live Script you are looking for, named 'LiveEditorEvaluationHelper_xxxxxxxxx.m'.
Hope this helps!

Categories

Find more on Scripts 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!