Skip to content

route_guide_server process core seen during string encode in linux 32bit #15418

@babuveld

Description

@babuveld

What version of protobuf and what language are you using?
Version: main/v3.6.0/v3.5.0 etc. (NOTE: please try updating to the latest version of protoc/runtime possible beforehand to attempt to resolve your problem)
3.19.6

Language: C++/Java/Python/C#/Ruby/PHP/Objective-C/Javascript
c++

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

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

What did you do?
Steps to reproduce the behavior:
Upgraded libprotobuf from 3.6.1 to 3.19.6 and we see below core during encoding. Its with the route_guide_server.cc example. The core is seen only for following cases.

  • When string is being encoded. When number is encoded, there are no cores.
  • With 64bit compilation we don't see any cores. it works fine.

Program received signal SIGSEGV, Segmentation fault.
0xf7b674d7 in google::protobuf::internal::ThreadSafeArena::GetSerialArenaFallback(void*) () from /usr/lib/libprotobuf.so.30
(gdb) bt
#0 0xf7b674d7 in google::protobuf::internal::ThreadSafeArena::GetSerialArenaFallback(void*) () from /usr/lib/libprotobuf.so.30
#1 0xf7b672ea in google::protobuf::internal::ThreadSafeArena::AllocateAlignedWithCleanupFallback(unsigned int, std::type_info const*) () from /usr/lib/libprotobuf.so.30
#2 0xf7b678dc in google::protobuf::Arena::AllocateAlignedWithCleanup(unsigned int, std::type_info const*) () from /usr/lib/libprotobuf.so.30
#3 0xf7b680d0 in google::protobuf::internal::ArenaStringPtr::Set(google::protobuf::internal::ArenaStringPtr::EmptyDefault, std::string&&, google::protobuf::Arena*) () from /usr/lib/libprotobuf.so.30
#4 0x10046e5d in routeguide::Feature::set_namestd::string (arg0=..., this=0x1005e540) at ../gpb/lib/src/route_guide.pb.h:1186
#5 routeguide::Parser::TryParseOne (feature=0x1005e540, this=0xffffd6d8) at ../gpb/lib/src/helper.cc:111
#6 routeguide::ParseDb (db=..., feature_list=0xffffd8bc) at ../gpb/lib/src/helper.cc:163
#7 0x10044120 in RouteGuideImpl::RouteGuideImpl (db=..., this=0xffffd8a8) at ../gpb/lib/src/route_guide_server.cc:104
#8 RunServer (db_path=...) at ../gpb/lib/src/route_guide_server.cc:189
#9 0x100443a4 in main (argc=2, argv=0xffffda04) at ../gpb/lib/src/route_guide_server.cc:222
(gdb)

What did you expect to see
No cores

What did you see instead?
process core with SIGSEGV fault.

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

Anything else we should know about your project / environment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions