Problem after trying to update Java

Ethelred

Member
I run MacOS Mojave V10.14 on a MacMini. Recently I got an upgrade nag about my Java version, which is java version "1.8.0_201". It said a new version was available. So yesterday, I bit the bullet and tried to update. After I did so, when I double-clicked my mafia .jar file, as I have always done, it brought up a login window, just like always. When I selected my user name and clicked the login button, nothing happened. It just sat there. So I figured there was a problem with the new Java runtime I had just installed and found my old version (the java version "1.8.0_201" mentioned above) and tried again. The same thing happened. Recalling the recent posts in the KoLforums about mafia problems, I tried running "java -jar KoLmafia-20282M.jar" in a terminal window. It brought up a similar, if not the same, login window, but when I selected a user and clicked the login button, it worked. Anybody have any idea about what is going on? I can login and run successfully when I use the terminal and a command, but not when double-clicking the the jar file (although that does bring up a login window, it just doesn't work).

Thanks for any help or insight. I'm baffled.
 

Veracity

Developer
Staff member
You get the log in window, but when you try to log in, it does nothing? It makes no requests of KoL?
Can you turn on debug logging (Help menu -> Start Debug Log) and try it again, please.
Perhaps something useful will be logged.
 

Ethelred

Member
You get the log in window, but when you try to log in, it does nothing? It makes no requests of KoL?
Can you turn on debug logging (Help menu -> Start Debug Log) and try it again, please.
Perhaps something useful will be logged.

Here's the debug log. Doesn't look like there's anything there. Steps to produce.
1. Double click mafia .jar file
2. Help menu -> Start Debug Log
3. Click login button
4. Wait for something to happen
5. Nothing does
6. Help menu -> Stop Debug Log
7. Quit kolmafia
 

Attachments

  • DEBUG_20200805.txt
    680 bytes · Views: 26

Veracity

Developer
Staff member
Update:

I am paying attention to you.

I had JRE 1.8.172 (or something).
Java never offered to update. Kept telling me it could not connect to the update server.
I just manually updated my JRE to 1.8.262 (or something).
Guess what? It now tells me “You have the latest version”.
Which doesn’t surprise me; not being able to connect to the update server was a Java bug.

The good news is that I can double click on a .jar file and it starts up with 1.8.262!
Shows me the Login frame! Just like you!
The bad news is that I can log in, just like when I run the jar file from the command line.
Which is to say, I cannot reproduce your problem.
Pondering.
 

Ethelred

Member
Thanks for your effort. The problem is increasing bizarre. Things run fine on another Mac Mini with an older version of Mac OS X, 10.11.6 (not that I think this is relevant to the problem). When launching either way on the Mojave system (i.e. double clicking .jar file or via terminal command line), I can open a mini-browser window (which says not logged in, of course) and bring up the About Mafia window, which both point to the same JRE, Java v1.8.0_201-b09.

Can you think of any variables/options that could be set on my system to cause this? Also, I have tried rebooting my system, to clear out any accumulated grunge that could be involved.
 

Ethelred

Member
Bump. This is really getting tedious and I'd like to find a fix, but I don't have any clue what to look for. Can anyone point me to a java test program that might help me pinpoint the problem? My google fu proved insufficient as the first 100 hits for "java test program" didn't return anything that looked promising. Ideally, the test program would put up a window like the mafia login window, accept some text input in a field (like the user id), and have a button to click (like the login button). Thanks for any help, ideas, or pointers to get the the bottom of this weird problem.
 

fronobulax

Developer
Staff member
In theory, if your environment doesn't support running "arbitrary" jar files then it is probably the environment.

Some time in the past decade there was a situation where mafia would start, log in credentials would be presented and mafia would appear to be hung or stuck. This was not repeatable but occasionally someone would get evidence of blocked threads or race conditions or something else suggesting an error in how mafia was handling threads. Various changes were made and the frequency of reports declined and people who understood what the problem might be agreed that the changes would at least partially address the issue. So this could be a repeatable occurrence of that problem, in which case remembering the tools used to gather data and teaching you how to use them might be a worthwhile effort.
 

Ethelred

Member
https://sourceforge.net/projects/robocode/

Is a game but the setup is a jar file as is the game. If you are frustrated enough the ability to install and run, or not, might help you.

or

https://sourceforge.net/projects/ipscan/

Ok, I downloaded and installed both of those without problem. Ran the robocode .jar file and it installed all the robocode stuff. Ran the Angry IP Scanner and it brought up a couple of info windows, but I just quit because I didn't really know what to do. So it looks like both worked, but my mafia .jar files still won't log in my char(s). What's the next step?
 

fronobulax

Developer
Staff member
The tools I recall required installing a JDK to get access to them. Obviously if the issue is your environment, installing a new one is not going to help find the problem.

I'll let you find one. Note that the JDK is versioned so you might be able, with a little effort, to find one for your current version of Java rather than just using the latest.

You need to run these from a command line and it is easiest if there is only one instance of mafia running at the time. The most useful time to run would be when you think things are stalled. You could run the stack command (see below) more than once since if the results are similar within a couple of minutes that is confirmation that things are stalled. Obviously capture the output and share here. If you're lucky I might see something that points to a problem.

The commands are jps and jstack. jps gets the process ids of any java related processes. There should be two. One should be jps itself and one should be KoLmafia. Run jstack using the process id for the mafia.

Code:
C:\Users\CafeBabe>jps
12208 KoLmafia-20379.jar
14156 Jps

C:\Users\CafeBabe>jstack 12208
2020-09-19 07:59:29
Full thread dump Java HotSpot(TM) 64-Bit Server VM (13.0.2+8 mixed mode, sharing):

Threads class SMR info:
_java_thread_list=0x0000022690864e20, length=19, elements={
0x00000226fd976800, 0x00000226fd97a800, 0x00000226fd99a000, 0x00000226fd99c800,
0x00000226fd99e000, 0x00000226fe228800, 0x00000226fe232800, 0x00000226fe368000,
0x00000226fe373800, 0x00000226fe8d5000, 0x00000226fe84e000, 0x00000226feb58800,
0x00000226fe981800, 0x00000226917a0800, 0x0000022691b6a800, 0x00000226e6d5e000,
0x000002269122d000, 0x0000022694440000, 0x0000022694443800
}

"Reference Handler" #2 daemon prio=10 os_prio=2 cpu=0.00ms elapsed=172.14s tid=0x00000226fd976800 nid=0x3bd0 waiting on condition  [0x000000bd58fff000]
   java.lang.Thread.State: RUNNABLE

If you get something about the command jps not being found then the JDK isn't installed. On Windows that usually means something failed to add the JDK binaries to the PATH.

Good luck.
 

Ethelred

Member
The tools I recall required installing a JDK to get access to them. Obviously if the issue is your environment, installing a new one is not going to help find the problem.

[... deleted ]

The commands are jps and jstack. jps gets the process ids of any java related processes. There should be two. One should be jps itself and one should be KoLmafia. Run jstack using the process id for the mafia.

[ ... deleted ]View attachment StackDump1.txtView attachment StackDump2.txt

Good luck.


I've attached two files: StackDump1.txt and StackDump2.txt. StackDump1.txt was made a minute or two after double clicking the mafia .jar file. StackDump2.txt was made a minute or so after clicking the login button. Nothing happened after that, as far as I could see.

Thanks again for all your help.

Edit: Sorry, I don't seem to be smart enough to figure out how to control where the attached file links appear. Will try to move them, if I can figure it out.
 
Last edited:

fronobulax

Developer
Staff member
Help?

I used to remember all of this.

Both StackDump1 and StackDump2 have AWT-EventQueue-0 in a WAITING state. On my system working normally I could not "catch" that thread in a WAITING state - it was always RUNNABLE. I'd like to hypothesize that something is stopping it from running but I also am not sure what things look like when KoLmafia is idle and waiting for user input.

StackDump2 has pool-1-thread-2 in a TIMED_WAITING state. I infer that KoLmafia started that thread, probably in response to the Login button being pressed (perhaps a minute earlier?).

So I didn't get lucky and figure out some kind of deadlock state that tells me what to look for and where.

I have a couple of things I want to try on my system but if anyone remembers and/or understands this better than I do, I'd love the help.

Thanks.
 

Ethelred

Member
Help?

I used to remember all of this.

[ ... deleted ]

I have a couple of things I want to try on my system but if anyone remembers and/or understands this better than I do, I'd love the help.

Thanks.

Are you waiting for something else from me? Or was that a general appeal to the community? Let me know if I can do anything. I'd sure like to get to the bottom of this. Thanks again for your help.
 

fronobulax

Developer
Staff member
Appeal to the community and then I got distracted by the restore sort issues, I try to give it some more cycles but I am short on ideas...
 
Top