Bug - Fixed Mall errors

Asinine

New member
I've been encountering this for a while now, but I'm finally getting around to make note of it (I kept thinking it'd be fixed in the next build...)

Basically, when I place things in the mall or when I click the mall button to bring up the mall screen (or refresh the one already there), I randomly get the "Unexpected error, debug log printed".

I seem to get it the most on only one character, although the others occasionally see it. It happens both when items are placed in the mall by an .ash script as well as when I do it manually. It used to be that the item wouldn't appear in the mall until I got a successful mall screen refresh, but this doesn't seem to be the case as of the past few months.

Another thing is that if it happens once, it's much more likely to continue happening until I close/restart Mafia.

Here's the log:
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
KoLmafia r8475, Windows XP, Java 1.6.0_18
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Please note: do not post this log in the KoLmafia thread. If you
would like the 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 the log as an attachment.
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Timestamp: Fri Jun 04 09:52:25 CEST 2010
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=


Unexpected error, debug log printed.
class java.lang.ArrayIndexOutOfBoundsException: 39 >= 39
java.lang.ArrayIndexOutOfBoundsException: 39 >= 39
at java.util.Vector.elementAt(Unknown Source)
at javax.swing.table.DefaultTableModel.getValueAt(Unknown Source)
at com.sun.java.forums.TableSorter$Row.compareTo(TableSorter.java:352)
at java.util.Arrays.mergeSort(Unknown Source)
at java.util.Arrays.mergeSort(Unknown Source)
at java.util.Arrays.mergeSort(Unknown Source)
at java.util.Arrays.mergeSort(Unknown Source)
at java.util.Arrays.sort(Unknown Source)
at com.sun.java.forums.TableSorter.getViewToModel(TableSorter.java:268)
at com.sun.java.forums.TableSorter.modelIndex(TableSorter.java:276)
at com.sun.java.forums.TableSorter.getValueAt(TableSorter.java:322)
at javax.swing.JTable.getValueAt(Unknown Source)
at javax.swing.JTable.prepareRenderer(Unknown Source)
at net.sourceforge.kolmafia.swingui.table.TransparentTable.prepareRenderer(TransparentTable.java:62)
at javax.swing.plaf.basic.BasicTableUI.paintCell(Unknown Source)
at javax.swing.plaf.basic.BasicTableUI.paintCells(Unknown Source)
at javax.swing.plaf.basic.BasicTableUI.paint(Unknown Source)
at javax.swing.plaf.ComponentUI.update(Unknown Source)
at javax.swing.JComponent.paintComponent(Unknown Source)
at javax.swing.JComponent.paint(Unknown Source)
at javax.swing.JComponent.paintChildren(Unknown Source)
at javax.swing.JComponent.paint(Unknown Source)
at javax.swing.JViewport.paint(Unknown Source)
at javax.swing.JComponent.paintChildren(Unknown Source)
at javax.swing.JComponent.paint(Unknown Source)
at javax.swing.JComponent.paintToOffscreen(Unknown Source)
at javax.swing.BufferStrategyPaintManager.paint(Unknown Source)
at javax.swing.RepaintManager.paint(Unknown Source)
at javax.swing.JComponent._paintImmediately(Unknown Source)
at javax.swing.JComponent.paintImmediately(Unknown Source)
at javax.swing.RepaintManager.paintDirtyRegions(Unknown Source)
at javax.swing.RepaintManager.paintDirtyRegions(Unknown Source)
at javax.swing.RepaintManager.seqPaintDirtyRegions(Unknown Source)
at javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(Unknown Source)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at sun.reflect.GeneratedMethodAccessor23.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at net.sourceforge.foxtrot.pumps.ConditionalEventPump.pumpEvents(ConditionalEventPump.java:99)
at net.sourceforge.foxtrot.AbstractSyncWorker.post(AbstractSyncWorker.java:94)
at net.sourceforge.foxtrot.AbstractSyncWorker.post(AbstractSyncWorker.java:120)
at net.sourceforge.foxtrot.ConcurrentWorker.post(ConcurrentWorker.java:94)
at net.sourceforge.kolmafia.KoLmafiaGUI.constructFrame(KoLmafiaGUI.java:295)
at net.sourceforge.kolmafia.KoLmafiaGUI.constructFrame(KoLmafiaGUI.java:268)
at net.sourceforge.kolmafia.swingui.button.DisplayFrameButton.run(DisplayFrameButton.java:66)
at net.sourceforge.kolmafia.swingui.button.ThreadedButton.actionPerformed(ThreadedButton.java:76)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
at java.awt.AWTEventMulticaster.mouseReleased(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
 

fronobulax

Developer
Staff member
I regularly get a stack trace when I place something in the mall, change the price and then Save prices. My error seems to be generated after saving prices, while refreshing the screen. I was unable to find where the problem was occurring but, since it seemed to have no effect on anything, I did not worry about it. I will try and confirm that my error and yours are the same. If they are, I would not expect a fix. I seem to recall reporting my error in the developer forum a year or two ago and the consensus seems to be that there is no compelling reason to track it down and fix it.
 

Asinine

New member
Gotcha. I don't really think it's a huge bug or anything, and with more recent builds it doesn't totally fubar Mafia. I've never encountered it when saving prices, only when clicking the Store Manager icon, or placing things in the mall (manually or by scripts).

Ah well. Thanks for the info!
 

Veracity

Developer
Staff member
This happens frequently for me when I save prices - and for me, it makes the Store Manager completely unusable until I restart.
 

fronobulax

Developer
Staff member
I have attached my stack trace just in case someone wants to confirm that we are all seeing the same bug. Three comments: First, the way I run mafia, it doesn't always capture stack traces in debug logs, so this was generated by a copy and paste from the command window. Second, the Store Manager is usable after I see this. Finally, I believe there are 222 items in my store. If I counted correctly that may make the index of 221 "interesting".

I have looked at this a bit in the debugger but I never got enough useful information to actually figure out where to even look for the source of the problem. The fact that I have very little practical experience with swing and awt probably contributed to that.
 

Attachments

  • debug.txt
    4.9 KB · Views: 110

Veracity

Developer
Staff member
This is irritating me, so I've been running in Eclipse - and not seen the issue since.
I WILL find this...
 

fronobulax

Developer
Staff member
This is irritating me, so I've been running in Eclipse - and not seen the issue since.
I WILL find this...
If it is any consolation, I gave up trying to find it with Netbeans. If my memory is correct I got to a point where control passed to another thread. I could not figure out context well enough to be useful and the obvious breakpoint would have triggered way too often so I gave up. It is repeatable for me so I can certainly test things if you need it.
 

Veracity

Developer
Staff member
Exception saving prices in Store Manager

Put various items into your store.
Open the Store Manager
Set prices on several of them.
Click the "save prices" button
See the following stack trace.

Usually, all is well and I can continue to manipulate things in the store. Sometimes, the Store Manager is unusable and I have to exit and restart.

Code:
Exception in thread "AWT-EventQueue-0" java.lang.ArrayIndexOutOfBoundsException: 18
	at com.sun.java.forums.TableSorter.modelIndex(TableSorter.java:276)
	at com.sun.java.forums.TableSorter.getValueAt(TableSorter.java:322)
	at javax.swing.JTable.getValueAt(JTable.java:2686)
	at javax.swing.JTable.prepareRenderer(JTable.java:5703)
	at net.sourceforge.kolmafia.swingui.table.TransparentTable.prepareRenderer(TransparentTable.java:64)
	at javax.swing.plaf.basic.BasicTableUI.paintCell(BasicTableUI.java:2072)
	at javax.swing.plaf.basic.BasicTableUI.paintCells(BasicTableUI.java:1974)
	at javax.swing.plaf.basic.BasicTableUI.paint(BasicTableUI.java:1770)
	at javax.swing.plaf.ComponentUI.update(ComponentUI.java:153)
	at javax.swing.JComponent.paintComponent(JComponent.java:752)
	at javax.swing.JComponent.paint(JComponent.java:1029)
	at javax.swing.JComponent.paintChildren(JComponent.java:862)
	at javax.swing.JComponent.paint(JComponent.java:1038)
	at javax.swing.JViewport.paint(JViewport.java:766)
	at javax.swing.JComponent._paintImmediately(JComponent.java:5098)
	at javax.swing.JComponent.paintImmediately(JComponent.java:4882)
	at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:812)
	at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:714)
	at javax.swing.RepaintManager.prePaintDirtyRegions(RepaintManager.java:694)
	at javax.swing.RepaintManager.access$700(RepaintManager.java:41)
	at javax.swing.RepaintManager$ProcessingRunnable.run(RepaintManager.java:1672)
	at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:677)
	at java.awt.EventQueue.access$000(EventQueue.java:85)
	at java.awt.EventQueue$1.run(EventQueue.java:638)
	at java.awt.EventQueue$1.run(EventQueue.java:636)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:647)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:296)
	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:211)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:201)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:196)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:188)
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
 

fronobulax

Developer
Staff member
I used to see something like this a lot - perhaps as much as two years ago. I started using Bale's OCD to do my pricing which is why I have not seen it lately. I just tried to reproduce with only one item being repriced and could not reproduce so I suspect setting the prices on multiple items is key. Will confirm (not that a report of veracity's needs confirmation ;-) ) later.
 

fronobulax

Developer
Staff member
I cannot reproduce this. :S

Neither could I, to my surprise. I thought it was triggered when there were multiple items priced at 999,999,999 and I changed the prices on all of them before saving but things worked for "multiple == 2".
 

Veracity

Developer
Staff member
This happens to me every single day. It just happened to me now. Repeatedly. Here is a sample:

Initial store inventory:

d10 100
d20 240
d4 25000
d8 275
breath mint 999,999,999
d12 999,999,999
d6 999,999,999
Yummy Tummy bean 999,999,999

Set prices:

d10 100
d20 240
d4 20000
d8 275
breath mint 750
d12 2475
d6 300
Yummy Tummy Bean 100

Hit Save Prices

List reorders:

breath mint 750
d10 100
d12 2475
d20 240
d4 20000
d6 300
d8 275
Yummy Tummy bean 100

Set prices:

breath mint 999999999
d10 100
d12 999999999
d20 240
d4 25000
d6 999999999
d8 275
Yummy Tummy bean 999,999,999

Save prices. List reorders to

d10 100
d20 240
d4 25000
d8 275
breath mint 999,999,999
d12 999,999,999
d6 999,999,999
Yummy Tummy bean 999,999,999

Set prices:

d10 100
d20 240
d4 20000
d8 275
breath mint 750
d12 2475
d6 300
Yummy Tummy Bean 100

Hit Save Prices

List reorders:

breath mint 750
d10 100
d12 2475
d20 240
d4 20000
d6 300
d8 275
Yummy Tummy bean 100

Any of those "Save Prices" MIGHT generate a stack trace. In my test, both of the first two - assigning prices (with price analysis) to previously unpriced items, and then reassigning them all to 999999999 - generated a stack trace, but when I did it again, neither generated a stack trace.
 
Top