-
Notifications
You must be signed in to change notification settings - Fork 166
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
Custom logging allocator not passed to rcutils_logging_initialize_with_allocator #1036
Comments
@clalancette minor fixes, could you take a look at those?
|
Haven't had a chance to look at it in detail, but on first sight I don't think this will fix it as each log call calls RCUTILS_LOGGING_AUTOINIT and there are log calls before See also #1037 (comment) |
Ah yeah, that is true, i was focusing on rclcpp. but if application calls rcl or rcutils directly to initialize the logger, that is gonna be the problem.
thanks, i will take a look at it. |
@jrutgeer as you mentioned #1036 (comment), this is related to #1037. So i will keep that on #1037 instead, closing this issue since |
Logging is initialized by a call to
rcl_logging_configure_with_output_handler()
(e.g. fromrclcpp::init()
).This calls
RCUTILS_LOGGING_AUTOINIT
and then sets the logger allocator:rcl/rcl/src/rcl/logging.c
Lines 65 to 66 in 4eccc3c
I think this is a bug, as
RCUTILS_LOGGING_AUTOINIT
resolves torcutils_logging_initialize()
which callsrcutils_logging_initialize_with_allocator(rcutils_get_default_allocator());
, i.e. with the default allocator (malloc) instead of the provided one. So the logging hash table gets the default allocator and not the provided one (and probably all other allocations as well as, since this seems the only place whereg_rcutils_logging_allocator
is set).https://github.com/ros2/rcutils/blob/61018b2f88e55ac81edda4a45a02634493c999ed/include/rcutils/logging.h#L560-L572
https://github.com/ros2/rcutils/blob/61018b2f88e55ac81edda4a45a02634493c999ed/src/logging.c#L129-L132
The text was updated successfully, but these errors were encountered: