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

Fix freeing of loaned chunks #365

Merged
merged 7 commits into from
Feb 16, 2022
Merged

Commits on Feb 9, 2022

  1. Update iceoryx_subscriber also when constructing the serdata from the…

    … iox chunk
    
    Signed-off-by: Sumanth Nirmal <sumanth.724@gmail.com>
    sumanth-nirmal committed Feb 9, 2022
    Configuration menu
    Copy the full SHA
    64b6cc3 View commit details
    Browse the repository at this point in the history
  2. Release iox_chunk to iceoryx in serdata_free if the iox_chunk is stil…

    …l available
    
    Currently we depend on iceoryx_binding_c directlyd for the API to release the chunk, but this will be fixed when RMW is updated to the latest Cyclone DDS version
    sumanth-nirmal committed Feb 9, 2022
    Configuration menu
    Copy the full SHA
    b265942 View commit details
    Browse the repository at this point in the history
  3. Add iceoryx_binding_c as dependency to rmw_cyclonedds_cpp

    Signed-off-by: Sumanth Nirmal <sumanth.724@gmail.com>
    sumanth-nirmal committed Feb 9, 2022
    Configuration menu
    Copy the full SHA
    ea0f2a7 View commit details
    Browse the repository at this point in the history
  4. rename _cyclonedds_has_shm to follow the convention

    Signed-off-by: Sumanth Nirmal <sumanth.724@gmail.com>
    sumanth-nirmal committed Feb 9, 2022
    Configuration menu
    Copy the full SHA
    912b0c6 View commit details
    Browse the repository at this point in the history
  5. Fix memory leaks on the take side with SHM

      - Decrement the refcount when serdata is not needed in the take path.
     When the refcount drops to 0, the serdata will be freed in serdata_rmw_free
      - In rmw_take_loan scenario, reset the iox_chunk pointer to null
    before returning the loaned pointer to user, so rmw_serdata_free only frees
    the serdata with out actually releasing the iox_chunk. The iox_chunk will be
    released when rmw_return_loaned_message_from_subscription is called
    
    Signed-off-by: Sumanth Nirmal <sumanth.724@gmail.com>
    sumanth-nirmal committed Feb 9, 2022
    Configuration menu
    Copy the full SHA
    42ee152 View commit details
    Browse the repository at this point in the history
  6. Fix memory leak in error scenario on the publish side with SHM

      - In error, release loaned chunk and decrement the serdata refcount,
    so it will be eventually freed
    
    Signed-off-by: Sumanth Nirmal <sumanth.724@gmail.com>
    sumanth-nirmal committed Feb 9, 2022
    Configuration menu
    Copy the full SHA
    8332578 View commit details
    Browse the repository at this point in the history
  7. Wrap creation of new serdata_rmw within a try-catch block

    Signed-off-by: Sumanth Nirmal <sumanth.724@gmail.com>
    sumanth-nirmal committed Feb 9, 2022
    Configuration menu
    Copy the full SHA
    ec6ad7e View commit details
    Browse the repository at this point in the history