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

Runtime error (seem to be caused by link error) #267

Closed
wangyuyue opened this issue Oct 19, 2023 · 4 comments
Closed

Runtime error (seem to be caused by link error) #267

wangyuyue opened this issue Oct 19, 2023 · 4 comments

Comments

@wangyuyue
Copy link

Describe the bug
Runtime error (seem to be caused by link error)

To Reproduce

git clone https://github.com/facebook/CacheLib
cd CacheLib
./contrib/build.sh -T -j
cd examples/simple_cache
./build.sh
./build/simple-cache-example

Expected behavior
Run example program successfully

Output
ERROR: something wrong with flag 'thrift_cpp2_simple_json_base64_allow_padding' in file '/users/glacier/CacheLib/cachelib/external/fbthrift/thrift/lib/cpp2/protocol/JSONProtocolCommon.cpp'. One possibility: file '/users/glacier/CacheLib/cachelib/external/fbthrift/thrift/lib/cpp2/protocol/JSONProtocolCommon.cpp' is being linked both statically and dynamically into this executable.

Desktop (please complete the following information):

  • OS: Ubuntu 20.04
@siphonelee
Copy link

Same error here on Ubuntu 20.04 when running:
./opt/cachelib/bin/cachebench --help

after:

git clone https://github.com/facebook/CacheLib
cd CacheLib
./contrib/build.sh -T -j

@jaesoo-fb
Copy link
Contributor

@wangyuyue @siphonelee Thanks for the report. We are working on the fix. Thanks

@rainjuns
Copy link

rainjuns commented Oct 21, 2023

@jaesoo-fb Thank you for the help.

I met the same issue before.

At this time, ./contrib/build.sh -j -T fails to build fbthrift:

-- Found Boost: /usr/lib/x86_64-linux-gnu/cmake/Boost-1.71.0/BoostConfig.cmake (found version "1.71.0") found components: filesystem
-- Found gflags from package config /CacheLib/opt/cachelib/lib/cmake/gflags/gflags-config.cmake
-- Found gflags as a dependency of glog::glog, include=/CacheLib/opt/cachelib/include, libs=gflags_shared
-- Found Boost: /usr/lib/x86_64-linux-gnu/cmake/Boost-1.71.0/BoostConfig.cmake (found suitable version "1.71.0", minimum required is "1.51.0") found components: context filesystem program_options regex system thread
-- Found folly: /CacheLib/opt/cachelib
-- Found folly: /CacheLib/opt/cachelib
-- Found fizz: /CacheLib/opt/cachelib
-- Found wangle: /CacheLib/opt/cachelib
-- ZSTD: /CacheLib/opt/cachelib/include
-- Found folly: /CacheLib/opt/cachelib
-- Found folly: /CacheLib/opt/cachelib
-- Found fizz: /CacheLib/opt/cachelib
-- Found Boost: /usr/lib/x86_64-linux-gnu/cmake/Boost-1.71.0/BoostConfig.cmake (found version "1.71.0") found components: iostreams system thread filesystem regex context
-- Found mvfst: /CacheLib/opt/cachelib
CMake Warning at CMakeLists.txt:122 (find_package):
  By not providing "Findpython-six.cmake" in CMAKE_MODULE_PATH this project
  has asked CMake to find a package configuration file provided by
  "python-six", but CMake did not find one.

  Could not find a package configuration file provided by "python-six" with
  any of the following names:

    python-sixConfig.cmake
    python-six-config.cmake

  Add the installation prefix of "python-six" to CMAKE_PREFIX_PATH or set
  "python-six_DIR" to a directory containing one of the above files.  If
  "python-six" provides a separate development package or SDK, be sure it has
  been installed.


-- Python dependencies not found, will not build thrift/lib/py
-- Configuring done
CMake Error: The inter-target dependency graph contains the following strongly connected component (cycle):
  "async" of type SHARED_LIBRARY
    depends on "transport" (weak)
    depends on "rpcmetadata" (weak)
    depends on "thriftprotocol" (weak)
  "transport" of type SHARED_LIBRARY
    depends on "rpcmetadata" (weak)
    depends on "thriftprotocol" (weak)
    depends on "async" (weak)
    depends on "rpcmetadata" (strong)
  "rpcmetadata" of type SHARED_LIBRARY
    depends on "thriftprotocol" (weak)
    depends on "async" (weak)
    depends on "transport" (weak)
  "thriftprotocol" of type SHARED_LIBRARY
    depends on "async" (weak)
    depends on "transport" (weak)
    depends on "rpcmetadata" (weak)
At least one of these targets is not a STATIC_LIBRARY.  Cyclic dependencies are allowed only among static libraries.
CMake Generate step failed.  Build files cannot be regenerated correctly.
build-package.sh: error: cmake failed on cachelib/external/fbthrift
build.sh: error: failed to build dependency 'fbthrift'

jaesoo-fb added a commit to jaesoo-fb/CacheLib that referenced this issue Oct 24, 2023
As reported in facebook#267, we are seeing
the runtime error which is caused by fbthrift change 8c2dfbbe50d7 (Allow padding
in SimpleJSONProtocol base64 encoded binary fields). This change fixes the
fbthrift to the lastest tag v2023.10.09.00 before the offending change.
facebook-github-bot pushed a commit to facebook/fbthrift that referenced this issue Oct 27, 2023
Summary: This is an alternative diff to D50521352, that simply removes the gflag causing the [issue](facebook/CacheLib#267). This is likely an inferior option, since it removes the option for users to opt ouf of the new behavior of ignoring padding in base64.  However, while this was technically a breaking change, since previously the base64 decoder would append garbage bytes to the end of the input in the presence of padding, it seems unlikely that anyone depended on this corruption.

Reviewed By: vitaut, jaesoo-fb

Differential Revision: D50568555

fbshipit-source-id: bdebd070bd1d620c653d619317e9898eac049ca5
@jaesoo-fb
Copy link
Contributor

Fixed by fbthrift change 0f3b4bf922b7 (Remove gflag in JSONProtocolCommon)

facebook-github-bot pushed a commit to facebook/hhvm that referenced this issue Nov 6, 2023
Summary: This is an alternative diff to D50521352, that simply removes the gflag causing the [issue](facebook/CacheLib#267). This is likely an inferior option, since it removes the option for users to opt ouf of the new behavior of ignoring padding in base64.  However, while this was technically a breaking change, since previously the base64 decoder would append garbage bytes to the end of the input in the presence of padding, it seems unlikely that anyone depended on this corruption.

Reviewed By: vitaut, jaesoo-fb

Differential Revision: D50568555

fbshipit-source-id: bdebd070bd1d620c653d619317e9898eac049ca5
facebook-github-bot pushed a commit that referenced this issue Nov 20, 2023
Summary:
As discovered in #267, current workflow cannot detect
runtime link error. This change adds the step to run a cachebench with simple configuration as a
test for the build.

Reviewed By: therealgymmy

Differential Revision: D50667376

fbshipit-source-id: f19ebcdfb894ef43e7286dc3565ae8e00c1b1a03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants