Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Segmentation fault in void __cleanup_context(rcl_context_t * context) #539

Closed
BorjaOuterelo opened this issue Nov 28, 2019 · 0 comments · Fixed by #546
Closed

Segmentation fault in void __cleanup_context(rcl_context_t * context) #539

BorjaOuterelo opened this issue Nov 28, 2019 · 0 comments · Fixed by #546
Labels
bug Something isn't working

Comments

@BorjaOuterelo
Copy link

BorjaOuterelo commented Nov 28, 2019

Bug report

Required Info:

  • Operating System:
    • Ubuntu 18.04.
  • Installation type:
    • Binaries.
  • Version or commit hash:
    • Dashing, Eloquent, Master.
  • DDS implementation:
    • Custom. N/A.
  • Client library (if applicable):
    • N/A.

Steps to reproduce issue

  rcl_ret_t rv;

  rcl_init_options_t options = rcl_get_zero_initialized_init_options();
  rv = rcl_init_options_init(&options, rcl_get_default_allocator());
  if (RCL_RET_OK != rv) {
    printf("rcl init options error: %s\n", rcl_get_error_string().str);
    return 1;
  }

  rcl_context_t context = rcl_get_zero_initialized_context();
  rv = rcl_init(argc, argv, &options, &context);

Above code in combination with a 'rmw_init` implementation which returns something that is not RMW_RET_OK,

Expected behaviour

It should fail gently setting errors accordingly.

Actual behavior

Segmentation fault in:

allocator.deallocate(context->impl->argv[i], allocator.state);

Additional information

The dump is generated due to allocator being 0.

Combination of

goto fail;

but it is setting the allocators in a different line.

context->impl->allocator = allocator;

@BorjaOuterelo BorjaOuterelo changed the title Core dump in void __cleanup_context(rcl_context_t * context) Segmentation fault in void __cleanup_context(rcl_context_t * context) Nov 28, 2019
@jacobperron jacobperron added the bug Something isn't working label Dec 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants