Page 2 of 3 FirstFirst 1 2 3 LastLast
Results 11 to 20 of 28

Thread: Mafia freezes and becomes unplayable, don't know if it is with Mafia or my system

  1. #11
    Developer fronobulax's Avatar
    Join Date
    Feb 2009
    Location
    Central Virginia, USA
    Posts
    4,198

    Default

    Frono: the "Looking at item #..." message is passed into KoLmafia.updateDisplay(), which shouldn't show up in the gCLI (I think).

    edit: I also believe it only should invoke that if you encounter an item that isn't in Mafia's datafiles.
    Originally Posted by heeheehee View Post
    If I followed it right, it ends up in System.out but there is so much opportunity for me to be wrong... That said, I didn't see it displayed anywhere during my quick test so there is something different. If you are correct in that it is an item not found in KoLmafia's database then either the database got corrupted or it is something "their" character has that mine doesn't. Hmmm....
    You just vehemently agreed with me
    Originally Posted by Veracity View Post
    I agree with frono.
    Originally Posted by Veracity View Post

  2. #12

    Default

    I think you missed this.

    It doesn't appear to be an issue with the version - having done this previously (and just trying out version 18273 from 2 Dec 2017, which freezes while "Looking at item #...").
    Originally Posted by WARriorer View Post
    So a variety of items (crimbo, clan carnival, etc) could have triggered it.

    I can also confirm that the "Looking at item #..." appears at the gCLI for items not found in the mafia database. It is where i copied the items i pasted in the Feb 2018 IotM thread.

  3. #13
    Junior Member
    Join Date
    Nov 2017
    Location
    Singapore
    Posts
    9

    Default

    Sorry for the late response. It was already way past midnight at the time of my last post.

    Sounds like jps and jstack are part of the development environment which you don't have installed. Not worth getting you to try that yet.

    Since I infer sometimes the symptoms occur at startup.

    Consider this:

    Launch KoLmafia but do not log in. (Disable auto login and restart if necessary).
    Open the gCLI using General->Graphical CLI from the Login Screen
    Wait because this step takes more time than most people should but still less than two minutes on my system.
    When the gCLI opens, switch to it.
    Click the Preferences button.
    Navigate to Look & Feel -> Main Interface.
    Make sure Relay Server and Loathing Chat are NOT listed under Startup as Window and Startup in Tabs.
    (Change things if they are).
    Close the Preferences Window.
    Optionally separate the Login and gCLI windows so you can watch the latter while interacting with the former.
    Select the Login Window and log in.
    Observe the gCLI.

    My experience has been that if something unexpected happens it appears in the gCLI and with a red font color.
    On my system, I open the gCLI in a tab during start up. This it is expected when KoLmafia closes the gCLI window and creates a gCLI tab. Just switch if/when that happens and know if it did that is expected.

    I notice I just did that and never saw "Looking at item". It is emitted by the code in APIRequest but I wonder why you see it and I don't? In Ye Olden Days when I got paid to write code we had several problems with JSON. They were all related to our code failing to link at run time to the expected JSON library. Grasping at straws but maybe there is something in APIRequest handling...
    Originally Posted by fronobulax View Post
    With the latest build (r18460) it still freezes on logging in (at different stages) with no red text appearing. For the preferences, I have nothing set on "Startup as Window", and only 5 items under "Startup in Tabs":
    Adventure
    Graphical CLI
    Purchases
    Gear Changer
    Skill Casting

    I can also confirm that the "Looking at item #..." appears at the gCLI for items not found in the mafia database. It is where i copied the items i pasted in the Feb 2018 IotM thread.
    Originally Posted by theo1001 View Post
    Yep, with r18460 the "Looking at item #..." no longer appears, although the freezes still occur (and thus doesn't seem to be an isolated issue with the looking up of unknown items).

  4. #14
    Developer
    Join Date
    Aug 2009
    Posts
    2,821

    Default

    I can also confirm that the "Looking at item #..." appears at the gCLI for items not found in the mafia database. It is where i copied the items i pasted in the Feb 2018 IotM thread.
    Originally Posted by theo1001 View Post
    You sure that it appears in the gCLI? Typically that's caused by invocations to RequestLogger.printLine(), as is the case with "Unknown item found: ..." (which is what you seem to be citing), whereas the "Looking at item #.." message appears in ApiRequest and is passed to KoLmafia.updateDisplay(), which (if my memory serves me correctly) just updates the status text bar on the login screen and the Adventure frame. (Aside, you also shouldn't copy from the gCLI, since it turns tabs into spaces)

    With the latest build (r18460) it still freezes on logging in (at different stages) with no red text appearing.
    Originally Posted by WARriorer View Post
    I'm a bit late to the game, but can you upload a debug log (preferably with network requests enabled)? Steps to set up those below:

    1. General > Preferences, Extra Debugging > check "Verbosely log communication between KoLmafia and browser"
    2. Help > Start Debug Log
    3. Try logging in.

    If nothing else, this should tell us the last section of code Mafia successfully executes, but if we're lucky, it'll point to further problems.

  5. #15
    Junior Member
    Join Date
    Nov 2017
    Location
    Singapore
    Posts
    9

    Default

    If nothing else, this should tell us the last section of code Mafia successfully executes, but if we're lucky, it'll point to further problems.
    Originally Posted by heeheehee View Post
    I've tried replicating the freeze for the log in but so far it has been smooth (the freezing behaviour does seem quite erratic).

    However, I can reliably reproduce the freezes when running scripts. Here is a debug log from the log in up until it freezes while running EatDrink.ash:
    https://paste.ee/p/vLzod

    It is a 3.1MB file (due to the verbose debug log), and it seems to freeze while awaiting the server reply.

    I'll run another debug log when I execute VeracityMeatFarm.ash to see if I'm able to capture the instance of the script crashing.
    Last edited by WARriorer; 02-14-2018 at 05:59 AM.

  6. #16

    Default

    You sure that it appears in the gCLI? Typically that's caused by invocations to RequestLogger.printLine(), as is the case with "Unknown item found: ..." (which is what you seem to be citing), whereas the "Looking at item #.." message appears in ApiRequest and is passed to KoLmafia.updateDisplay(), which (if my memory serves me correctly) just updates the status text bar on the login screen and the Adventure frame. (Aside, you also shouldn't copy from the gCLI, since it turns tabs into spaces)
    Originally Posted by heeheehee View Post
    Yeah, i double-checked my last post before posting here.

    Looking at item #9731...
    Unknown item found: Fabiotion (9731, 566108269)
    --------------------
    9731 Fabiotion 566108269 wbpotion.gif usable t,d 5
    Item Fabiotion Effect: "Faboooo", Effect Duration: 20
    --------------------
    Originally Posted by theo1001 View Post
    I am assuming that "Looking at item #9731..." was the same line and everyone was just omitting the item id but i guess that technically it could be different lines.

    (Aside, you also shouldn't copy from the gCLI, since it turns tabs into spaces)
    Originally Posted by heeheehee View Post
    I wasn't aware that it did that or that it was a problem.

    I'll copy them from the session log in the future.

  7. #17
    Developer
    Join Date
    Aug 2009
    Posts
    2,821

    Default

    It is a 3.1MB file (due to the verbose debug log), and it seems to freeze while awaiting the server reply.

    I'll run another debug log when I execute VeracityMeatFarm.ash to see if I'm able to capture the instance of the script crashing.
    Originally Posted by WARriorer View Post
    Thanks for the debug log.

    Looks like the hang isn't tied to a mall search per se, since there are multiple successful mall searches before that. Now that I've taken a closer look at the OP: I'm somewhat more inclined to think it's your system somehow (especially since it's not happening in a consistent place).

    - If you bring up task manager (ctrl-alt-del) during one of these hangs and look for the task (probably KoLmafia, but possibly Java / JRE), does it look like anything's saturated (CPU, Memory, Disk, etc)? My first guess is that somehow Java is running out of memory (and trying to do a stop-the-world GC while swapping, e.g.).

    - Has Mafia ever recovered from one of these hangs (if you just leave it open for a few hours)? (would lend more credence to Mafia swapping while performing very slow operations)

    - Is the UI still responsive (i.e. can you still interact with Mafia), or is that frozen too (probably would see Windows's "(Not Responding)" indicator)? (i.e.is the entire JVM having issues, or is it just a processing thread that's getting deadlocked somewhere?)


    I wasn't aware that it did that or that it was a problem.

    I'll copy them from the session log in the future.
    Originally Posted by theo1001 View Post
    Yeah. The gCLI is actually a HTML renderer, so it renders tabs as spaces. The value of copy-pasting those overrides is that it makes it easy for developers to add them directly to mafia datafiles.

  8. #18
    Junior Member
    Join Date
    Nov 2017
    Location
    Singapore
    Posts
    9

    Default

    - If you bring up task manager (ctrl-alt-del) during one of these hangs and look for the task (probably KoLmafia, but possibly Java / JRE), does it look like anything's saturated (CPU, Memory, Disk, etc)? My first guess is that somehow Java is running out of memory (and trying to do a stop-the-world GC while swapping, e.g.).
    Nothing appears to be saturated in the task manager (CPU <10%, Memory < 50%, Disk ~0%, Network ~0%, GPU ~0%). I too initially wondered if it was an issue with my system (desktop), hence I tried running Mafia on my laptop (which worked fine before I encountered this issue), but the same lag/freezing also surfaced there.

    - Has Mafia ever recovered from one of these hangs (if you just leave it open for a few hours)? (would lend more credence to Mafia swapping while performing very slow operations)
    Some of the freezes appear to be temporary, lasting anywhere between 5-30mins. Other freezes on log in appear to last well over a few hours with no signs of recovery.

    - Is the UI still responsive (i.e. can you still interact with Mafia), or is that frozen too (probably would see Windows's "(Not Responding)" indicator)? (i.e.is the entire JVM having issues, or is it just a processing thread that's getting deadlocked somewhere?)
    The UI is responsive. While logged in, it is possible to type in the gCLI, which allows for the queuing of additional scripts (although none of the scripts actually run). It is also possible to open the relay browser to carry out actions (which are reflected and recorded on the gCLI) while the scripts freeze.
    (I would note that the relay browser is significantly laggier than Vanilla KOL, which may hint at a possible reason why Mafia appears to freeze while awaiting for the server reply)

    I do have another debug log which captured the freezing during logging in, although I don't think it would shed any further light on this issue (similar to the previous debug log, it appears to hang while awaiting the server reply): https://paste.ee/p/okRy2

  9. #19
    Junior Member
    Join Date
    Sep 2016
    Location
    Central Illinois, USA
    Posts
    3

    Default

    First off - Thank you for responding and assisting with this.

    I had my KOLMafia freeze and I closed it. I went into the task manager and it still showed that it was open, so it might have had the problem where I had more than one (or two) instance(s) of mafia going at the same time which isn't good per a previous post.
    I killed the java, and restarted my computer.

    At this point, my mafia is running better than it had when I posted this. I can run scripts and actually just burn turns now in any given location.

    Thank you for your help and if it starts happening again, I will come back to get assistance.

    ( I am glad that worked for me, as reading the other posts totally threw me for a loop. I tried to put the --> jps -1 <-- in the CLI and it gave me an error, so you were probably talking about a different place to put it. I tried to drag and drop my logs into a reply here, but I found that didn't work. If I have more problems, I will come back and hopefully everyone would be as helpful and patient with me as you have been with WARriorer. I really enjoy the KOL community and appreciate the helpfulness there and also here on this forum. Kudos!!)

    Edit: also, I was not able to reply earlier as RL came up and bit me in the buttocks.
    Last edited by deadleeplatapus; 02-14-2018 at 04:51 PM. Reason: reason for delay in response

  10. #20
    Developer fronobulax's Avatar
    Join Date
    Feb 2009
    Location
    Central Virginia, USA
    Posts
    4,198

    Default

    Whoops. When I said 'command line' above in connection with jps and jstack I meant the operating system command line ("Command Prompt") and not the KoLmafia gCLI.

    This is sounding like a threading issue but I'm not sure what I can bring to bear on the problem yet.
    You just vehemently agreed with me
    Originally Posted by Veracity View Post
    I agree with frono.
    Originally Posted by Veracity View Post

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •