m2-farzan / ros2-galactic-PKGBUILD

AUR Package for ROS 2 Galactic
11 stars 11 forks source link

error: ‘__malloc_hook’ was not declared in this scope #27

Closed yummy527 closed 2 years ago

yummy527 commented 2 years ago

Help me with a new error. Sorry to bother you. I googled, but found nothing helpful. And not familiar with c++.

--- stderr: tlsf_cpp                                                                                           
/home/wangxl/ros2_ws/src/ros2/realtime_support/tlsf_cpp/test/test_tlsf.cpp: In function ‘void* testing_malloc(size_t, const void*)’:
/home/wangxl/ros2_ws/src/ros2/realtime_support/tlsf_cpp/test/test_tlsf.cpp:72:3: error: ‘__malloc_hook’ was not declared in this scope; did you mean ‘prev_malloc_hook’?
   72 |   __malloc_hook = prev_malloc_hook;
      |   ^~~~~~~~~~~~~
      |   prev_malloc_hook
/home/wangxl/ros2_ws/src/ros2/realtime_support/tlsf_cpp/test/test_tlsf.cpp: In function ‘void init_malloc_hook()’:
/home/wangxl/ros2_ws/src/ros2/realtime_support/tlsf_cpp/test/test_tlsf.cpp:89:22: error: ‘__malloc_hook’ was not declared in this scope; did you mean ‘prev_malloc_hook’?
   89 |   prev_malloc_hook = __malloc_hook;
      |                      ^~~~~~~~~~~~~
      |                      prev_malloc_hook
/home/wangxl/ros2_ws/src/ros2/realtime_support/tlsf_cpp/test/test_tlsf.cpp: In function ‘void* operator new(std::size_t)’:
/home/wangxl/ros2_ws/src/ros2/realtime_support/tlsf_cpp/test/test_tlsf.cpp:216:3: error: ‘__malloc_hook’ was not declared in this scope; did you mean ‘prev_malloc_hook’?
  216 |   __malloc_hook = prev_malloc_hook;
      |   ^~~~~~~~~~~~~
      |   prev_malloc_hook
/home/wangxl/ros2_ws/src/ros2/realtime_support/tlsf_cpp/test/test_tlsf.cpp: In function ‘void operator delete(void*)’:
/home/wangxl/ros2_ws/src/ros2/realtime_support/tlsf_cpp/test/test_tlsf.cpp:233:3: error: ‘__malloc_hook’ was not declared in this scope; did you mean ‘prev_malloc_hook’?
  233 |   __malloc_hook = prev_malloc_hook;
      |   ^~~~~~~~~~~~~
      |   prev_malloc_hook
/home/wangxl/ros2_ws/src/ros2/realtime_support/tlsf_cpp/test/test_tlsf.cpp: At global scope:
/home/wangxl/ros2_ws/src/ros2/realtime_support/tlsf_cpp/test/test_tlsf.cpp:67:15: warning: ‘void* testing_malloc(size_t, const void*)’ defined but not used [-Wunused-function]
   67 | static void * testing_malloc(size_t size, const void * caller)
      |               ^~~~~~~~~~~~~~
make[2]: *** [CMakeFiles/test_tlsf__rmw_fastrtps_dynamic_cpp.dir/build.make:76: CMakeFiles/test_tlsf__rmw_fastrtps_dynamic_cpp.dir/test/test_tlsf.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:242: CMakeFiles/test_tlsf__rmw_fastrtps_dynamic_cpp.dir/all] Error 2
make: *** [Makefile:146: all] Error 2
---
Failed   <<< tlsf_cpp [18.0s, exited with code 2]
m2-farzan commented 2 years ago

Thanks for reporting the issue. It is caused by the new version of glibc. I'll fix the package in a few minutes.

m2-farzan commented 2 years ago

Oops. The issue has already been fixed.

https://github.com/m2-farzan/ros2-galactic-PKGBUILD/blob/b33f75c569c99a8a475eb892271abc30ab35802e/PKGBUILD#L77

It was first reported in https://github.com/m2-farzan/ros2-galactic-PKGBUILD/issues/19

I'm not sure why you're getting it though. Maybe the patching step has failed.

Try navigating to /home/wangxl/ros2_ws/src/ros2/realtime_support/ and running git log. You should see Remove the use of malloc hooks from the tlsf_cpp tests in HEAD. If not, it means that the patching was unsuccessful. Try makepkg --nobuild in a new directrory, and investigate terminal outputs, git logs, etc. Something is failing in the prepare step of the pkgbuild. Maybe a simple clean-build will fix it.

yummy527 commented 2 years ago

Oops. The issue has already been fixed.

https://github.com/m2-farzan/ros2-galactic-PKGBUILD/blob/b33f75c569c99a8a475eb892271abc30ab35802e/PKGBUILD#L77

It was first reported in #19

I'm not sure why you're getting it though. Maybe the patching step has failed.

Try navigating to /home/wangxl/ros2_ws/src/ros2/realtime_support/ and running git log. You should see Remove the use of malloc hooks from the tlsf_cpp tests in HEAD. If not, it means that the patching was unsuccessful. Try makepkg --nobuild in a new directrory, and investigate terminal outputs, git logs, etc. Something is failing in the prepare step of the pkgbuild. Maybe a simple clean-build will fix it.

Succeed with a clean build, finally! And I notice that issue was triggered by repos of others(may be from here ), not your ros2-galactic-PKGBUILD. A little "dizzy" after trying these several versions and solving the bugs. Forgive me. Thanks for all your kind work and help.

m2-farzan commented 2 years ago

Cheers!