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

undefined reference to grpc_core::MetadataQuery::kIPv6Attribute #32881

Closed
kiloyqp opened this issue Apr 17, 2023 · 4 comments · Fixed by #32911
Closed

undefined reference to grpc_core::MetadataQuery::kIPv6Attribute #32881

kiloyqp opened this issue Apr 17, 2023 · 4 comments · Fixed by #32911

Comments

@kiloyqp
Copy link

kiloyqp commented Apr 17, 2023

What version of gRPC and what language are you using?

C++ 17
v1.54.0

What operating system (Linux, Windows,...) and version?

ubuntu 18.04 x86_64

What runtime / compiler are you using (e.g. python version or version of gcc)

cmake 3.23.0
g++ 7.5.0

What did you do?

Please provide either 1) A unit test for reproducing the bug or 2) Specific steps for us to follow to reproduce the bug. If there’s not enough information to debug the problem, gRPC team may close the issue at their discretion. You’re welcome to re-open the issue once you have a reproduction.
1)On the ubuntu 18.04 x86_64 platform, cross compile the executable program of aarch64 ubuntu 18.04。
2)link grpc and related shared libs to my project and make.

    SET(GRPC_LIB libabsl_bad_any_cast_impl.so libabsl_bad_optional_access.so libabsl_bad_variant_access.so libabsl_base.so libabsl_city.so libabsl_civil_time.so libabsl_cord_internal.so libabsl_cord.so libabsl_cordz_functions.so libabsl_cordz_handle.so libabsl_cordz_info.so libabsl_cordz_sample_token.so libabsl_crc32c.so libabsl_crc_cord_state.so libabsl_crc_cpu_detect.so libabsl_crc_internal.so libabsl_debugging_internal.so libabsl_demangle_internal.so libabsl_die_if_null.so libabsl_examine_stack.so libabsl_exponential_biased.so libabsl_failure_signal_handler.so libabsl_flags_commandlineflag_internal.so libabsl_flags_commandlineflag.so libabsl_flags_config.so libabsl_flags_internal.so libabsl_flags_marshalling.so libabsl_flags_parse.so libabsl_flags_private_handle_accessor.so libabsl_flags_program_name.so libabsl_flags_reflection.so libabsl_flags.so libabsl_flags_usage_internal.so libabsl_flags_usage.so libabsl_graphcycles_internal.so libabsl_hash.so libabsl_hashtablez_sampler.so libabsl_int128.so libabsl_leak_check.so libabsl_log_entry.so libabsl_log_flags.so libabsl_log_globals.so libabsl_log_initialize.so libabsl_log_internal_check_op.so libabsl_log_internal_conditions.so libabsl_log_internal_format.so libabsl_log_internal_globals.so libabsl_log_internal_log_sink_set.so libabsl_log_internal_message.so libabsl_log_internal_nullguard.so libabsl_log_internal_proto.so libabsl_log_severity.so libabsl_log_sink.so libabsl_low_level_hash.so libabsl_malloc_internal.so libabsl_periodic_sampler.so libabsl_random_distributions.so libabsl_random_internal_distribution_test_util.so libabsl_random_internal_platform.so libabsl_random_internal_pool_urbg.so libabsl_random_internal_randen_hwaes_impl.so libabsl_random_internal_randen_hwaes.so libabsl_random_internal_randen_slow.so libabsl_random_internal_randen.so libabsl_random_internal_seed_material.so libabsl_random_seed_gen_exception.so libabsl_random_seed_sequences.so libabsl_raw_hash_set.so libabsl_raw_logging_internal.so libabsl_scoped_set_env.so libabsl_spinlock_wait.so libabsl_stacktrace.so libabsl_statusor.so libabsl_status.so libabsl_strerror.so libabsl_str_format_internal.so libabsl_strings_internal.so libabsl_strings.so libabsl_symbolize.so libabsl_synchronization.so libabsl_throw_delegate.so libabsl_time.so libabsl_time_zone.so libaddress_sorting.so libcrypto.so libgpr.so libgrpc++_alts.so libgrpc_authorization_provider.so libgrpc++_error_details.so libgrpc_plugin_support.so libgrpcpp_channelz.so libgrpc++_reflection.so libgrpc.so libgrpc++.so libgrpc_unsecure.so libgrpc++_unsecure.so libprotobuf-lite.so libprotobuf.so libprotoc.so libre2.so libssl.so libupb.so libz.so)
    target_link_libraries(${PROJECT_NAME}   

        PRIVATE   

        ${GRPC_LIB}    

        libdl.so   

        libsystemd.so    

        liblz4.so    

        libpthread.so    

        )  

What did you expect to see?

I expected make success

What did you see instead?

libgrpc_authorization_provider.so:undefined reference to grpc_event_engine::experimental::EventEngine::ConnectionHandle::kInvalid   

libgrpc.so:undefined reference to grpc_core::MetadataQuery::kIPv6Attribute

Make sure you include information that can help us debug (full error message, exception listing, stack trace, logs).

See TROUBLESHOOTING.md for how to diagnose problems better.

Anything else we should know about your project / environment?

@rockspore
Copy link
Contributor

This issue was seen with Bazel as well:

bazel-out/k8-opt/bin/external/com_github_grpc_grpc/src/core/_objs/grpc_resolver_c2p/google_c2p_resolver.o:google_c2p_resolver.cc:function grpc_core::(anonymous namespace)::GoogleCloud2ProdResolver::StartLocked(): error: undefined reference to 'grpc_core::MetadataQuery::kIPv6Attribute'
gcc --version
gcc (Debian 10.2.1-6) 10.2.1 20210110
Copyright (C) 2020 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

clang --version
Debian clang version 11.0.1-2

uname -a
Linux 73375e62d70b 6.1.15-1rodete3-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.15-1rodete3 (2023-03-28) x86_64 GNU/Linux

#32294 seems to be the PR that causes this issue. Somehow, some version(s) of linkers couldn't find that symbol.

@kiloyqp
Copy link
Author

kiloyqp commented Apr 18, 2023 via email

@yashykt
Copy link
Member

yashykt commented Apr 19, 2023

This is strange. I haven't been able to reproduce this issue, nor have we seen this on any of our CI tests.

@kiloyqp
Copy link
Author

kiloyqp commented Apr 19, 2023

what i have done belows:

  1. git clone v1.54.0,then compile with c++17 on aarch64 ubuntu 18.04;
cmake ../.. -DCMAKE_BUILD_TYPE=Release  -DBUILD_SHARED_LIBS=ON -DgRPC_INSTALL=ON -DCMAKE_INSTALL_PREFIX=/opt/grpc -DCMAKE_CXX_STANDARD=17
make && make install

2)package the shared library,the other people wanna link them on x86_64 ubuntu 18.04, cross compile the executable program of aarch64 ubuntu 18.04.
3) use v1.53.0 is ok.

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

Successfully merging a pull request may close this issue.

3 participants