Closed traw closed 7 years ago
Hi, thanks for the bug report - I'll try to reproduce the issue on my end.
You can reproduce it with command I have given.
I have coredump but can't attach it here
If we remove assert at 68th line in parser.cpp. Then we can resolve it. But don't know the purpose of assert there.
I've just updated the core, please let me know if it fixes your issue.
I'm actually working on adding support for SO_REUSEPORT
for multicore socket load balancing at the kernel level on linux >= 3.9 which will speed up benchmarks considerably.
The assertion was there in error ... since the parser instance wasn't initialised yet the data
value was undefined causing unpredictable results
Example command:
./httpechoserverd
Test Command:wrk -t12 -c400 -d30s http://127.0.0.1:1337/index.html
Stack Strace:`#0 0x00007ffff66d0428 in __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:54
1 0x00007ffff66d202a in __GI_abort () at abort.c:89
2 0x00007ffff66c8bd7 in __assert_fail_base (fmt=, assertion=assertion@entry=0x5d8213 "_parser.data != this",
3 0x00007ffff66c8c82 in __GI___assert_fail (assertion=0x5d8213 "_parser.data != this", file=0x5d81d8 "/mnt/repos/cctv/sourcey/libsourcey/src/http/src/parser.cpp",
4 0x0000000000573188 in scy::http::Parser::init (this=0x875ea8, type=HTTP_REQUEST) at /mnt/repos/cctv/sourcey/libsourcey/src/http/src/parser.cpp:68
5 0x0000000000572f09 in scy::http::Parser::Parser (this=0x875ea8, type=HTTP_REQUEST) at /mnt/repos/cctv/sourcey/libsourcey/src/http/src/parser.cpp:53
6 0x000000000056d05c in scy::http::ConnectionAdapter::ConnectionAdapter (this=0x875d40, connection=..., type=HTTP_REQUEST)
7 0x000000000055ac80 in scy::http::ServerAdapter::ServerAdapter (this=0x875d40, connection=...)
8 0x000000000055c701 in scy::http::ServerConnection::ServerConnection (this=0x549a9eb0, server=..., socket=std::shared_ptr (count 8724656, weak -1) 0x7fffffffa6e0)
9 0x000000000055ba4b in scy::http::Server::createConnection (this=0x7fffffffdc20, sock=std::shared_ptr (count 4, weak 0) 0x853920)
10 0x000000000055c0e1 in scy::http::Server::onSocketAccept (this=0x7fffffffdc20, sock=std::shared_ptr (count 4, weak 0) 0x853860)
11 0x00000000005694eb in scy::ClassDelegate<scy::http::Server, void, std::shared_ptr const&>::operator() (this=0x855450,
12 0x00000000005b5dfc in scy::Signal<void (std::shared_ptr const&)>::emit(std::shared_ptr const&) (this=0x8522c8,
13 0x00000000005b4a71 in scy::net::TCPSocket::acceptConnection (this=0x8520b0) at /mnt/repos/cctv/sourcey/libsourcey/src/net/src/tcpsocket.cpp:183
14 0x00000000005b5518 in scy::net::TCPSocket::onAcceptConnection (this=0x8520b0, status=0) at /mnt/repos/cctv/sourcey/libsourcey/src/net/src/tcpsocket.cpp:309
15 0x00000000005b3860 in scy::net::internal::onAcceptConnection (handle=0x852330, status=0) at /mnt/repos/cctv/sourcey/libsourcey/src/net/src/tcpsocket.cpp:58
16 0x000000000059262d in uv__server_io (loop=0x81eca0, w=0x8523b8, events=1)
17 0x0000000000599bd9 in uv__io_poll (loop=0x81eca0, timeout=2400) at /mnt/repos/cctv/sourcey/libsourcey/vendor/libuv/src/unix/linux-core.c:365
18 0x00000000005852eb in uv_run (loop=0x81eca0, mode=UV_RUN_DEFAULT) at /mnt/repos/cctv/sourcey/libsourcey/vendor/libuv/src/unix/core.c:351
19 0x000000000052efa1 in scy::uv::waitForShutdown(std::function<void (void)>, void, uv_loop_s*) (callback=..., opaque=0x7fffffffdc20,
20 0x0000000000531936 in main (argc=1, argv=0x7fffffffddb8) at /mnt/repos/cctv/sourcey/libsourcey/src/http/samples/httpechoserver/httpechoserver.cpp:29
`