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

Crash in Pistache while API was being invoked #553

Closed
tmustafa opened this issue Jun 13, 2019 · 2 comments
Closed

Crash in Pistache while API was being invoked #553

tmustafa opened this issue Jun 13, 2019 · 2 comments

Comments

@tmustafa
Copy link

tmustafa commented Jun 13, 2019

Here is the stack trace of the crashing thread. Sorry, I mentioned something incorrect earlier, its exception due to throw from "epoll_ctl".

Using conanized Pistache and here is the version number "pistache/2019.05.29".

Maybe this is a known problem, I tried to search but did not find any similar issue.

Any feedback will be appreciated.

(gdb) bt
#0 0x00007f233403de97 in raise () from /lib/x86_64-linux-gnu/libc.so.6
#1 0x00007f233403f801 in abort () from /lib/x86_64-linux-gnu/libc.so.6
#2 0x00007f2334a3ab52 in __gnu_cxx::__verbose_terminate_handler() () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#3 0x00007f2334a38a06 in ?? () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#4 0x00007f2334a38a41 in std::terminate() () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#5 0x00007f2334a38c74 in __cxa_throw () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#6 0x0000563afa5a3f72 in Pistache::Polling::Epoll::rearmFd (this=, fd=, interest=..., tag=..., mode=)
at /root/.conan/data/pistache/2019.05.29/oss/testing/build/aa10c32850b15ef5456122906d38ebd7c80ab68c/source_subdir/src/common/os.cc:187
#7 0x0000563afa5a6f75 in Pistache::Aio::AsyncImpl::dispatchCall<void (Pistache::Aio::SyncImpl::*)(Pistache::Aio::Reactor::Key const&, int, Pistache::Polling::NotifyOn, Pistache::Polling::Tag, Pistache::Polling::Mode), int&, Pistache::Polling::NotifyOn&, Pistache::Polling::Tag&, Pistache::Polling::Mode&> (
func=&virtual Pistache::Aio::SyncImpl::modifyFd(Pistache::Aio::Reactor::Key const&, int, Pistache::Polling::NotifyOn, Pistache::Polling::Tag, Pistache::Polling::Mode), key=..., this=)
at /root/.conan/data/pistache/2019.05.29/oss/testing/build/aa10c32850b15ef5456122906d38ebd7c80ab68c/source_subdir/src/common/reactor.cc:450
#8 Pistache::Aio::AsyncImpl::modifyFd (this=, key=..., fd=70, interest=Pistache::Polling::NotifyOn::Read, tag=...,
mode=Pistache::Polling::Mode::Edge)
at /root/.conan/data/pistache/2019.05.29/oss/testing/build/aa10c32850b15ef5456122906d38ebd7c80ab68c/source_subdir/src/common/reactor.cc:410
#9 0x0000563afa574256 in Pistache::Tcp::Transport::<lambda()>::operator() (__closure=)
at /root/.conan/data/pistache/2019.05.29/oss/testing/build/aa10c32850b15ef5456122906d38ebd7c80ab68c/source_subdir/src/common/transport.cc:229
#10 Pistache::Tcp::Transport::asyncWriteImpl (this=this@entry=0x563afc3196d0, fd=fd@entry=70)
at /root/.conan/data/pistache/2019.05.29/oss/testing/build/aa10c32850b15ef5456122906d38ebd7c80ab68c/source_subdir/src/common/transport.cc:273
#11 0x0000563afa576885 in Pistache::Tcp::Transport::onReady (this=0x563afc3196d0, fds=...)
at /root/.conan/data/pistache/2019.05.29/oss/testing/build/aa10c32850b15ef5456122906d38ebd7c80ab68c/source_subdir/src/common/transport.cc:110
#12 0x0000563afa5a8bcb in Pistache::Aio::SyncImpl::handleFds (events=..., this=0x563c02575600)
at /root/.conan/data/pistache/2019.05.29/oss/testing/build/aa10c32850b15ef5456122906d38ebd7c80ab68c/source_subdir/src/common/reactor.cc:186
#13 Pistache::Aio::SyncImpl::runOnce (this=0x563c02575600)
at /root/.conan/data/pistache/2019.05.29/oss/testing/build/aa10c32850b15ef5456122906d38ebd7c80ab68c/source_subdir/src/common/reactor.cc:148
#14 0x0000563afa5a6a99 in Pistache::Aio::SyncImpl::run (this=)
at /root/.conan/data/pistache/2019.05.29/oss/testing/build/aa10c32850b15ef5456122906d38ebd7c80ab68c/source_subdir/src/common/reactor.cc:159
#15 Pistache::Aio::AsyncImpl::Worker::run()::{lambda()#1}::operator()() const (__closure=)
at /root/.conan/data/pistache/2019.05.29/oss/testing/build/aa10c32850b15ef5456122906d38ebd7c80ab68c/source_subdir/src/common/reactor.cc:468
#16 std::__invoke_impl<void, Pistache::Aio::AsyncImpl::Worker::run()::{lambda()#1}>(std::__invoke_other, Pistache::Aio::AsyncImpl::Worker::run()::{lambda()#1}&&) (__f=...) at /usr/include/c++/7/bits/invoke.h:60
#17 std::__invokePistache::Aio::AsyncImpl::Worker::run()::{lambda()#1}(std::__invoke_result&&, (Pistache::Aio::AsyncImpl::Worker::run()::{lambda()#1}&&)...) (__fn=...) at /usr/include/c++/7/bits/invoke.h:95
#18 std::thread::_Invoker<std::tuplePistache::Aio::AsyncImpl::Worker::run()::{lambda()#1} >::_M_invoke<0ul>(std::_Index_tuple<0ul>) (this=)
at /usr/include/c++/7/thread:234
#19 std::thread::_Invoker<std::tuplePistache::Aio::AsyncImpl::Worker::run()::{lambda()#1} >::operator()() (this=)
at /usr/include/c++/7/thread:243
#20 std::thread::_State_impl<std::thread::_Invoker<std::tuplePistache::Aio::AsyncImpl::Worker::run()::{lambda()#1} > >::_M_run() (this=)
at /usr/include/c++/7/thread:186
#21 0x00007f2334a6357f in ?? () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#22 0x00007f2334d366db in start_thread () from /lib/x86_64-linux-gnu/libpthread.so.0
#23 0x00007f233412088f in clone () from /lib/x86_64-linux-gnu/libc.so.6

@tmustafa
Copy link
Author

tmustafa commented Jun 13, 2019

From the sources, here is where the crash is happening:

void
Epoll::rearmFd(Fd fd, Flags interest, Tag tag, Mode mode) {
struct epoll_event ev;
ev.events = toEpollEvents(interest);
if (mode == Mode::Edge)
ev.events |= EPOLLET;
ev.data.u64 = tag.value_;

    TRY(epoll_ctl(epoll_fd, EPOLL_CTL_MOD, fd, &ev));       <--------***
}

Here are locals:

(gdb) info args
this =
fd =
interest = {val = Pistache::Polling::NotifyOn::Read}
tag =
mode =

(gdb) info locals
str = 0x563afabb0df8 "epoll_ctl(epoll_fd, EPOLL_CTL_MOD, fd, &ev)"
oss =
ret =
ev = {events = 2147483649, data = {ptr = 0x46, fd = 70, u32 = 70, u64 = 70}}

@tmustafa tmustafa changed the title Crash in Pistache while no API was being invoked Crash in Pistache while API was being invoked Jun 13, 2019
@mohsenomidi
Copy link
Contributor

@tmustafa

would you please provide the steps to reproduce this error ?

sample code could be useful

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants