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

[memory_tools] Verbosity level quiet is not working properly #80

Open
knorth55 opened this issue Jun 7, 2023 · 0 comments
Open

[memory_tools] Verbosity level quiet is not working properly #80

knorth55 opened this issue Jun 7, 2023 · 0 comments

Comments

@knorth55
Copy link

knorth55 commented Jun 7, 2023

It seems verbosity level quiet is not working properly.

I add printf in dispatch_callback.cpp and check the callback_prt and service.

I don't know why but callback_ptr changed and service.ignored is rewrite to 0, which causes this issue.
I tried to solve this issue, but I could not find the cause...

before callback: callback_ptr: 0x55f00f880850
before callback: service: 0x7f97db7fd070
before callback: service.ignored: 1
before callback: callback_ptr: 0x55f00f880880
before callback: service: 0x7f97db7fd070
before callback: service.ignored: 0
after callback: service: 0x7f97db7fd070
after callback: service.ignored: 0
after callback: service: 0x7f97db7fd070
after callback: service.ignored: 0

How to check this issue

Please use this PR for printing
#81

Then, I changed as below to show the print output.

--- a/osrf_testing_tools_cpp/src/memory_tools/dispatch_callback.hpp
+++ b/osrf_testing_tools_cpp/src/memory_tools/dispatch_callback.hpp
@@ -38,9 +38,14 @@ dispatch_callback(
     return;
   }
   auto callback_ptr = std::get_if<MemoryToolsCallback>(callback);
+  printf("before callback: callback_ptr: %p\n", callback_ptr);
+  printf("before callback: service: %p\n", &service);
+  printf("before callback: service.ignored: %d\n", service.get_ignored());
   if (callback_ptr) {
     (*callback_ptr)(service);
   }
+  printf("after callback: service: %p\n", &service);
+  printf("after callback: service.ignored: %d\n", service.get_ignored());
   auto simple_callback_ptr = std::get_if<MemoryToolsSimpleCallback>(callback);
   if (simple_callback_ptr) {
     (*simple_callback_ptr)();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant