> From: Dhammika Pathirana <dhamm...@gmail.com> > Subject: Re: [zeromq-dev] nmap patch for github issues 147+149 > > Do you have a coredump? > Could you post a backtrace, run "thread apply all bt" in gdb.
Hi, so far my patches are working good for me. No more coredumps. I've undone the patches though and only patched the "zmq_engine_t::error()" function as below. Without that patch it will already coredump on the zmq_assert(inout) and not reach the more interesting error: So I used this patch: =========patch:========= void zmq::zmq_engine_t::error () { if (plugged) { zmq_assert (inout); inout->detach (); unplug (); } if(ephemeral_inout) { ephemeral_inout->detach (); } delete this; //do not delete, will cause dangling pointer } ================== then I run nmap as following: nmap -sV -n xxx.xxx.xxx.xxx -p 5550-5570 (my program is listening on some zeromq sockets in that port range) result: [...] pure virtual method called terminate called without an active exception Aborted (core dumped) =========gdb bt:========= (gdb) bt #0 0xb7d18aa6 in raise () from /lib/libc.so.6 #1 0xb7d1a1b3 in abort () from /lib/libc.so.6 #2 0xb7f174d0 in __gnu_cxx::__verbose_terminate_handler () from /usr/lib/libstdc++.so.6 #3 0xb7f14ef5 in std::exception::what () from /usr/lib/libstdc++.so.6 #4 0xb7f14f32 in std::terminate () from /usr/lib/libstdc++.so.6 #5 0xb7f15615 in __cxa_pure_virtual () from /usr/lib/libstdc++.so.6 #6 0x080f3ca6 in zmq::session_t::process_attach (this=0x82b59c0, engine_=0x83327e8, peer_identity_=@0xb6ced6dc) at session.cpp:268 #7 0x080e50f2 in zmq::object_t::process_command (this=0x82b59c0, cmd_=@0xb6ced728) at object.cpp:86 #8 0x080e3ca7 in zmq::io_thread_t::in_event (this=0x82a5e60) at io_thread.cpp:82 #9 0x080eea37 in zmq::epoll_t::loop (this=0x82a40a0) at epoll.cpp:160 #10 0x080f6be8 in thread_routine (arg_=0x82a40e4) at thread.cpp:70 #11 0xb7f4e1eb in start_thread () from /lib/libpthread.so.0 #12 0xb7daf7fe in clone () from /lib/libc.so.6 ================== =========gdb thread apply all bt:========= (gdb) thread apply all bt Thread 8 (process 18547): #0 0xb7f51fe1 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/libpthread.so.0 #1 0x080ab27d in yaaf::Trigger::wait (this=0x81eade0) at /data/home/thijs/git/yaaf/public/libyaaf/yaaf_threading.h:86 #2 0x080a8d20 in yaaf::WaitContext () at /data/home/thijs/git/yaaf/public/libyaaf/yaaf_context.cpp:77 #3 0x08096c02 in main (argc=1, argv=0xbff710cc) at /data/home/thijs/git/yaaf/apiproxy/main.cpp:38 Thread 7 (process 18548): #0 0xb7f55a89 in do_sigwait () from /lib/libpthread.so.0 #1 0xb7f55b2f in sigwait () from /lib/libpthread.so.0 #2 0x080dfc09 in sigwaitThread () at /data/home/thijs/git/yaaf/public/libycommon/sighandler.cpp:22 #3 0xb7f4e1eb in start_thread () from /lib/libpthread.so.0 #4 0xb7daf7fe in clone () from /lib/libc.so.6 Thread 6 (process 18549): #0 0xb7d7b96c in std::exception::what () from /lib/libc.so.6 #1 0xb7d7b77f in sleep () from /lib/libc.so.6 #2 0x080c3170 in yaaf::lib::YStat::thread_entry_point (ctx=0x0) at /data/home/thijs/git/yaaf/public/libystat/ystat.cpp:175 #3 0xb7f4e1eb in start_thread () from /lib/libpthread.so.0 #4 0xb7daf7fe in clone () from /lib/libc.so.6 Thread 5 (process 18551): #0 0xb7da6579 in poll () from /lib/libc.so.6 #1 0x08108c1d in do_io (v=0x82bc000) at src/mt_adaptor.c:299 #2 0xb7f4e1eb in start_thread () from /lib/libpthread.so.0 #3 0xb7daf7fe in clone () from /lib/libc.so.6 Thread 4 (process 18552): #0 0xb7f51fe1 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/libpthread.so.0 #1 0x08108a80 in do_completion (v=0x82bc000) at src/mt_adaptor.c:330 #2 0xb7f4e1eb in start_thread () from /lib/libpthread.so.0 #3 0xb7daf7fe in clone () from /lib/libc.so.6 Thread 3 (process 18553): #0 0xb7da6579 in poll () from /lib/libc.so.6 #1 0x080e01e8 in zmq_poll (items_=0x82c01b0, nitems_=11, timeout_=2000000) at zmq.cpp:412 #2 0x080a0fee in apiproxy::Device::run (this=0x82d5000) at /data/home/thijs/git/yaaf/apiproxy/device_run.cpp:117 #3 0x080a6b2b in yaaf::Context::thread_entry_point (ctx=0x82d500c) at /data/home/thijs/git/yaaf/public/libyaaf/yaaf_context.cpp:444 #4 0xb7f4e1eb in start_thread () from /lib/libpthread.so.0 #5 0xb7daf7fe in clone () from /lib/libc.so.6 Thread 2 (process 18554): #0 0xb7dafebc in std::exception::what () from /lib/libc.so.6 #1 0x080d8687 in epoll_dispatch () at /data/home/thijs/git/yaaf/public/libconfig/libconfig.cpp:62 #2 0x080ca9fb in event_base_loop () at /data/home/thijs/git/yaaf/public/libconfig/libconfig.cpp:62 #3 0x080cb779 in event_base_dispatch () at /data/home/thijs/git/yaaf/public/libconfig/libconfig.cpp:62 #4 0x080c258c in yaaf::BaseHttp::run (this=0x82ab060) at /data/home/thijs/git/yaaf/public/libyaaf/yaaf_http.cpp:61 #5 0x080a6b2b in yaaf::Context::thread_entry_point (ctx=0x82ab060) at /data/home/thijs/git/yaaf/public/libyaaf/yaaf_context.cpp:444 #6 0xb7f4e1eb in start_thread () from /lib/libpthread.so.0 #7 0xb7daf7fe in clone () from /lib/libc.so.6 Thread 1 (process 18550): #0 0xb7d18aa6 in raise () from /lib/libc.so.6 #1 0xb7d1a1b3 in abort () from /lib/libc.so.6 #2 0xb7f174d0 in __gnu_cxx::__verbose_terminate_handler () from /usr/lib/libstdc++.so.6 #3 0xb7f14ef5 in std::exception::what () from /usr/lib/libstdc++.so.6 #4 0xb7f14f32 in std::terminate () from /usr/lib/libstdc++.so.6 #5 0xb7f15615 in __cxa_pure_virtual () from /usr/lib/libstdc++.so.6 #6 0x080f3ca6 in zmq::session_t::process_attach (this=0x82b59c0, engine_=0x83327e8, peer_identity_=@0xb6ced6dc) at session.cpp:268 #7 0x080e50f2 in zmq::object_t::process_command (this=0x82b59c0, cmd_=@0xb6ced728) at object.cpp:86 #8 0x080e3ca7 in zmq::io_thread_t::in_event (this=0x82a5e60) at io_thread.cpp:82 #9 0x080eea37 in zmq::epoll_t::loop (this=0x82a40a0) at epoll.cpp:160 #10 0x080f6be8 in thread_routine (arg_=0x82a40e4) at thread.cpp:70 #11 0xb7f4e1eb in start_thread () from /lib/libpthread.so.0 #12 0xb7daf7fe in clone () from /lib/libc.so.6 ================== Thijs _______________________________________________ zeromq-dev mailing list zeromq-dev@lists.zeromq.org http://lists.zeromq.org/mailman/listinfo/zeromq-dev