facebook / rocksdb

A library that provides an embeddable, persistent key-value store for fast storage.
http://rocksdb.org
GNU General Public License v2.0
28.52k stars 6.3k forks source link

version_set.cc __ct_base argument 1 value '18446744073709551615' exceeds maximum object size 9223372036854775807 [-Werror=alloc-size-larger-than=] #11043

Closed andreasstieger closed 1 year ago

andreasstieger commented 1 year ago

Expected behavior

7.8.3 builds. This does not seem to be new, same for 7.7.8

Actual behavior

[  105s] [ 58%] Linking CXX shared library librocksdb.so
[  105s] /usr/bin/cmake -E cmake_link_script CMakeFiles/rocksdb-shared.dir/link.txt --verbose=1
[  105s] /usr/bin/c++ -fPIC -O2 -Wall -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -flto=auto -W -Wextra -Wall -pthread -Wsign-compare -Wshadow -Wno-unused-parameter -Wno-unused-variable -Woverloaded-virtual -Wnon-virtual-dtor -Wno-missing-field-initializers -Wno-strict-aliasing -Wno-invalid-offsetof -fno-omit-frame-pointer -momit-leaf-frame-pointer -Werror -fno-builtin-memcmp -O2 -g -DNDEBUG -flto=auto -Wl,--as-needed -Wl,--no-undefined -Wl,-z,now -shared -Wl,-soname,librocksdb.so.7 -o librocksdb.so.7.8.3 [...]
[  105s] /home/abuild/rpmbuild/BUILD/rocksdb-7.8.3/db/version_set.cc: In member function '__ct_base ':
[  105s] /home/abuild/rpmbuild/BUILD/rocksdb-7.8.3/db/version_set.cc:2061:56: error: argument 1 value '18446744073709551615' exceeds maximum object size 9223372036854775807 [-Werror=alloc-size-larger-than=]
[  105s]  2061 |       files_(new std::vector<FileMetaData*>[num_levels_]),
[  105s] lto1: all warnings being treated as errors

Steps to reproduce the behavior

Toolchain versions:

[    6s] [152/161] cumulate gcc12-12.2.1+git537-1.2
[    6s] [153/161] cumulate gcc12-PIE-12.2.1+git537-1.2
[    6s] [154/161] cumulate gcc-12-2.4
[    6s] [156/161] cumulate gcc12-c++-12.2.1+git537-1.2
[    6s] [159/161] cumulate gcc-PIE-12-2.4
[    6s] [160/161] cumulate gcc-c++-12-2.4

cmake:

[   10s] + /usr/bin/cmake /home/abuild/rpmbuild/BUILD/rocksdb-7.8.3/. '-GUnix Makefiles' -DCMAKE_INSTALL_PREFIX:PATH=/usr -DINCLUDE_INSTALL_DIR:PATH=/usr/include -DLIB_INSTALL_DIR:PATH=/usr/lib64 -DSYSCONF_INSTALL_DIR:PATH=/etc -DSHARE_INSTALL_PREFIX:PATH=/usr/share -DCMAKE_INSTALL_LIBDIR:PATH=lib64 -DCMAKE_INSTALL_LIBEXECDIR=/usr/libexec -DCMAKE_BUILD_TYPE=RelWithDebInfo '-DCMAKE_C_FLAGS=-O2 -Wall -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -flto=auto' '-DCMAKE_CXX_FLAGS=-O2 -Wall -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -flto=auto' '-DCMAKE_Fortran_FLAGS=-O2 -Wall -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -flto=auto' '-DCMAKE_EXE_LINKER_FLAGS=-flto=auto -Wl,--as-needed -Wl,--no-undefined -Wl,-z,now' '-DCMAKE_MODULE_LINKER_FLAGS=-flto=auto -Wl,--as-needed' '-DCMAKE_SHARED_LINKER_FLAGS=-flto=auto -Wl,--as-needed -Wl,--no-undefined -Wl,-z,now' -DLIB_SUFFIX=64 -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON -DBUILD_SHARED_LIBS:BOOL=ON -DBUILD_STATIC_LIBS:BOOL=OFF -DCMAKE_COLOR_MAKEFILE:BOOL=OFF -DCMAKE_INSTALL_DO_STRIP:BOOL=OFF -DCMAKE_MODULES_INSTALL_DIR=/usr/lib64/cmake/rocksdb -DPORTABLE=ON -DWITH_LIBURING=ON -DWITH_SNAPPY=ON -DWITH_LZ4=ON -DWITH_ZLIB=ON -DWITH_ZSTD=ON -DWITH_BZ2=ON -DWITH_TESTS=OFF -DWITH_BENCHMARK_TOOLS=OFF -DWITH_TOOLS=OFF
andreasstieger commented 1 year ago

Still happening on 8.0.0

andreasstieger commented 1 year ago

From https://kojipkgs.fedoraproject.org//packages/rocksdb/7.8.3/2.fc39/data/logs/x86_64/build.log

builddir/build/BUILD/rocksdb-7.8.3/db/c.cc: In function 'rocksdb_batched_multi_get_cf':
/builddir/build/BUILD/rocksdb-7.8.3/db/c.cc:1463:59: warning: argument 1 value '18446744073709551615' exceeds maximum object size 9223372036854775807 [-Walloc-size-larger-than=]
 1463 |   PinnableSlice* value_slices = new PinnableSlice[num_keys];
      |                                                           ^
/usr/include/c++/13/new:128:26: note: in a call to allocation function 'operator new []' declared here
  128 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc)
      |                          ^
/builddir/build/BUILD/rocksdb-7.8.3/db/version_set.cc: In member function '__ct_base ':
/builddir/build/BUILD/rocksdb-7.8.3/db/version_set.cc:2061:56: warning: argument 1 value '18446744073709551615' exceeds maximum object size 9223372036854775807 [-Walloc-size-larger-than=]
 2061 |       files_(new std::vector<FileMetaData*>[num_levels_]),
      |                                                        ^
/usr/include/c++/13/new:128:26: note: in a call to allocation function 'operator new []' declared here
  128 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc)
      |                          ^
In member function '__ct ',
    inlined from '__ct_base ' at /builddir/build/BUILD/rocksdb-7.8.3/db/version_builder.cc:1317:60:
/builddir/build/BUILD/rocksdb-7.8.3/db/version_builder.cc:279:41: warning: argument 1 value '18446744073709551615' exceeds maximum object size 9223372036854775807 [-Walloc-size-larger-than=]
  279 |     levels_ = new LevelState[num_levels_];
      |                                         ^
/usr/include/c++/13/new: In member function '__ct_base ':
/usr/include/c++/13/new:128:26: note: in a call to allocation function 'operator new []' declared here
  128 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc)
      |                          ^
andreasstieger commented 1 year ago

turned off build fails on warnings