Skip to content
This repository was archived by the owner on May 31, 2025. It is now read-only.
This repository was archived by the owner on May 31, 2025. It is now read-only.

rosbag: Recorder throws a segmentation fault if options.prefix is not set #969

@diogoalmeida

Description

@diogoalmeida

If I construct a rosbag::Recorder object with a rosbag::RecorderOptions where the member 'prefix' is not set, the recorder::run() method will segfault.

For instance, this code will segfault if the line options.prefix = "test"; is commented out:

#include <ros/ros.h>
#include <rosbag/recorder.h>

int main(int argc, char **argv)
{
  ros::init(argc, argv, "data_logger_test_node");
  ros::NodeHandle n;

  rosbag::RecorderOptions options;
  options.append_date = false;
  options.trigger = false;
  options.min_space = 0;
  options.verbose = true;
  options.prefix = "test";
  options.split = false;
  options.regex = false;
  options.topics.push_back("/rosout");
  options.max_duration = ros::Duration(1.0);

  rosbag::Recorder recorder(options);
  recorder.run();
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions