Core Dump Manager - RethinkRobotics/sdk-docs GitHub Wiki

Summary

Use the Core Manager services to remove old core dump files from your robot's harddrive.

Overview

When a program crashes, it may create a core dump file to record the state of the machine at the time of the crash. This should not happen very often, as it is usually a sign of an unexpected behavior or error in the system. In the event a core dump does occur on Baxter, these files are stored in the /sys-log/cores/ directory in Baxter's FTP Logs Server.

During normal operation, there should be no need to worry about these files. However, if a user does get core dumps and wishes to delete the sometimes large files, the RSDK provides two tools for doing so in the form of ROS Services. The first service returns a list of core dump file names if any exist currently on the robot. The second service takes one of these file names as an argument and removes (deletes) the core dump file off the robot.

Quickstart

List existing core dumps:

$ rosservice call /core_mgr/ls 
cores: ['core-filename-111', 'core-filename-222']

Delete specified core dump:

$ rosservice call /core_mgr/rm 'core-filename-111'
err: 0
err_str: ''

Usage

Remove core dump files with the Core Manager in two steps:

  1. Get the File Name
  • Use the List Cores ROS Service to check for any core files on the robot and get a list of file names.
  1. Call the Delete Service
  • Once you have the name of a core file you don't want any more, you can use the second Core Manager service, Remove Cores, to delete the file off the robot.

You can call the two ROS Services from the command-line using the standard rosservice tool, e.g: $ rosservice call <service_name> [arguments]. The service Type will show you the arguments (if any) and the format of the return values.

Tip: You can also easily identify core dumps using the Baxter FTP Server, looking under the /sys-log/cores directory.

List Cores Service

Call this service to return a list of core dump files currently on Baxter. There are no arguments and the file names are returned as an array of strings.

  • ROS Service Name: /core_mgr/ls

  • ROS Service Type: [baxter_maintenance_msgs/LSCores][baxter_maintenance_msgs-LSCores]

    $ rosservice call /core_mgr/ls 

    Returns:

    cores: ['<core-file-name-1>', '<core-file-name-2>', ... '<core-file-name-3>']

The List Cores service will return an empty array if there are no core dumps currently on the robot.

Remove Cores Service

Call this service with the name of the core dump file you wish to remove and it will delete the file off Baxter's harddrive. From the command line, the file name string can be given as an argument with or without quotes.

  • ROS Service Name: /core_mgr/rm

  • ROS Service Type: [baxter_maintenance_msgs/RMCores][baxter_maintenance_msgs-RMCores]

    $ rosservice call /core_mgr/rm <core-file-name>

    Returns:

    # No error
    err: 0
    err_str: ''
    
    # Error
    err: <error_number>
    err_str: '<error_string>'

Upon a successful delete, the Remove Cores service will return with 0 in the err field. If err is a non-zero value, an error occurred while attempting to remove the file and further information for the error code can be found in the err_str field.

Examples

List and remove a single core dump:

$ rosservice call /core_mgr/ls 
cores: ['core-cameras_publisher-5699-1366048394', 'core-cameras_publisher-445-1366045831']
$ rosservice call /core_mgr/rm core-cameras_publisher-5699-1366048394
err: 0
err_str: ''
$ rosservice call /core_mgr/ls
cores: ['core-cameras_publisher-445-1366045831']

Attempt to remove a non-existant core dump and fail:

$ rosservice call /core_mgr/ls
cores: ['core-cameras_publisher-445-1366045831']
$ rosservice call /core_mgr/rm core-cameras_publisher-5699-1366048394
err: 2
err_str: [Errno 2] No such file or directory: '/var/log/cores/core-cameras_publisher-5699-1366048394'

Documentation

View Core Files on FTP Server

By looking on Baxter's FTP server, you can navigate to the 'sys-logs' >> 'cores' directory to see any current core dumps. This view will additionally show you the size and (robot) time when the files were created. Normally the directory will be empty; this is a good thing.

Troubleshooting

For common issues related to core dumps or files on Baxter, check out the Troubleshooting page.

  [baxter_maintenance_msgs-LSCores]: http://github.com/RethinkRobotics/baxter_common/blob/release-0.7.0/baxter_maintenance_msgs/srv/LSCores.srv [baxter_maintenance_msgs-RMCores]: http://github.com/RethinkRobotics/baxter_common/blob/release-0.7.0/baxter_maintenance_msgs/srv/RMCores.srv

⚠️ **GitHub.com Fallback** ⚠️