Skip to content
This repository has been archived by the owner on Feb 12, 2022. It is now read-only.

Issue Building Cloudwatch_Logger #99

Open
CycleMark opened this issue Nov 4, 2021 · 2 comments
Open

Issue Building Cloudwatch_Logger #99

CycleMark opened this issue Nov 4, 2021 · 2 comments

Comments

@CycleMark
Copy link

Hi,

Just upgrading and rebuilding by Robots OSs. Bumped into an issue re: log output below building the CloudwatchLogger. Not yet found a solution. Do you have any ideas?

This is ROS 1 on Ubuntu 20.04 ROS version Noetic

Many Thanks

Mark

`==> Processing catkin package: 'cloudwatch_logger'
==> Building with env: '/home/mark/ros_ws/install_isolated/env.sh'
Makefile exists, skipping explicit cmake invocation...
==> make cmake_check_build_system in '/home/mark/ros_ws/build_isolated/cloudwatch_logger'
==> make -j1 in '/home/mark/ros_ws/build_isolated/cloudwatch_logger'
[ 60%] Built target cloudwatch_logger_lib
[ 80%] Building CXX object CMakeFiles/cloudwatch_logger.dir/src/main.cpp.o
In file included from /usr/include/x86_64-linux-gnu/c++/9/bits/c++allocator.h:33,
from /usr/include/c++/9/bits/allocator.h:46,
from /usr/include/c++/9/memory:63,
from /home/mark/ros_ws/install_isolated/include/aws/core/utils/memory/AWSMemory.h:12,
from /home/mark/ros_ws/install_isolated/include/aws/core/utils/memory/stl/AWSAllocator.h:11,
from /home/mark/ros_ws/install_isolated/include/aws/core/utils/memory/stl/AWSString.h:10,
from /home/mark/ros_ws/install_isolated/include/aws/core/utils/logging/LogLevel.h:10,
from /home/mark/ros_ws/install_isolated/include/aws/core/Aws.h:7,
from /home/mark/ros_ws/src/cloudwatchlogs-ros1/cloudwatch_logger/src/main.cpp:16:
/usr/include/c++/9/ext/new_allocator.h: In instantiation of ‘void __gnu_cxx::new_allocator<_Tp>::construct(_Up*, _Args&& ...) [with _Up = Aws::Utils::Logging::AWSROSLogger; _Args = {}; _Tp = Aws::Utils::Logging::AWSROSLogger]’:
/usr/include/c++/9/bits/alloc_traits.h:226:6: required by substitution of ‘template<class _Alloc2, class> static std::true_type std::allocator_traits<Aws::AllocatorAws::Utils::Logging::AWSROSLogger >::__construct_helperAws::Utils::Logging::AWSROSLogger::__test<_Alloc2, >(int) [with _Alloc2 = Aws::AllocatorAws::Utils::Logging::AWSROSLogger; = ]’
/usr/include/c++/9/bits/alloc_traits.h:233:40: required from ‘struct std::allocator_traits<Aws::AllocatorAws::Utils::Logging::AWSROSLogger >::__construct_helperAws::Utils::Logging::AWSROSLogger’
/usr/include/c++/9/bits/alloc_traits.h:250:2: required by substitution of ‘template<class _Tp, class ... _Args> static std::_Require<std::_and<std::_not<typename std::allocator_traits<Aws::AllocatorAws::Utils::Logging::AWSROSLogger >::__construct_helper<_Tp, _Args>::type>, std::is_constructible<_Tp, _Args ...> > > std::allocator_traits<Aws::AllocatorAws::Utils::Logging::AWSROSLogger >::_S_construct<_Tp, _Args ...>(Aws::AllocatorAws::Utils::Logging::AWSROSLogger&, _Tp*, _Args&& ...) [with _Tp = Aws::Utils::Logging::AWSROSLogger; _Args = {}]’
/usr/include/c++/9/bits/alloc_traits.h:350:26: required by substitution of ‘template<class _Tp, class ... _Args> static decltype (std::allocator_traits<Aws::AllocatorAws::Utils::Logging::AWSROSLogger >::_S_construct(__a, __p, (forward<_Args>)(std::allocator_traits::construct::__args)...)) std::allocator_traits<Aws::AllocatorAws::Utils::Logging::AWSROSLogger >::construct<_Tp, _Args ...>(Aws::AllocatorAws::Utils::Logging::AWSROSLogger&, _Tp*, _Args&& ...) [with _Tp = Aws::Utils::Logging::AWSROSLogger; _Args = {}]’
/usr/include/c++/9/bits/shared_ptr_base.h:548:39: required from ‘std::_Sp_counted_ptr_inplace<_Tp, _Alloc, _Lp>::_Sp_counted_ptr_inplace(_Alloc, _Args&& ...) [with _Args = {}; _Tp = Aws::Utils::Logging::AWSROSLogger; _Alloc = Aws::AllocatorAws::Utils::Logging::AWSROSLogger; __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]’
/usr/include/c++/9/bits/shared_ptr_base.h:679:16: required from ‘std::__shared_count<_Lp>::__shared_count(_Tp*&, std::_Sp_alloc_shared_tag<_Alloc>, _Args&& ...) [with _Tp = Aws::Utils::Logging::AWSROSLogger; _Alloc = Aws::AllocatorAws::Utils::Logging::AWSROSLogger; _Args = {}; __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]’
/usr/include/c++/9/bits/shared_ptr_base.h:1344:71: required from ‘std::__shared_ptr<_Tp, _Lp>::__shared_ptr(std::_Sp_alloc_shared_tag<_Tp>, _Args&& ...) [with _Alloc = Aws::AllocatorAws::Utils::Logging::AWSROSLogger; _Args = {}; _Tp = Aws::Utils::Logging::AWSROSLogger; __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]’
/usr/include/c++/9/bits/shared_ptr.h:359:59: required from ‘std::shared_ptr<_Tp>::shared_ptr(std::_Sp_alloc_shared_tag<_Tp>, _Args&& ...) [with _Alloc = Aws::AllocatorAws::Utils::Logging::AWSROSLogger; _Args = {}; _Tp = Aws::Utils::Logging::AWSROSLogger]’
/usr/include/c++/9/bits/shared_ptr.h:701:14: required from ‘std::shared_ptr<_Tp> std::allocate_shared(const _Alloc&, _Args&& ...) [with _Tp = Aws::Utils::Logging::AWSROSLogger; _Alloc = Aws::AllocatorAws::Utils::Logging::AWSROSLogger; _Args = {}]’
/home/mark/ros_ws/install_isolated/include/aws/core/utils/memory/stl/AWSAllocator.h:96:58: required from ‘std::shared_ptr<_Tp> Aws::MakeShared(const char*, ArgTypes&& ...) [with T = Aws::Utils::Logging::AWSROSLogger; ArgTypes = {}]’
/home/mark/ros_ws/src/cloudwatchlogs-ros1/cloudwatch_logger/src/main.cpp:36:65: required from here
/usr/include/c++/9/ext/new_allocator.h:145:20: error: invalid new-expression of abstract class type ‘Aws::Utils::Logging::AWSROSLogger’
145 | noexcept(noexcept(::new((void *)__p)
| ^~~~~~~~~~~~~~~~~~
146 | _Up(std::forward<_Args>(__args)...)))
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/mark/ros_ws/src/cloudwatchlogs-ros1/cloudwatch_logger/include/cloudwatch_logger/log_node.h:19,
from /home/mark/ros_ws/src/cloudwatchlogs-ros1/cloudwatch_logger/src/main.cpp:19:
/home/mark/ros_ws/install_isolated/include/aws_ros1_common/sdk_utils/logging/aws_ros_logger.h:27:7: note: because the following virtual functions are pure within ‘Aws::Utils::Logging::AWSROSLogger’:
27 | class AWSROSLogger : public AWSLogSystem
| ^~~~~~~~~~~~
In file included from /home/mark/ros_ws/install_isolated/include/aws/core/Aws.h:8,
from /home/mark/ros_ws/src/cloudwatchlogs-ros1/cloudwatch_logger/src/main.cpp:16:
/home/mark/ros_ws/install_isolated/include/aws/core/utils/logging/LogSystemInterface.h:46:30: note: ‘virtual void Aws::Utils::Logging::LogSystemInterface::Flush()’
46 | virtual void Flush() = 0;
| ^~~~~
make[2]: *** [CMakeFiles/cloudwatch_logger.dir/build.make:63: CMakeFiles/cloudwatch_logger.dir/src/main.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:1155: CMakeFiles/cloudwatch_logger.dir/all] Error 2
make: *** [Makefile:141: all] Error 2
<== Failed to process package 'cloudwatch_logger':
Command '['/home/mark/ros_ws/install_isolated/env.sh', 'make', '-j1']' returned non-zero exit status 2.

Reproduce this error by running:
==> cd /home/mark/ros_ws/build_isolated/cloudwatch_logger && /home/mark/ros_ws/install_isolated/env.sh make -j1

Command failed, exiting.`

@d-siedlak
Copy link

I added virtual void Flush(){}; to this line in the aws_common package that seems to fix this issue:
https://github.com/aws-robotics/utils-common/blob/b70e9416968ca5a56fd263ff9c96c80793a7230f/aws_common/include/aws_common/sdk_utils/logging/aws_log_system.h#L59

It seems like the issue is that the Flush method from the abstract base class is not overridden anywhere, but I'm not sure if having an empty definition is really the desired behavior.

This post helped me figure out the issue: https://stackoverflow.com/questions/12615904/g-because-the-following-virtual-functions-are-pure-with-abstract-base-class

@CycleMark
Copy link
Author

Thanks - sorry for the late reply. Only just noticed - found that I adding it to aws_ros_logger.h did the job :)

Like you say I have no if that's going to cause problems. Needs a fix though

Thanks

Mark

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants