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

building fails with '-DENABLE_TESTING=ON' #4407

Closed
xtcyclist opened this issue Jul 13, 2022 · 3 comments
Closed

building fails with '-DENABLE_TESTING=ON' #4407

xtcyclist opened this issue Jul 13, 2022 · 3 comments
Assignees
Labels
severity/minor Severity of bug type/bug Type: something is unexpected
Milestone

Comments

@xtcyclist
Copy link
Contributor

xtcyclist commented Jul 13, 2022

Please check the FAQ documentation before raising an issue

Describe the bug (required)

(1) BENCHMARK_RELATIVE(cord_1k_mix, iters) and BENCHMARK_RELATIVE(icord_1k_mix, iters) block the build with the following errors:

/usr/include/x86_64-linux-gnu/bits/string_fortified.h:34:33: error: ‘void* __builtin_memcpy(void*, const void*, long unsigned int)’ reading between 1 and 1024 bytes from a region of size 0 [-Werror=stringop-overread]

(2) src/common/datatypes/test/ValueTest.cpp

/usr/bin/ld.bfd: CMakeFiles/value_test.dir/ValueTest.cpp.o: in function `nebula::Value_DecodeEncode_Test::TestBody()':
ValueTest.cpp:(.text+0x318d4): undefined reference to `unsigned int apache::thrift::Cpp2Ops<nebula::Value, void>::write<apache::thrift::CompactProtocolWriter>(apache::thrift::CompactProtocolWriter*, nebula::Value const*)'

Your Environments (required)

  • OS: Linux nebula-dev-84 5.4.0-105-generic
  • Compiler: 11.1.0
  • CPU: Intel(R) Xeon(R) Platinum 8352Y CPU @ 2.20GHz
  • Commit id: 7ce81ee

How To Reproduce(required)

Steps to reproduce the behavior:

  1. Step 1

rm -rf build
mkdir build
cd build
cmake
-DENABLE_TESTING=ON
-DCMAKE_BUILD_TYPE=Release
..

make -j32
make install

  1. Step 2
  2. Step 3

Expected behavior

Additional context

@xtcyclist xtcyclist added the type/bug Type: something is unexpected label Jul 13, 2022
@xtcyclist xtcyclist self-assigned this Jul 13, 2022
@xtcyclist
Copy link
Contributor Author

xtcyclist commented Jul 13, 2022

open happens with the release, not debug mode. seems to be some issue with the compiler.

@Sophie-Xie Sophie-Xie added this to the v3.3.0 milestone Jul 13, 2022
@xtcyclist
Copy link
Contributor Author

xtcyclist commented Jul 13, 2022

For the first issue with __builtin_memcpy, passing a character sequence like "abcdef", as in the benchmark, into cord's or icord's writer() triggers the compiler to warn possible problems like stringop-overread or array out-of-bound.

Can be fixed by first converting the character sequence into a std::string, and then pass the std::string to the writer().

BTW, the code looks fine to me. it's just that gcc-11 warns of potential problems.

@xtcyclist
Copy link
Contributor Author

For the second problem, the definitions for the class apache::thrift::Cpp2Ops's methods are written in some header files that are not included in the tests.

@jinyingsunny jinyingsunny added the severity/minor Severity of bug label Nov 11, 2022
yixinglu pushed a commit to yixinglu/nebula that referenced this issue Jan 31, 2023
* convert character sequences into std::string to avoid potential out-of-bound erros in memcpy.

* add missing header files in two test cases.

Co-authored-by: Sophie <[email protected]>

Co-authored-by: Cheng Xuntao <[email protected]>
Co-authored-by: Sophie <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
severity/minor Severity of bug type/bug Type: something is unexpected
Projects
None yet
Development

No branches or pull requests

3 participants