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

test/archive.cpp:627 something something shared pointer #938

Open
ewtoombs opened this issue Nov 16, 2024 · 1 comment
Open

test/archive.cpp:627 something something shared pointer #938

ewtoombs opened this issue Nov 16, 2024 · 1 comment
Assignees
Labels
Milestone

Comments

@ewtoombs
Copy link

My build failed with this error:


[50/133] Linking target src/libzim.so.9.1.0
/usr/bin/ld: warning: -z pack-relative-relocs ignored
[75/133] Compiling C++ object test/archive.p/archive.cpp.o
FAILED: test/archive.p/archive.cpp.o 
c++ -Itest/archive.p -Iinclude -I../include -Isrc -I../src -fdiagnostics-color=always -D_GLIBCXX_ASSERTIONS=1 -Wall -Winvalid-pch -Werror -std=c++17 -D_LARGEFILE64_SOURCE=1 -D_FILE_OFFSET_BITS=64 -march=armv8-a -O2 -pipe -fstack-protector-strong -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -fPIE -DGTEST_HAS_PTHREAD=1 -pthread -DWITH_TEST_DATA=1 -MD -MQ test/archive.p/archive.cpp.o -MF test/archive.p/archive.cpp.o.d -o test/archive.p/archive.cpp.o -c ../test/archive.cpp
In file included from /usr/include/c++/14.1.1/bits/shared_ptr.h:53,
                 from /usr/include/c++/14.1.1/memory:80,
                 from ../include/zim/entry.h:26,
                 from ../include/zim/archive.h:26,
                 from ../test/archive.cpp:22:
In constructor ‘std::__shared_count<_Lp>::__shared_count(_Ptr) [with _Ptr = char*; __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]’,
    inlined from ‘std::__shared_count<_Lp>::__shared_count(_Ptr, std::false_type) [with _Ptr = char*; __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]’ at /usr/include/c++/14.1.1/bits/shared_ptr_base.h:926:22,
    inlined from ‘std::__shared_ptr<_Tp, _Lp>::__shared_ptr(_Yp*) [with _Yp = char; <template-parameter-2-2> = void; _Tp = char; __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]’ at /usr/include/c++/14.1.1/bits/shared_ptr_base.h:1470:17,
    inlined from ‘std::shared_ptr<_Tp>::shared_ptr(_Yp*) [with _Yp = char; <template-parameter-2-2> = void; _Tp = char]’ at /usr/include/c++/14.1.1/bits/shared_ptr.h:213:46,
    inlined from ‘zim::Blob {anonymous}::readItemData(const zim::Item::DirectAccessInfo&, zim::size_type)’ at ../test/archive.cpp:627:44:
/usr/include/c++/14.1.1/bits/shared_ptr_base.h:919:15: error: ‘void operator delete(void*, std::size_t)’ called on pointer returned from a mismatched allocation function [-Werror=mismatched-new-delete]
  919 |               delete __p;
      |               ^~~~~~~~~~
../test/archive.cpp: In function ‘zim::Blob {anonymous}::readItemData(const zim::Item::DirectAccessInfo&, zim::size_type)’:
../test/archive.cpp:627:43: note: returned from ‘void* operator new [](std::size_t)’
  627 |   std::shared_ptr<char> data(new char[size]);
      |                                           ^
cc1plus: all warnings being treated as errors
[82/133] Compiling C++ object test/parseLongPath.p/parseLongPath.cpp.o
ninja: build stopped: subcommand failed.

Commenting out subdir('test') in meson.build is a workaround.

architecture: aarch64
gcc version: 14.1.1+r1+g43b730b9134-1
libzim version: 9.1.0

Let me know if there is anything else you need.

@ewtoombs ewtoombs changed the title archive.cpp:627 something something shared pointer test/archive.cpp:627 something something shared pointer Nov 16, 2024
@kelson42 kelson42 modified the milestones: 10.0.0, 9.3.0 Nov 16, 2024
@kelson42 kelson42 added the bug label Nov 16, 2024
@kelson42
Copy link
Contributor

@veloman-yunkan Looks like amcompatibility problem with gcc-14. We should fix and add in CI if possible

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

No branches or pull requests

3 participants