This is an update release of WPILib for the 2023 season. This release reduces overhead that can impact loop times in Java, and has several other quality-of-life improvements. Note: while this release only has a few changes since 2023.4.2, it includes all fixes made in earlier releases; it’s strongly recommended teams upgrade if running versions earlier than 2023.4.1.
Upgrading from earlier 2023 releases is easy: simply download and run the new installer and it will update your current installation. If you already have the 2023 WPILib vscode installed, it will detect it and you can simply click “next” for that installation step. After installation, vscode will prompt you when opening your robot project whether you want to upgrade it to this version. Note that using the installer is required to get the new version of desktop tools such as Shuffleboard.
A big Thank You to team 694 - StuyPulse - for identifying the performance problem with HAL_GetRuntimeType and to the WPILib team for providing a timely fix. It’s important for Java because HAL_GetRuntimeType may be called multiple times per robot cycle even if though we never call it explicitly in our own code.
We updated to 2023.4.2 because we were seeing some of the problems we thought it would solve, but still have a big unresolved issue: namely random crashes.
These occur every couple of minutes, with no error message. We simply see “No Robot Code” on the DS. Looking through the /tmp/hs_err_pid logs we see messages such as:
A fatal error has been detected by the Java Runtime Environment:
SIGSEGV (0xb) at pc=0x8a64ceec, pid=10396, tid=10429
Okay, to get more info we’re going to want to get what’s called a core dump, basically a full dump of the address space of the java program and everything it has loaded. Here’s the steps to do this:
Use a SSH client such as PuTTY to ssh into the Rio (roborio-TEAM-frc.local), login is lvuser (no password).
Run the following commands in the SSH terminal. What this does is stop the robot program, enable core dumps, and run the robot program interactively (just once, and so it won’t auto-restart):
Try to reproduce the crash. Assuming it crashes, the SSH terminal will return to the prompt after the crash message. Somewhere at the end of the message it should say “(core dumped)” or something similar to it. It may take 10+ seconds after the crash to return to the prompt as it takes some time to write the core dump.
Use Windows Explorer to FTP (ftp://roborio-TEAM-frc.local/) or a program like FileZilla to SFTP to the Rio. Navigate to /var/local/natinst/log/ and download the file named core_dump.something (should be core_dump.!usr!local!frc!JRE!bin!java for a Java program).
Delete the core_dump file from the Rio (as it consumes a fairly large amount of disk space).
Zip the core_dump file and upload it somewhere like Google Drive and send the link.
For analyzing it, I’ll also need a copy of your project, or since it’s Java, at least the WPILib version (in this case 2023.4.2 it sounds like) and the exact vendor deps you’re using.
What tools do you recommend for analyzing core dumps collected from the Rio? We’ve actually run into crashes similar to this (the worst of which were seemingly resolved by reimaging the RoboRIO we were using because it was totally unusable due to JVM crashes after every deploy). Other than that RIO, we have seen hard JVM crashes a couple of times. However, we haven’t been able to rule out something in our code yet (though inspection with Visual VM didn’t show any obvious memory leaks or the like).
I just use gdb, but the setup is somewhat involved, as analyzing ARM core dumps essentially requires debug info (including that for libraries) to get a backtrace. So there’s a lot of manual downloading/extracting required to get the JRE debug info, WPILib library debug info, etc. And most of the vendor libraries don’t distribute debug info AFAIK.
Does the offline update from the commend palette work? I can’t seem to get the command palette “Check for WPILib Updates” to find the offline version of the 2023.4.2 .iso file.
OK Thank you. I read that there was a problem with the command palette update tool for online use, but I thought it might work for offline. I have now run the installer from the .iso and I see that my VS code does not also need updating. I got an error if I did not do this right after a restart and before opening WPILib Code.
Thank you for your help.