Advertisement
Guest User

Untitled

a guest
Mar 31st, 2015
446
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.56 KB | None | 0 0
  1. Program terminated with signal SIGABRT, Aborted.
  2. #0 0x00007f9ed30ee107 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
  3. 56 ../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory.
  4. (gdb) bt
  5. #0 0x00007f9ed30ee107 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
  6. #1 0x00007f9ed30ef4e8 in __GI_abort () at abort.c:89
  7. #2 0x00007f9ed312c044 in __libc_message (do_abort=do_abort@entry=1,
  8. fmt=fmt@entry=0x7f9ed321ec60 "*** Error in `%s': %s: 0x%s ***n") at ../sysdeps/posix/libc_fatal.c:175
  9. #3 0x00007f9ed313181e in malloc_printerr (action=1, str=0x7f9ed321f000 "malloc(): memory corruption (fast)",
  10. ptr=<optimized out>) at malloc.c:4996
  11. #4 0x00007f9ed3133bbb in _int_malloc (av=0x7f9ecc000020, bytes=32) at malloc.c:3359
  12. #5 0x00007f9ed3134eb0 in __GI___libc_malloc (bytes=32) at malloc.c:2891
  13. #6 0x00007f9ed39d82e8 in operator new(unsigned long) () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
  14. #7 0x0000000000471058 in Poco::Net::ParallelSocketAcceptor<BFSTcpServiceHandler, Poco::Net::SocketReactor>::createServiceHandler (this=0x7f9ed0e17d70, socket=...) at /usr/local/include/Poco/Net/ParallelSocketAcceptor.h:172
  15. #8 0x00000000004709d2 in Poco::Net::ParallelSocketAcceptor<BFSTcpServiceHandler, Poco::Net::SocketReactor>::onAccept
  16. (this=0x7f9ed0e17d70, pNotification=0x7f9ecc0009c0) at /usr/local/include/Poco/Net/ParallelSocketAcceptor.h:160
  17. #9 0x0000000000472bfe in Poco::Observer<Poco::Net::ParallelSocketAcceptor<BFSTcpServiceHandler, Poco::Net::SocketReactor>, Poco::Net::ReadableNotification>::notify (this=0x7f9ecc001d20, pNf=0x7f9ecc0009c0)
  18. at /usr/local/include/Poco/Observer.h:86
  19. #10 0x00007f9ed4709c4b in Poco::NotificationCenter::postNotification(Poco::AutoPtr<Poco::Notification>) ()
  20. from /usr/local/lib/libPocoFoundation.so.30
  21. #11 0x00007f9ed43c6630 in Poco::Net::SocketNotifier::dispatch(Poco::Net::SocketNotification*) ()
  22. from /usr/local/lib/libPocoNet.so.30
  23. #12 0x00007f9ed43c38a4 in Poco::Net::SocketReactor::dispatch(Poco::AutoPtr<Poco::Net::SocketNotifier>&, Poco::Net::SocketNotification*) () from /usr/local/lib/libPocoNet.so.30
  24. #13 0x00007f9ed43c3d1b in Poco::Net::SocketReactor::dispatch(Poco::Net::Socket const&, Poco::Net::SocketNotification*)
  25. () from /usr/local/lib/libPocoNet.so.30
  26. #14 0x00007f9ed43c4910 in Poco::Net::SocketReactor::run() () from /usr/local/lib/libPocoNet.so.30
  27. #15 0x000000000046a8dc in BFSTcpServer::run () at src/BFSTcpServer.cpp:69
  28. #16 0x0000000000459c1b in std::_Bind_simple<void (*())()>::_M_invoke<>(std::_Index_tuple<>) (this=0x1ee8d38)
  29. at /usr/include/c++/4.9/functional:1700
  30. ---Type <return> to continue, or q <return> to quit---
  31. #17 0x0000000000459b63 in std::_Bind_simple<void (*())()>::operator()() (this=0x1ee8d38)
  32. at /usr/include/c++/4.9/functional:1688
  33. #18 0x0000000000459ae0 in std::thread::_Impl<std::_Bind_simple<void (*())()> >::_M_run() (this=0x1ee8d20)
  34. at /usr/include/c++/4.9/thread:115
  35. #19 0x00007f9ed3a2f970 in ?? () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
  36. #20 0x00007f9ed4eaa0a4 in start_thread (arg=0x7f9ed0e18700) at pthread_create.c:309
  37. #21 0x00007f9ed319eccd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111
  38.  
  39. ...
  40. ServerSocket serverSocket(port);
  41. reactor = new SocketReactor();
  42. ParallelSocketAcceptor<BFSTcpServiceHandler,SocketReactor> acceptor(serverSocket, *reactor);
  43. reactor->run();
  44. ...
  45.  
  46. class BFSTcpServiceHandler {
  47. Poco::Net::StreamSocket socket;
  48. Poco::Net::SocketReactor& reactor;
  49. ...
  50. void onReadable(const Poco::AutoPtr<Poco::Net::ReadableNotification>& pNf);
  51. ...
  52. public:
  53. BFSTcpServiceHandler(Poco::Net::StreamSocket& _socket,
  54. Poco::Net::SocketReactor& _reactor);
  55. virtual ~BFSTcpServiceHandler();
  56. };
  57. //And implementation:
  58. BFSTcpServiceHandler::BFSTcpServiceHandler(StreamSocket& _socket,
  59. SocketReactor& _reactor): socket(_socket),reactor(_reactor) {
  60.  
  61. //Register Callbacks
  62. reactor.addEventHandler(socket, NObserver<BFSTcpServiceHandler,
  63. ReadableNotification>(*this, &BFSTcpServiceHandler::onReadable));
  64. }
  65.  
  66. BFSTcpServiceHandler::~BFSTcpServiceHandler() {
  67. //Unregister Callbacks
  68. reactor.removeEventHandler(socket, NObserver<BFSTcpServiceHandler,
  69. ReadableNotification>(*this, &BFSTcpServiceHandler::onReadable));
  70.  
  71. //Close socket
  72. try {
  73. socket.shutdown();
  74. socket.close();
  75. }catch(Exception &e){
  76. LOG(ERROR)<<"ERROR IN CLOSING CONNECTION";
  77. }
  78. }
  79.  
  80. void BFSTcpServiceHandler::onReadable(
  81. const Poco::AutoPtr<Poco::Net::ReadableNotification>& pNf) {
  82. ...
  83. int read = socket.receiveBytes(_packet,sizeof(reqPacket.opCode));
  84. ...
  85. //connection is served just close it!
  86. delete this;
  87. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement