Skip to content

Commit

Permalink
Docs/coredump info (#57)
Browse files Browse the repository at this point in the history
* Core dump info documentation

* Add image of coredump

* Add image to show FileZilla process

---------

Co-authored-by: Justin Babilino <[email protected]>
  • Loading branch information
JoshuaAN and jlbabilino committed Mar 31, 2023
1 parent 4afe722 commit 9785b27
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 0 deletions.
Binary file added CoreDumpImage.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
52 changes: 52 additions & 0 deletions CoreDumping.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Coredumps for WPILibC projects

Using an Ubuntu PC connected to the robot's network, you can analyze coredumps that happen when the robot code crashes.

## Enabling coredumps

FTP to the robot using [WPILib's tutorial on FileZilla](https://docs.wpilib.org/en/stable/docs/software/roborio-info/roborio-ftp.html),
but replace `lvuser` with `admin` so we can overwrite system files.

We have to edit `/usr/local/natinst/etc/init.d/lvrt-wrapper` on the RIO, but commands like `vim` and `nano` don't work on ssh since the
OS is pretty barebones. So, we'll use FTP instead.

Download `/usr/local/natinst/etc/init.d/lvrt-wrapper` to your PC.

Open your local copy in a text editor. The `ulimit` line needs to be changed to allow full coredumps to be saved:

```
# stack size
ulimit -s 256
# core file size
# uncomment to enable core dumps
#ulimit -c unlimited
```

```
# stack size
#ulimit -s 256
# core file size
# uncomment to enable core dumps
ulimit -c unlimited
```

Upload your copy back to the robot and overwrite the original.

Open the driverstation and reboot the RIO:

![Driverstation UI](https://mililanirobotics.gitbooks.io/frc-electrical-bible/content/Driver_Station/diagnostics.png)

## Retrieving the coredump

Now, any time your code crashes, the file `/var/local/natinst/log/core_dump.!home!lvuser!frcUserProgram` will be created.
Don't let the RIO lose power after it happens or you may lose the coredump.

![Core Dump Retrieval](https://github.com/TripleHelixProgramming/ChargedUp/blob/docs/coredump-info/CoreDumpImage.png?raw=true)

Use FileZilla to copy that file from the RIO. It may take a minute or two to download.

## Analyzing the coredump

--Coming soon--

0 comments on commit 9785b27

Please sign in to comment.