мой protobuf иногда зависал в & :: Proto :: _ DisconnectClient_default_instance_ - PullRequest
0 голосов
/ 07 июля 2019

обычно работает хорошо, но иногда дает сбой в & :: Proto :: _ DisconnectClient_default_instance _);

Это программа на С ++ для linux.

inline const ::Proto::DisconnectClient& GateCommand::disconnectclient() const {
  const ::Proto::DisconnectClient* p = disconnectclient_;
  // @@protoc_insertion_point(field_get:Proto.GateCommand.disconnectclient)
  return p != NULL ? *p : *reinterpret_cast<const ::Proto::DisconnectClient*>(
      &::Proto::_DisconnectClient_default_instance_);
}

Это информация о GDB.[root @ localhost gateserver] # gdb gateserver core.1

GNU gdb (GDB) Red Hat Enterprise Linux 7.6.1-110.el7
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-redhat-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /caravan/gateserver/build/gateserver...done.
[New LWP 6]
[New LWP 7]
[New LWP 1]

warning: .dynamic section for "/lib64/libz.so.1" is not at the expected address (wrong library or version mismatch?)
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
Core was generated by `./gateserver --ini ../server/single.ini'.
Program terminated with signal 11, Segmentation fault.
#0  0x0000000000428f77 in disconnectclient (this=<optimized out>) at /caravan/gateserver/Packet.pb.h:1482
1482          &::Proto::_DisconnectClient_default_instance_);
Missing separate debuginfos, use: debuginfo-install cyrus-sasl-lib-2.1.26-23.el7.x86_64 glibc-2.17-222.el7.x86_64 hiredis-0.12.1-1.el7.x86_64 keyutils-libs-1.5.8-3.el7.x86_64 krb5-libs-1.15.1-19.el7.x86_64 libcom_err-1.42.9-12.el7_5.x86_64 libcurl-7.29.0-51.el7.x86_64 libgcc-4.8.5-36.el7.x86_64 libidn-1.28-4.el7.x86_64 libselinux-2.5-12.el7.x86_64 libssh2-1.4.3-10.el7_2.1.x86_64 nspr-4.19.0-1.el7_5.x86_64 nss-3.36.0-5.el7_5.x86_64 nss-softokn-freebl-3.36.0-5.el7_5.x86_64 nss-util-3.36.0-1.el7_5.x86_64 openldap-2.4.44-15.el7_5.x86_64 openssl-libs-1.0.2k-12.el7.x86_64 pcre-8.32-17.el7.x86_64 zlib-1.2.7-18.el7.x86_64

(gdb) bt

#0  0x0000000000428f77 in disconnectclient (this=<optimized out>) at /caravan/gateserver/Packet.pb.h:1482
#1  TcpServer::DispatchMessage (this=<optimized out>, channel_name=<optimized out>, message=0x7f0cf8031fd0 "\022\n\b\334\340\"\020\035\030\354\325\004", len=<optimized out>) at /caravan/gateserver/network/TcpServer.cpp:238
#2  0x000000000042c594 in operator() (__args#2=<optimized out>, __args#1=<optimized out>, __args#0=<optimized out>, this=0x2535060) at /usr/local/include/c++/4.9.3/functional:2439
#3  CRedisSubscriber::command_callback (redis_context=<optimized out>, reply=0x7f0cf8000d70, privdata=0x2535000) at /caravan/gateserver/redis/CRedisSubscriber.cpp:204
#4  0x00007f0d03d77eff in redisProcessCallbacks () from /lib64/libhiredis.so.0.12
#5  0x000000000043fe20 in event_process_active_single_queue.isra.29 ()
#6  0x0000000000440377 in event_base_loop ()
#7  0x000000000042c6c7 in event_proc (this=0x2535000) at /caravan/gateserver/redis/CRedisSubscriber.cpp:225
#8  CRedisSubscriber::event_thread (data=0x2535000) at /caravan/gateserver/redis/CRedisSubscriber.cpp:218
#9  0x00007f0d038f2e25 in start_thread () from /lib64/libpthread.so.0
#10 0x00007f0d02be4bad in clone () from /lib64/libc.so.6

(gdb) список

1477    }
1478    inline const ::Proto::DisconnectClient& GateCommand::disconnectclient() const {
1479      const ::Proto::DisconnectClient* p = disconnectclient_;
1480      // @@protoc_insertion_point(field_get:Proto.GateCommand.disconnectclient)
1481      return p != NULL ? *p : *reinterpret_cast<const ::Proto::DisconnectClient*>(
1482          &::Proto::_DisconnectClient_default_instance_);
1483    }
1484    inline ::Proto::DisconnectClient* GateCommand::release_disconnectclient() {
1485      // @@protoc_insertion_point(field_release:Proto.GateCommand.disconnectclient)
1486      

(gdb)f 1

#1  TcpServer::DispatchMessage (this=<optimized out>, channel_name=<optimized out>, message=0x7f0cf8031fd0 "\022\n\b\334\340\"\020\035\030\354\325\004", len=<optimized out>) at /caravan/gateserver/network/TcpServer.cpp:238
238                 if(it->second->GetUserID() == command.disconnectclient().clientid() &&
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...