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

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

Closed
IronsDu opened this issue Jun 4, 2018 · 4 comments
Closed

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

IronsDu opened this issue Jun 4, 2018 · 4 comments

Comments

@IronsDu
Copy link

IronsDu commented Jun 4, 2018

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)
@arthur-tacca
Copy link

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
Copy link
Author

IronsDu commented Jun 5, 2018

@arthur-tacca thanks, I will think why.

@IronsDu
Copy link
Author

IronsDu commented Jun 5, 2018

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

@aminasadi0
Copy link

@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
Projects
None yet
Development

No branches or pull requests

4 participants