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

-m32 is not compatible with -freg-struct-return #6700

Closed
sunbibei opened this issue Sep 26, 2019 · 2 comments
Closed

-m32 is not compatible with -freg-struct-return #6700

sunbibei opened this issue Sep 26, 2019 · 2 comments
Assignees
Labels
c++ inactive Denotes the issue/PR has not seen activity in the last 90 days. platform related Any issue releated to specific platform or OS

Comments

@sunbibei
Copy link

What version of protobuf and what language are you using?
Version: master
Language: C++

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

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

What did you do?
Steps to reproduce the behavior:

  1. git clone the master branch.
  2. mkdir build && cd build
  3. cmake -DCMAKE_CXX_FLAGS="-m32 -freg-struct-return" -DCMAKE_INSTALL_PREFIX=$PWD -DBUILD_SHARED_LIBS=ON -Dprotobuf_BUILD_TESTS=OFF -Dprotobuf_BUILD_PROTOC_BINARIES=ON -Dprotobuf_WITH_ZLIB=OFF DCMAKE_SKIP_RPATH=TRUE ../cmake
  4. ./protoc

What did you expect to see
the protoc will print the help information.

What did you see instead?
Segmentation fault (core dumped)

Make sure you include information that can help us debug (full error message, exception listing, stack trace, logs).
cd build && gdb ./protoc
(gdb) start
(gdb) bt
#0 0xf7367570 in std::__detail::_Prime_rehash_policy::_M_need_rehash(unsigned int, unsigned int, unsigned int) const () from /usr/lib/libstdc++.so.6
#1 0xf79454bb in std::_Hashtable<char const*, std::pair<char const* const, google::protobuf::internal::DescriptorTable const*>, std::allocator<std::pair<char const* const, google::protobuf::internal::DescriptorTable const*> >, std::__detail::_Select1st, google::protobuf::streq, google::protobuf::hash<char const*>, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<true, false, true> >::_M_insert_unique_node(unsigned int, unsigned int, std::__detail::_Hash_node<std::pair<char const* const, google::protobuf::internal::DescriptorTable const*>, true>) () from /home/bibei/Workspace/protobuf-master/build/libprotobuf.so.3.10.0.0
#2 0xf7944ea0 in std::pair<std::__detail::_Node_iterator<std::pair<char const
const, google::protobuf::internal::DescriptorTable const*>, false, true>, bool> std::_Hashtable<char const*, std::pair<char const* const, google::protobuf::internal::DescriptorTable const*>, std::allocator<std::pair<char const* const, google::protobuf::internal::DescriptorTable const*> >, std::__detail::_Select1st, google::protobuf::streq, google::protobuf::hash<char const*>, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<true, false, true> >::_M_insert<std::pair<char const* const, google::protobuf::internal::DescriptorTable const*> const&, std::__detail::_AllocNode<std::allocator<std::__detail::_Hash_node<std::pair<char const* const, google::protobuf::internal::DescriptorTable const*>, true> > > >(std::pair<char const* const, google::protobuf::internal::DescriptorTable const*> const&, std::__detail::_AllocNode<std::allocator<std::__detail::_Hash_node<std::pair<char const* const, google::protobuf::internal::DescriptorTable const*>, true> > > const&, std::integral_constant<bool, true>) () from /home/bibei/Workspace/protobuf-master/build/libprotobuf.so.3.10.0.0
#3 0xf7944832 in std::__detail::_Insert_base<char const*, std::pair<char const* const, google::protobuf::internal::DescriptorTable const*>, std::allocator<std::pair<char const* const, google::protobuf::internal::DescriptorTable const*> >, std::__detail::_Select1st, google::protobuf::streq, google::protobuf::hash<char const*>, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<true, false, true> >::insert(std::pair<char const* const, google::protobuf::internal::DescriptorTable const*> const&) () from /home/bibei/Workspace/protobuf-master/build/libprotobuf.so.3.10.0.0
#4 0xf7944066 in std::unordered_map<char const*, google::protobuf::internal::DescriptorTable const*, google::protobuf::hash<char const*>, google::protobuf::streq, std::allocator<std::pair<char const* const, google::protobuf::internal::DescriptorTable const*> > >::insert(std::pair<char const* const, google::protobuf::internal::DescriptorTable const*> const&) () from /home/bibei/Workspace/protobuf-master/build/libprotobuf.so.3.10.0.0
#5 0xf7943a6a in bool google::protobuf::InsertIfNotPresent<std::unordered_map<char const*, google::protobuf::internal::DescriptorTable const*, google::protobuf::hash<char const*>, google::protobuf::streq, std::allocator<std::pair<char const* const, google::protobuf::internal::DescriptorTable const*> > > >(std::unordered_map<char const*, google::protobuf::internal::DescriptorTable const*, google::protobuf::hash<char const*>, google::protobuf::streq, std::allocator<std::pair<char const* const, google::protobuf::internal::DescriptorTable const*> > >, std::unordered_map<char const, google::protobuf::internal::DescriptorTable const*, google::protobuf::hash<char const*>, google::protobuf::streq, std::allocator<std::pair<char const* const, google::protobuf::internal::DescriptorTable const*> > >::value_type const&) () from /home/bibei/Workspace/protobuf-master/build/libprotobuf.so.3.10.0.0
#6 0xf79433ca in bool google::protobuf::InsertIfNotPresent<std::unordered_map<char const*, google::protobuf::internal::DescriptorTable const*, google::protobuf::hash<char const*>, google::protobuf::streq, std::allocator<std::pair<char const* const, google::protobuf::internal::DescriptorTable const*> > > >(std::unordered_map<char const*, google::protobuf::internal::DescriptorTable const*, google::protobuf::hash<char const*>, google::protobuf::streq, std::allocator<std::pair<char const* const, google::protobuf::internal::DescriptorTable const*> > >, std::unordered_map<char const, google::protobuf::internal::DescriptorTable const*, google::protobuf::hash<char const*>, google::protobuf::streq, std::allocator<std::pair<char const* const, google::protobuf::internal::DescriptorTable const*> > >::value_type::first_type const&, std::unordered_map<char const*, google::protobuf::internal::DescriptorTable const*, google::protobuf::hash<char const*>, google::protobuf::streq, std::allocator<std::pair<char const* const, google::protobuf::internal::DescriptorTable const*> > >::value_type::second_type const&) () from /home/bibei/Workspace/protobuf-master/build/libprotobuf.so.3.10.0.0
#7 0xf7940efe in google::protobuf::(anonymous namespace)::GeneratedMessageFactory::RegisterFile(google::protobuf::internal::DescriptorTable const*) () from /home/bibei/Workspace/protobuf-master/build/libprotobuf.so.3.10.0.0
#8 0xf79414dd in google::protobuf::MessageFactory::InternalRegisterGeneratedFile(google::protobuf::internal::DescriptorTable const*) () from /home/bibei/Workspace/protobuf-master/build/libprotobuf.so.3.10.0.0
#9 0xf7907c4c in google::protobuf::(anonymous namespace)::AddDescriptorsImpl(google::protobuf::internal::DescriptorTable const*) () from /home/bibei/Workspace/protobuf-master/build/libprotobuf.so.3.10.0.0
#10 0xf7907cba in google::protobuf::internal::AddDescriptors(google::protobuf::internal::DescriptorTable const*) () from /home/bibei/Workspace/protobuf-master/build/libprotobuf.so.3.10.0.0
#11 0xf782192e in __static_initialization_and_destruction_0 () from /home/bibei/Workspace/protobuf-master/build/libprotobuf.so.3.10.0.0
#12 0xf782195d in _GLOBAL__sub_I_any.pb.cc () from /home/bibei/Workspace/protobuf-master/build/libprotobuf.so.3.10.0.0
#13 0xf7feabfe in call_init.part () from /lib/ld-linux.so.2
#14 0xf7feacf4 in _dl_init () from /lib/ld-linux.so.2
#15 0xf7fdc12f in _dl_start_user () from /lib/ld-linux.so.2

Anything else we should know about your project / environment
I modify the CMAKE_CXX_FLAGS, using -m32 and -freg-struct-return together.

@elharo elharo added c++ platform related Any issue releated to specific platform or OS labels Sep 17, 2021
Copy link

We triage inactive PRs and issues in order to make it easier to find active work. If this issue should remain active or becomes active again, please add a comment.

This issue is labeled inactive because the last activity was over 90 days ago.

@github-actions github-actions bot added the inactive Denotes the issue/PR has not seen activity in the last 90 days. label Mar 31, 2024
Copy link

We triage inactive PRs and issues in order to make it easier to find active work. If this issue should remain active or becomes active again, please reopen it.

This issue was closed and archived because there has been no new activity in the 14 days since the inactive label was added.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Apr 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c++ inactive Denotes the issue/PR has not seen activity in the last 90 days. platform related Any issue releated to specific platform or OS
Projects
None yet
Development

No branches or pull requests

3 participants