Bug Issue: BufferUnderFlowException

Pages: 1


  • Junior Stencyler
March 07, 2019, 02:25:36 pm
I've been using Stencyl for a little while now, though I haven't used the forum quite as much, so I hope this is in the right place.
Recently I've encountered what Stencyl calls a buffer underflow exception which has rendered me unable to do anything.

More specifically, the problem appears whenever I try to save, open anything (actor type, scene, any behaviour...), run or publish the game. I originally had Stencyl downloaded to a USB and have since reinstalled the same (and currently the newest) version on my laptop's hard drive, but to no avail. I've tried installing Stencyl on another PC and importing over the game files, only to encounter the same error.  At this point, I can't do anything with my game without bringing it up.

I've found this issue elsewhere on the forum, but I can't seem to find a solution. I'd prefer if someone could help sooner rather than later as the game must be finished by March 12 :)

(I have the log downloaded, but can't seem to attach it, so here's what I found under "Details": )
Code: [Select]
java.lang.RuntimeException: java.nio.BufferUnderflowException
at stencyl.sw.app.tasks.StencylWorker.done(StencylWorker.java:74)
at stencyl.sw.app.tasks.SaveGameTask.done(SaveGameTask.java:58)
at javax.swing.SwingWorker$5.run(SwingWorker.java:737)
at javax.swing.SwingWorker$DoSubmitAccumulativeRunnable.run(SwingWorker.java:832)
at sun.swing.AccumulativeRunnable.run(AccumulativeRunnable.java:112)
at javax.swing.SwingWorker$DoSubmitAccumulativeRunnable.actionPerformed(SwingWorker.java:842)
at javax.swing.Timer.fireActionPerformed(Timer.java:313)
at javax.swing.Timer$DoPostEvent.run(Timer.java:245)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:756)
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:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:726)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
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)
Caused by: java.nio.BufferUnderflowException
at java.nio.Buffer.nextGetIndex(Buffer.java:506)
at java.nio.HeapByteBuffer.getInt(HeapByteBuffer.java:361)
at stencyl.core.lib.io.read.SceneReader.readLayer(SceneReader.java:918)
at stencyl.core.lib.io.read.SceneReader.readData(SceneReader.java:903)
at stencyl.core.lib.io.read.SceneReader.read(SceneReader.java:283)
at stencyl.core.lib.scene.SceneModel.load(SceneModel.java:236)
at stencyl.core.lib.scene.SceneModel.generateMbs(SceneModel.java:857)
at stencyl.core.lib.scene.SceneModel.lambda$generateMbsIfMissing$0(SceneModel.java:826)
at stencyl.sw.io.MbsCache.generateMbsIfMissing(MbsCache.java:34)
at stencyl.core.lib.scene.SceneModel.generateMbsIfMissing(SceneModel.java:826)
at stencyl.sw.io.write.resource.ScenesWriter.write(ScenesWriter.java:108)
at stencyl.sw.io.write.MasterWriter.saveGame(MasterWriter.java:93)
at stencyl.sw.app.tasks.SaveGameTask.doInBackground(SaveGameTask.java:35)
at stencyl.sw.app.tasks.SaveGameTask.doInBackground(SaveGameTask.java:15)
at javax.swing.SwingWorker$1.call(SwingWorker.java:295)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at javax.swing.SwingWorker.run(SwingWorker.java:334)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)

I'm beginning to worry if I've somehow corrupted my game data. Thanks in advance if anyone can offer help.
« Last Edit: June 28, 2019, 05:05:56 am by Justin »


  • Master Stencyler
  • *
March 07, 2019, 04:19:15 pm
Perhaps one of your scenes was corrupted.

Right before it prints the exception in the log, does it mention which scene it's trying to open? Given the error, it may be a problem with one of your scene .scn files (Tools > Workspace > View Workspace Folder --> games, [game name], scenes, *.scn).


  • Junior Stencyler
March 08, 2019, 10:32:14 am
I couldn't find the problematic scene, but I've deleted all the scene data and that seems to have solved the problem. (I can redo all my scenes with minimal effort.)

Thank you so much for your help - you're a saviour! :D

Issue updated by Justin - June 28, 2019, 05:13:40 am
  • Status changed from New to Closed

Pages: 1


  • Reported
    March 07, 2019, 02:25:36 pm
  • Updated
    June 28, 2019, 05:13:40 am

  • View Status
  • Type
  • Status
  • Priority
  • Version
    Stencyl 3.5
  • Fixed in
  • Assigned to
  • Category
    Compiling/Testing Games