Bug - Not A Bug Mafia freezing up/lagging

dorian78

New member
I've been having problems with mafia lagging badly for the last week or more. I've posted about it in another thread on here (which I was pointed to), but I don't think I'm actually experiencing the same problem. Since that problem seems to have resolved itself and mine hasn't, I figured the appropriate thing to do was start my own bug report thread. I know a problem like this is difficult to solve, but when it gets to the point that manually playing my adventures is faster than using mafia, it makes me want to give up, and I don't want that. So I'll do my best to describe the problem.

This problem started over a week ago, and has been occurring consistently since then. Mafia is constantly hanging up and freezing, much like when there's heavy lag from a big event like Crimbo. It happens all the time - while logging in, while running breakfast, while doing mundane tasks (inventory/familiar changes, mall stuff, etc...) and constantly while running turns (I've just been trying to farm in aftercore). I'd say I can't go more than about 100 clicks without it happening, and sometimes it's as few as 2-3 clicks between freezes. If I'm in the relay browser, the freeze comes through as a whitescreen, which I can solve by manually reloading the page. If I'm using the CLI or in the middle of automation, it just freezes up. Since turning on the "forcibly time out laggy requests" option, it does eventually recover from these hang-ups, but only after a minute or two. It's really gotten to the point where I can run my turns manually faster than waiting for it to push through the hangups.

I know the first inclination is to say that a problem like this is coming from outside mafia, but I feel like I'm about out of options. I'm not the most technically savvy person (no knowledge of coding at all), but I'm competent enough, and here's what I've tried/ruled out:

1. Mafia build. I've updated the build several times. This problem has happened in at least 11907, 11917, and the one I'm currently running, which is 11924.
2. Internet connection. I have the same problem when bringing my laptop to other wifi networks.
3. KoL itself. Logging in using the vanilla interface is lightning fast. There's no sign of any lag at all when trying to play without mafia. Always. Every single time I try it. I even tried downloading KoLproxy - it wasn't particularly capable of what I wanted, but there certainly wasn't any problem with hangups while using it.
4. Browser. I usually use IE10, I tried Firefox as well. I think the fact that it sometimes freezes up while logging in pretty much rules out browser problems, though.
5. Java. I had some version of Java 7, downgraded to 6, and then back up to the newest version of 7. Still experienced the same problem consistently.

So I feel like this problem is only happening when using mafia. If it was just a little bit of lag, I'd get over it - we all know it happens sometimes. I've never seen it so consistent a problem for so long a period of time, though. This has gotten chronic to the point of unplayable, and I'd really appreciate any help anyone can offer. I've attached all the debug logs I have since this started happening. Like I said, I don't have the tech knowledge to understand them, but I wouldn't be surprised if they're all just the typical kind of debug log generated when mafia gets out of sync with itself (which has been happening a lot due to the lag). Thanks in advance for any help!
 

Attachments

Last edited:
A lot of times when people attempt to downgrade, they do so improperly, damaging their Java installation. Try removing every trace of every JRE from your system then reinstalling 6.

There are some other things in the debug logs that I'm taking a look at, but nothing jumps out as a thing that will cause lag. Mostly your symptoms sound like really bad packet loss, and perhaps mafia/Java handle it less gracefully than the other things you've tried. You might try opening a console and trying "ping kingdomofloathing.com -n 1000", letting that run, and see how good/bad your connection is.
 
KoLmafia v15.9 r11924, Windows 8, Java 1.7.0_15

I realize you dropped back to Java 6, didn't see any changes and so restored 7 but I'd feel more comfortable if you were running something else, say Java 1.6.0_37. I'll also note you are running Windows 8 and I don't know that there is much experience with KoLmafia on Windows 8.
 
P.S. I see chat references. Have you tried closing down all chat windows and seeing whether you have a better experience. Right now in the dev world, "chat is scary" ;-)
 
My Win8 64-bit works fine with mafia. But then, I'm running Java 1.6.31 on purpose and avoiding upgrades until there's a major reason. And my mafia runs in a Dropbox-ed folder so that it doesn't have UAC issues tied into the whole "You have Win8? That means you want UAC on FOREVER even if you turn it off! Muahaha. Ha. Ha." issues.

[sub]Also, I know you CAN turn off UAC and have it stay off with the Group or Security Policy editors, but then Metro apps get stuck and whine about their updates and can't actually launch because, shocker, UAC is off and MS said Metro apps only work when UAC is on. Thanks MS. You're awesome. And I'm avoiding telling people who have a choice that Win8 is a good option. Just like Vista.[/sub]
 
FYI, Theraze, Oracle release 6.41 and it'll be the last update EVAR! At least according to them. So... 31 for life?

As far as a different version of Java goes, I keep 7 on my system, but I also have 6 in it's own folder in case I need it, like for mafia. Just a thought.
 
My new computer came with Win 8 (and thus whatever the newest version of Java was about 2 months ago), but there were never any problems running on it until a week ago. I typically don't even open the chat pane during my sessions, so I'm a little surprised to see anything related to chat in the logs. I usually open it so I can /whois Jick to confirm that it never has been and never will be an 8 day, and then close chat for the rest of the session.

A lot of times when people attempt to downgrade, they do so improperly, damaging their Java installation. Try removing every trace of every JRE from your system then reinstalling 6.

There are some other things in the debug logs that I'm taking a look at, but nothing jumps out as a thing that will cause lag. Mostly your symptoms sound like really bad packet loss, and perhaps mafia/Java handle it less gracefully than the other things you've tried. You might try opening a console and trying "ping kingdomofloathing.com -n 1000", letting that run, and see how good/bad your connection is.

Trying to ping resulted in the following summary:

Packets sent = 1000, packets received = 997, Lost = 3 (0% loss)
Approximate round-trip times in milliseconds - 77ms minimum, 3529 ms maximum, 89ms average.

My brief take on it as it went by was that almost all were between 79-83ms. Some handful were in the 90's, and a few outliers were 100's, 300's, 400's, or apparently 3529.

I'll try re-installing 6 again, but that may take a little bit of time. For what it's worth, when mafia freezes up, I find it's often already accomplished whatever the click was (outside of combat). If I change gear and it freezes up, the gear's actually been changed, mafia just hasn't caught it and given me the green light. If I go into the relay browser and pull up my inventory, it's already been changed, even though mafia is still processing. I'd say that's nothing special, as I've experienced that many times in the past with brief amounts of lag, but it's pretty consistent about reacting that way now too.
 
Ok - Java 6.37 is installed again. I still seem to be having the occasional whitescreen problem in the relay browser. I'll keep you posted tomorrow on how it fares with running turns, and if there's a debug log generated from that.
 
Latest update - signing in after rollover was alright. I probably did about 10 minutes of automated breakfast and manual start-of-day stuff with only about 4 hang-ups, which is really good. Trying to actually run turns this morning was horrible, though. This is with Java 6.37.

I gave up and took my whole mafia folder, put it on a flash drive, and ran it on another laptop on my same wifi network. It worked perfectly. I'd forgotten what it was like to run so quickly. The to other computer is a Mac running Mountain Lion, but since it's a Mac (which means it's completely unintuitive and impossible for me to find anything ever), I have no idea what version of Java it has. I kind of think it doesn't matter, though.

To me, this says that there's something wrong with the way mafia is interacting with my computer. Is it possible that something that was changed shortly after AoJ rolled makes it not happy with Windows 8? I don't know how many other mafia users you have who use Windows 8, but I didn't really have a choice when I bought my new computer. No new debug logs to share. Any thoughts?
 
Step one is, make sure it's running as an administrator. If that doesn't fix it, step two, use Javara to clean up all weird Java files that are left before rebooting and reinstalling Java 1.6.37 (or 1.6.41). Then run it again as an administrator.
 
Grasping at straws, especially since I don't have a Windows 8 box to play with.

If you run from the thumb drive on the Windows box is that better, worse or the same? Did your machine come with any anti-virus software? Can you disable it and then run mafia? (I had a new Windows 7 machine with Trend Micro's AV installed and it made the machine useless. For example, it insisted on scanning every jar file every time the file was accessed. It took 20 minutes to start up IntelliJ - the Java IDE that was in use).
 
I gave up and took my whole mafia folder, put it on a flash drive, and ran it on another laptop on my same wifi network. It worked perfectly. I'd forgotten what it was like to run so quickly. The to other computer is a Mac running Mountain Lion, but since it's a Mac (which means it's completely unintuitive and impossible for me to find anything ever), I have no idea what version of Java it has. I kind of think it doesn't matter, though.

Are you sure you copied everything (scripts, relay scripts, data, chat logs, session logs, ...) where mafia would look for it on the Mac?
Try fresh install of mafia on the windows machine (rename all mafia-created directories so that it creates new ones instead) - iirc on windows just running mafia from a different folder is sufficient?
 
Step one is, make sure it's running as an administrator. If that doesn't fix it, step two, use Javara to clean up all weird Java files that are left before rebooting and reinstalling Java 1.6.37 (or 1.6.41). Then run it again as an administrator.

Done. JavaRa found 1 extra file the uninstaller didn't find, but it didn't change anything after re-installing.

Are you sure you copied everything (scripts, relay scripts, data, chat logs, session logs, ...) where mafia would look for it on the Mac?
Try fresh install of mafia on the windows machine (rename all mafia-created directories so that it creates new ones instead) - iirc on windows just running mafia from a different folder is sufficient?

Yup. All those folders are sub-folders in a big folder I just call KoLmafia. I put it on the flashdrive, and then dumped it onto the desktop of the Mac, just like it lives on the desktop of my PC. After running my turns on the Mac today, I completely deleted the folder on my PC and then copied the folder back from the Mac. Was that what you were talking about? It didn't change anything either.

Try plugging the W8 laptop into ethernet and seeing what happens.

Awkward to do in my home, but I did. It hung up on login, so I didn't wait to go further.

Grasping at straws, especially since I don't have a Windows 8 box to play with.

If you run from the thumb drive on the Windows box is that better, worse or the same? Did your machine come with any anti-virus software? Can you disable it and then run mafia? (I had a new Windows 7 machine with Trend Micro's AV installed and it made the machine useless. For example, it insisted on scanning every jar file every time the file was accessed. It took 20 minutes to start up IntelliJ - the Java IDE that was in use).

Running from the thumbdrive is at least the same. Certainly not better. You very well might be onto something with Antivirus software, though. If not, it's a mighty big coincidence that you mentioned it. Thank you for grasping at straws. The new PC came with a free month of McAfee. After it expired, I installed Avast, which is what I've used for years. Apparently I hadn't updated it in years, though, so the new computer kept asking me to update it to version 7 instead version 4 or whatever I had been running for years. That version was installed more or less on the day the problem started: 2/20, the day I broke prism on my one AoJ run. I never would have thought that had anything to do with anything. I guess I'll try uninstalling it and see what happens. If it is the problem, are there settings I should be looking to change, or should I just find a new anti-virus program? Or go with an older version?
 
You may need to set an exception for your Java... it's a fairly common lazy-antivirus-causes-problems target. Azureus/Vuze used to have step by step directions blaming various antivirus programs for it being slow with screenshots for how to fix it... but that was years ago. Back when people actually used Azureus. :)
 
Sweet mother of all that's holy, it was indeed the Antivirus software. Everything's back to normal once I uninstalled it. I guess I'll re-install it and go poke around in the settings, and if that fails, either go back to an older version or pick a different program. Thanks so much to everyone who tried to help me with this - I knew it was going to be something stupid, personal, and involve a lot of guessing/trial and error. An extra-special batch of internet cookies to fronobulax!!!!
 
- Something changed on your system.
- KoLmafia did not change
- KoLmafia stopped working correctly on your system
My conclusion: something that changed on your system broke KoLmafia
Your conclusion: KoLmafia is broken

Considering that "Nothing Has Changed" in KoLmafia to explain the difference in your behavior, whatever changed HAD to be on your system.

Glad you figured it out.

Too bad it took hours of effort on our part to determine the problem.
 
Last edited:
You know, that attitude is why I didn't post here for a week to begin with, and instead contacted Roippi privately since I know him outside of his connection with KoLmafia. Not all of us are as technically savvy as those who develop this wonderful program. My conclusion was never that mafia was broken - it was that something wasn't working somewhere and I had no idea how to fix it. How am I supposed to know nothing changed with KoLmafia? You guys release new builds all the time, and certainly added stuff when AoJ rolled out.

I'm not at all surprised to find out that it was something on my system causing the problem, but it seems a bit much to expect everyone to always be able to figure out the culprit without the generous help of people who know more about these things. If everyone had just said "the problem's with your system, go figure it out and don't waste our time," I doubt I'd have figured it out, and may very well have gotten frustrated enough to quit KoL altogether. It's not like there's another more appropriate place to turn to for help in figuring it out.

I feel like I've tried to be nothing but polite, and expressed gratitude at every turn. Everyone else here has been helpful, nice, generous, and patient with someone less technically fluent than themselves. I'm sorry you feel the way you do - it really detracts from the great goodwill the rest of your colleagues have.
 
Back
Top