Skip to content

Segmentation fault of google::protobuf::Arena::OnArenaAllocation #4723

Closed
@IronsDu

Description

@IronsDu
Program received signal SIGSEGV, Segmentation fault.
0x0000000000eba354 in google::protobuf::Arena::OnArenaAllocation (this=0x7ffffec7d131,
    allocated_type=0x10f1e58 <typeinfo for google::protobuf::FileDescriptorProto>, n=216)
    at /mnt/d/private/vcpkg/buildtrees/protobuf/src/protobuf-3.5.1/src/google/protobuf/arena.cc:380
380         on_arena_allocation_(allocated_type, n, hooks_cookie_);
(gdb) p *this
$1 = {static kBlockOverhead = 40, impl_ = {static lifecycle_id_generator_ = {word_ = 0}, static thread_cache_ = {
      last_lifecycle_id_seen = -1, last_block_used_ = 0x0}, threads_ = -3674942576529506304,
    hint_ = 7854272498680986425, space_allocated_ = 5548429481011575608, initial_block_ = 0x3cfffb3544fffb36,
    lifecycle_id_ = 2089664953635044148, options_ = {start_block_size = 17077644506007862068,
      max_block_size = 16775987, initial_block = 0x0, initial_block_size = 0, block_alloc = 0x7600000000000000,
      block_dealloc = 0x676f6f672064696f}, static kHeaderSize = 40}, on_arena_init_ = 0x746f72703a3a656c,
  on_arena_allocation_ = 0x69463a3a6675626f, on_arena_reset_ = 0x6f6974704f646c65,
  on_arena_destruction_ = 0x5f7465733a3a736e, hooks_cookie_ = 0x6f67286570797463}
(gdb) bt
#0  0x0000000000eba354 in google::protobuf::Arena::OnArenaAllocation (this=0x7ffffec7d131,
    allocated_type=0x10f1e58 <typeinfo for google::protobuf::FileDescriptorProto>, n=216)
    at /mnt/d/private/vcpkg/buildtrees/protobuf/src/protobuf-3.5.1/src/google/protobuf/arena.cc:380
#1  0x0000000000af1e1b in google::protobuf::Arena::AllocHook (this=0x7ffffec7d131,
    allocated_type=0x10f1e58 <typeinfo for google::protobuf::FileDescriptorProto>, n=216)
    at /mnt/d/private/vcpkg/buildtrees/protobuf/src/protobuf-3.5.1/src/google/protobuf/arena.h:644
#2  0x0000000000ed598f in google::protobuf::Arena::AllocateInternal<google::protobuf::FileDescriptorProto> (
    skip_explicit_ownership=true, this=0x7ffffec7d131)
    at /mnt/d/private/vcpkg/buildtrees/protobuf/src/protobuf-3.5.1/src/google/protobuf/arena.h:654
#3  google::protobuf::Arena::CreateMessageInternal<google::protobuf::FileDescriptorProto> (this=0x7ffffec7d131)
    at /mnt/d/private/vcpkg/buildtrees/protobuf/src/protobuf-3.5.1/src/google/protobuf/arena.h:815
#4  google::protobuf::Arena::CreateMessage<google::protobuf::FileDescriptorProto> (arena=0x7ffffec7d131)
    at /mnt/d/private/vcpkg/buildtrees/protobuf/src/protobuf-3.5.1/src/google/protobuf/arena.h:290
#5  google::protobuf::FileDescriptorProto::New (this=0x7ffffffee160, arena=0x7ffffec7d131)
    at /mnt/d/private/vcpkg/buildtrees/protobuf/src/protobuf-3.5.1/src/google/protobuf/descriptor.pb.cc:2008
#6  0x00007ffffebf0038 in google::protobuf::MessageLite::ParseFromArray(void const*, int) ()
   from /usr/lib/x86_64-linux-gnu/libprotobuf.so.9
#7  0x00007ffffec391b6 in google::protobuf::EncodedDescriptorDatabase::Add(void const*, int) ()
   from /usr/lib/x86_64-linux-gnu/libprotobuf.so.9
#8  0x00007ffffebfa9b8 in google::protobuf::DescriptorPool::InternalAddGeneratedFile(void const*, int) ()
   from /usr/lib/x86_64-linux-gnu/libprotobuf.so.9
#9  0x00007ffffec2948c in google::protobuf::protobuf_AddDesc_google_2fprotobuf_2fdescriptor_2eproto() ()
   from /usr/lib/x86_64-linux-gnu/libprotobuf.so.9
#10 0x00007fffff4106ba in call_init (l=<optimized out>, argc=argc@entry=1, argv=argv@entry=0x7ffffffee3b8,
    env=env@entry=0x7ffffffee3c8) at dl-init.c:72
#11 0x00007fffff4107cb in call_init (env=0x7ffffffee3c8, argv=0x7ffffffee3b8, argc=1, l=<optimized out>)
    at dl-init.c:30
#12 _dl_init (main_map=0x7fffff627168, argc=1, argv=0x7ffffffee3b8, env=0x7ffffffee3c8) at dl-init.c:120
#13 0x00007fffff400c6a in _dl_start_user () from /lib64/ld-linux-x86-64.so.2
---Type <return> to continue, or q <return> to quit---
#14 0x0000000000000001 in ?? ()
#15 0x00007ffffffee5bf in ?? ()
#16 0x0000000000000000 in ?? ()

gcc :
(Ubuntu 7.3.0-16ubuntu3~16.04.1) 7.3.0

System :
Linux PC-201803231633 4.4.0-17134-Microsoft #81-Microsoft Sun May 20 01:14:00 PST 2018 x86_64 x86_64 x86_64 GNU/Linux

ldd ./a.out:

        linux-vdso.so.1 =>  (0x00007ffff3010000)
        libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f9c2cb90000)
        libbrynet.so => /mnt/d/private/vcpkg/installed/x64-linux/debug/lib/libbrynet.so (0x00007f9c2c860000)
        libprotobuf.so.9 => /usr/lib/x86_64-linux-gnu/libprotobuf.so.9 (0x00007f9c2c540000)
        libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f9c2c320000)
        librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f9c2c110000)
        libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f9c2bd80000)
        libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f9c2ba60000)
        libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f9c2b840000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f9c2b470000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f9c2ce00000)
        libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f9c2b240000)

Activity

arthur-tacca

arthur-tacca commented on Jun 4, 2018

@arthur-tacca

It looks like you're mixing up different versions of the library:

  • /mnt/d/private/vcpkg/buildtrees/protobuf/src/protobuf-3.5.1 is version 3.5.1 (presumably!)
  • /usr/lib/x86_64-linux-gnu/libprotobuf.so.9 is the operating-system supplied version, which for Ubuntu 16.04 is protobuf 2.6.1.
IronsDu

IronsDu commented on Jun 5, 2018

@IronsDu
Author

@arthur-tacca thanks, I will think why.

IronsDu

IronsDu commented on Jun 5, 2018

@IronsDu
Author

@arthur-tacca Thank you.
I modity target_link_libraries(xxx protobuf) to target_link_libraries(xxx protobuf::libprotobuf-lite protobuf::libprotobuf), not crash.

aminasadi0

aminasadi0 commented on Apr 12, 2019

@aminasadi0

@IronsDu I wish such think was possible in qmake world.

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @aminasadi0@IronsDu@xfxyjwf@arthur-tacca

        Issue actions

          Segmentation fault of google::protobuf::Arena::OnArenaAllocation · Issue #4723 · protocolbuffers/protobuf