Bug - Cannot Reproduce Server crash

TaPol

New member
Hi, Hope I'm doing this right?? There has been a major crash, log below.

Thanks
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
KoLmafia v20.4 r20144, Windows 10, Java 13
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Please note: do not post this log in the KoLmafia thread of KoL's
Gameplay-Discussion forum. If you would like the KoLmafia dev team
to look at it, please write a bug report at kolmafia.us. Include
specific information about what you were doing when you made this
and include this log as an attachment.
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Timestamp: Thu Jun 04 16:55:07 AWST 2020
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=


Unexpected error, debug log printed.
class java.lang.StringIndexOutOfBoundsException: String index out of range: -21
java.lang.StringIndexOutOfBoundsException: String index out of range: -21
at java.base/java.lang.String.substring(String.java:1876)
at net.sourceforge.kolmafia.session.StoreManager.update(StoreManager.java:302)
at net.sourceforge.kolmafia.request.ManageStoreRequest.managePrices(ManageStoreRequest.java:243)
at net.sourceforge.kolmafia.request.ManageStoreRequest.run(ManageStoreRequest.java:199)
at net.sourceforge.kolmafia.RequestThread.postRequest(RequestThread.java:300)
at net.sourceforge.kolmafia.RequestThread.postRequest(RequestThread.java:250)
at net.sourceforge.kolmafia.swingui.StoreManageFrame$StoreManagePanel.actionCancelled(StoreManageFrame.java:327)
at net.sourceforge.kolmafia.swingui.panel.GenericPanel$CancelledListener.execute(GenericPanel.java:639)
at net.sourceforge.kolmafia.swingui.listener.ThreadedListener.run(ThreadedListener.java:239)
at net.sourceforge.kolmafia.RequestThread$SequencedRunnable.run(RequestThread.java:432)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:830)
 

Veracity

Developer
Staff member
Code:
		// Strip introductory "header" from the string so that we can simplify the matcher.
		storeText = storeText.substring( storeText.indexOf( "in Mall:</b></td></tr>" ) + 22 );
I can see how substring could be given an index of 21, but not -21. If you don't have anything in inventory, it says "Your store has no inventory." rather than having a table of items. It shouldn't bother trying to skip past the header in that case, but it doesn't break, in my testing.
Revision 20170 makes it not bother, if it can't find the header.
I can't claim this fixes your issue, since neither you nor I could reproduce it.
So, I'm closing this.
 
Top