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

Clang error: destructor called on non-final 'Aws::FileSystem::PosixDirectory' that has virtual functions but non-virtual destructor #825

Closed
yurivict opened this issue Mar 15, 2018 · 5 comments · Fixed by #828
Labels
feature-request A feature should be added or improved.

Comments

@yurivict
Copy link

yurivict commented Mar 15, 2018

In the FreeBSD port for the version 1.4.14, on FreeBSD 12 build fails:

/usr/bin/c++  -DAWS_SDK_VERSION_MAJOR=1 -DAWS_SDK_VERSION_MINOR=4 -DAWS_SDK_VERSION_PATCH=14 -DENABLE_CURL_CLIENT -DENABLE_OPENSSL_ENCRYPTION -DPLATFORM_LINUX -Daws_cpp_sdk_core_EXPORTS -I/usr/local/include -Iaws-cpp-sdk-core/include/aws/core/platform/refs -Iaws-cpp-sdk-core/include -Wno-error -Wno-c11-extensions -Wno-error -Wno-c11-extensions -fPIC   -fno-exceptions -std=c++11 -Wall -Werror -pedantic -Wextra -MD -MT aws-cpp-sdk-core/CMakeFiles/aws-cpp-sdk-core.dir/source/platform/linux-shared/FileSystem.cpp.o -MF aws-cpp-sdk-core/CMakeFiles/aws-cpp-sdk-core.dir/source/platform/linux-shared/FileSystem.cpp.o.d -o aws-cpp-sdk-core/CMakeFiles/aws-cpp-sdk-core.dir/source/platform/linux-shared/FileSystem.cpp.o -c aws-cpp-sdk-core/source/platform/linux-shared/FileSystem.cpp
In file included from aws-cpp-sdk-core/source/platform/linux-shared/FileSystem.cpp:15:
In file included from aws-cpp-sdk-core/include/aws/core/platform/FileSystem.h:18:
In file included from aws-cpp-sdk-core/include/aws/core/utils/memory/stl/AWSVector.h:20:
In file included from aws-cpp-sdk-core/include/aws/core/utils/memory/stl/AWSAllocator.h:21:
In file included from aws-cpp-sdk-core/include/aws/core/utils/memory/AWSMemory.h:22:
/usr/include/c++/v1/memory:3656:5: error: destructor called on non-final 'Aws::FileSystem::PosixDirectory' that has virtual functions but non-virtual destructor [-Werror,-Wdelete-non-virtual-dtor]
    __data_.second().~_Tp();
    ^
/usr/include/c++/v1/memory:3617:9: note: in instantiation of member function 'std::__1::__shared_ptr_emplace<Aws::FileSystem::PosixDirectory, Aws::Allocator<Aws::FileSystem::PosixDirectory> >::__on_zero_shared' requested here
        __shared_ptr_emplace(_Alloc __a, _Args&& ...__args)
        ^
/usr/include/c++/v1/memory:4297:9: note: in instantiation of function template specialization 'std::__1::__shared_ptr_emplace<Aws::FileSystem::PosixDirectory, Aws::Allocator<Aws::FileSystem::PosixDirectory> >::__shared_ptr_emplace<const std::__1::basic_string<char, std::__1::char_traits<char>, Aws::Allocator<char> > &, const std::__1::basic_string<char, std::__1::char_traits<char>, Aws::Allocator<char> > &>' requested here
        _CntrlBlk(__a, _VSTD::forward<_Args>(__args)...);
        ^
/usr/include/c++/v1/memory:4668:29: note: in instantiation of function template specialization 'std::__1::shared_ptr<Aws::FileSystem::PosixDirectory>::allocate_shared<Aws::Allocator<Aws::FileSystem::PosixDirectory>, const std::__1::basic_string<char, std::__1::char_traits<char>, Aws::Allocator<char> > &, const std::__1::basic_string<char, std::__1::char_traits<char>, Aws::Allocator<char> > &>' requested here
    return shared_ptr<_Tp>::allocate_shared(__a, _VSTD::forward<_Args>(__args)...);
                            ^
aws-cpp-sdk-core/include/aws/core/utils/memory/stl/AWSAllocator.h:106:21: note: in instantiation of function template specialization 'std::__1::allocate_shared<Aws::FileSystem::PosixDirectory, Aws::Allocator<Aws::FileSystem::PosixDirectory>, const std::__1::basic_string<char, std::__1::char_traits<char>, Aws::Allocator<char> > &, const std::__1::basic_string<char, std::__1::char_traits<char>, Aws::Allocator<char> > &>' requested here
        return std::allocate_shared<T, Aws::Allocator<T>>(Aws::Allocator<T>(), std::forward<ArgTypes>(args)...);
                    ^
aws-cpp-sdk-core/source/platform/linux-shared/FileSystem.cpp:273:17: note: in instantiation of function template specialization 'Aws::MakeShared<Aws::FileSystem::PosixDirectory, const std::__1::basic_string<char, std::__1::char_traits<char>, Aws::Allocator<char> > &, const std::__1::basic_string<char, std::__1::char_traits<char>, Aws::Allocator<char> > &>' requested here
    return Aws::MakeShared<PosixDirectory>(FILE_SYSTEM_UTILS_LOG_TAG, path, relativePath);
                ^
/usr/include/c++/v1/memory:3656:23: note: qualify call to silence this warning
    __data_.second().~_Tp();
                      ^
1 error generated.

Here is the full log of the same failure for the previous version: http://package18.nyi.freebsd.org/data/headamd64PR225981-default/2018-02-22_20h38m25s/logs/errors/aws-sdk-cpp-1.3.15.log

uqs pushed a commit to freebsd/freebsd-ports that referenced this issue Mar 15, 2018
Both versions 1.4.10 and 1.4.14 fail to build on 12:
aws/aws-sdk-cpp#825


git-svn-id: svn+ssh://svn.freebsd.org/ports/head@464556 35697150-7ecd-e111-bb59-0022644237b5
uqs pushed a commit to freebsd/freebsd-ports that referenced this issue Mar 15, 2018
Both versions 1.4.10 and 1.4.14 fail to build on 12:
aws/aws-sdk-cpp#825
Jehops pushed a commit to Jehops/freebsd-ports-legacy that referenced this issue Mar 15, 2018
Both versions 1.4.10 and 1.4.14 fail to build on 12:
aws/aws-sdk-cpp#825


git-svn-id: svn+ssh://svn.freebsd.org/ports/head@464556 35697150-7ecd-e111-bb59-0022644237b5
swills pushed a commit to swills/freebsd-ports that referenced this issue Mar 16, 2018
Both versions 1.4.10 and 1.4.14 fail to build on 12:
aws/aws-sdk-cpp#825


git-svn-id: svn+ssh://svn.freebsd.org/ports/head@464556 35697150-7ecd-e111-bb59-0022644237b5
@singku singku closed this as completed Mar 19, 2018
@singku singku reopened this Mar 19, 2018
@singku
Copy link
Contributor

singku commented Mar 19, 2018

Hi, I saw from above log that the command line compiler is c++. What's the actual compiler? Is it gcc or clang? What's the version used?

I have tried on Amazon EC2 with FreeBSD 11 (No version 12 available yet for EC2) and the sdk version from port is 1.4.14.
The compiler and version is:

FreeBSD clang version 4.0.0 (tags/RELEASE_400/final 297347) (based on LLVM 4.0.0)
Target: x86_64-unknown-freebsd11.1
Thread model: posix
InstalledDir: /usr/bin

AWS SDK for C++ compiled and installed without problem.

@yurivict
Copy link
Author

yurivict commented Mar 19, 2018

Compiler is clang50. It only breaks on FreeBSD-12, not sure why.

You can easily reproduce the failure by:

  1. cd /usr/ports/devel/aws-sdk-cpp
  2. Comment out the line BROKEN_FreeBSD_12=
  3. make

@singku
Copy link
Contributor

singku commented Mar 19, 2018

I updated clang to clang50 and it succeeded as well.
The way I compiled was:

cd /usr/port/devel/llvm50
make install
cd /usr/port/devel/aws-sdk-cpp
vi Makefile 
#add CC=clang50
#add CXX=clang50++
#add CPP=clang-cpp50
#at the top
make

@yurivict
Copy link
Author

No version 12 available yet for EC2

You don't need the EC2 version. It fails during the regular build.
ISO image from here https://download.freebsd.org/ftp/snapshots/ISO-IMAGES/12.0/ should reproduce it in a VirtualBox VM.

@singku
Copy link
Contributor

singku commented Mar 20, 2018

I have reproduced the problem on FreeBSD 12 (a lot of dependencies need to be installed), and there is another class DefaultSecureRandFactory we also need to fix, we will update the code ASAP.

JonathanHenson pushed a commit that referenced this issue Jul 30, 2018
…tory

This addresses the same issue as described in #825 and addressed
in PR #828.

This adds a defaulted virtual destructor to PCMOutputDriverFactory.
@justnance justnance added feature-request A feature should be added or improved. and removed enhancement labels Apr 19, 2019
aws-sdk-cpp-automation pushed a commit that referenced this issue Oct 19, 2021
* generic version of license Checker
svmhdvn pushed a commit to svmhdvn/freebsd-ports that referenced this issue Jan 10, 2024
Both versions 1.4.10 and 1.4.14 fail to build on 12:
aws/aws-sdk-cpp#825
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request A feature should be added or improved.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants