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

seastar : semaphore's signal / memcpy crashed #11

Closed
iwanbk opened this issue Mar 7, 2017 · 2 comments
Closed

seastar : semaphore's signal / memcpy crashed #11

iwanbk opened this issue Mar 7, 2017 · 2 comments
Assignees
Labels

Comments

@iwanbk
Copy link
Member

iwanbk commented Mar 7, 2017

from gdb backtrace, semaphore's signal and memcpy are failed.

corresponding line of code
main.c 483 : gSem[volID]->signal();

main.c 442 is in addPacket

 return in.read_exactly(BUF_SIZE).then( [this, &out] (temporary_buffer<char> buf) {
                  if (buf) {
                      uint8_t *packet = (uint8_t *) malloc(buf.size());
                      memcpy(packet, buf.get(), buf.size());
                      addPacket(packet);
                      return make_ready_future<stop_iteration>(stop_iteration::no);
                  } else {
                      return make_ready_future<stop_iteration>(stop_iteration::yes);
                  }
              });
main: core/future.hh:335: void future_state<>::set(): Assertion `_u.st == state::future' failed.
flushing...
[New Thread 0x7fffed980700 (LWP 1905)]

Thread 2 "main" received signal SIGABRT, Aborted.
[Switching to Thread 0x7fffef7ff700 (LWP 1896)]
0x00007ffff322d428 in __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:54
54	../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) backtrace
#0  0x00007ffff322d428 in __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:54
#1  0x00007ffff322f02a in __GI_abort () at abort.c:89
#2  0x00007ffff3225bd7 in __assert_fail_base (fmt=<optimized out>, 
    assertion=assertion@entry=0x7417d6 "_u.st == state::future", 
    file=file@entry=0x768db4 "core/future.hh", line=line@entry=335, 
    function=function@entry=0x751470 <_ZZN12future_stateIJEE3setEvE19__PRETTY_FUNCTION__> "void future_state<>::set()") at assert.c:92
#3  0x00007ffff3225c82 in __GI___assert_fail (
    assertion=assertion@entry=0x7417d6 "_u.st == state::future", 
    file=file@entry=0x768db4 "core/future.hh", line=line@entry=335, 
    function=function@entry=0x751470 <_ZZN12future_stateIJEE3setEvE19__PRETTY_FUNCTION__> "void future_state<>::set()") at assert.c:101
#4  0x0000000000491ff5 in future_state<>::set() (this=<optimized out>) at core/future.hh:335
#5  promise<>::set_value<>() (this=<optimized out>) at core/future.hh:470
#6  0x000000000071ec92 in basic_semaphore<semaphore_default_exception_factory, std::chrono::_V2::steady_clock>::signal (this=0x6000001142d0, nr=1) at /root/seastar-dpdk/core/semaphore.hh:199
#7  0x000000000073c567 in basic_semaphore<semaphore_default_exception_factory, std::chrono::_V2::steady_clock>::signal (nr=1, this=<optimized out>) at /usr/include/c++/5/bits/stl_tree.h:1627
#8  tlog::tcp_server::addPacket (this=0x6010006cbeb0, packet=<optimized out>) at main.cc:483
#9  0x000000000073caad in tlog::tcp_server::handle(input_stream<char>&, output_stream<char>&)::{lambda()#1}::operator()() const::{lambda(temporary_buffer<char>)#1}::operator()(temporary_buffer) const (__closure=0x7fffef7fd540, 
    buf=<error reading variable: access outside bounds of object referenced via synthetic pointer>) at main.cc:442
#10 apply_helper<tlog::tcp_server::handle(input_stream<char>&, output_stream<char>&)::{lambda()#1}::operator()() const::{lambda(temporary_buffer<char>)#1}, std::tuple<temporary_buffer>&&, std::integer_sequence<unsigned long, 0ul> >::apply(temporary_buffer<char>&&, std::tuple) (
    args=<optimized out>, 
    func=<unknown type in /root/code/tlog/seastar/main, CU 0x26fec60, DIE 0x28dbebe>)
    at /root/seastar-dpdk/core/apply.hh:34
#11 apply<tlog::tcp_server::handle(input_stream<char>&, output_stream<char>&)::{lambda()#1}::operator()() const::{lambda(temporary_buffer<char>)#1}, temporary_buffer>(tlog::tcp_server::handle(input_stream<char>&, output_stream<char>&)::{lambda()#1}::operator()() const::{lambda(temporary_buffer<char>)#1}&&, std::tuple<temporary_buffer>&&) (args=<optimized out>, 
    func=<optimized out>) at /root/seastar-dpdk/core/apply.hh:42
#12 futurize<future<bool_class<stop_iteration_tag> > >::apply<tlog::tcp_server::handle(input_stream<char>&, output_stream<char>&)::{lambda()#1}::operator()() const::{lambda(temporary_buffer<char>)#1}, temporary_buffer>(tlog::tcp_server::handle(input_stream<char>&, output_stream<char>&)::{lambda()#1}::operator()() const::{lambda(temporary_buffer<char>)#1}&&, std::tuple<temporary_buffer>&&) (func=<unknown type in /root/code/tlog/seastar/main, CU 0x26fec60, DIE 0x28dbe75>, 
    args=<optimized out>) at /root/seastar-dpdk/core/future.hh:1267
#13 0x000000000073cd75 in future<temporary_buffer<char> >::then<tlog::tcp_server::handle(input_stream<char>&, output_stream<char>&)::{lambda()#1}::operator()() const::{lambda(temporary_buffer<char>)#1}, future<bool_class<stop_iteration_tag> > >(tlog::tcp_server::handle(input_stream<char>&, output_stream<char>&)::{lambda()#1}::operator()() const::{lambda(temporary_buffer<char>)#1}&&) (this=this@entry=0x7fffef7fd5c0, 
    func=func@entry=<unknown type in /root/code/tlog/seastar/main, CU 0x26fec60, DIE 0x28dc4a9>) at /root/seastar-dpdk/core/future.hh:862
#14 0x000000000071a27e in tlog::tcp_server::handle(input_stream<char>&, output_stream<char>&)::{lambda()#1}::operator()() const (__closure=0x601000036f38) at main.cc:448
#15 futurize<future<bool_class<stop_iteration_tag> > >::apply<tlog::tcp_server::handle(input_stream<char>&, output_stream<char>&)::{lambda()#1}&>(tlog::tcp_server::handle(input_stream<char>&, output_stream<char>&)::{lambda()#1}&) (func=...) at /root/seastar-dpdk/core/future.hh:1277
#16 repeat<tlog::tcp_server::handle(input_stream<char>&, output_stream<char>&)::<lambda()> >(<unknown type in /root/code/tlog/seastar/main, CU 0x26fec60, DIE 0x28dd477>) (
    action=action@entry=<unknown type in /root/code/tlog/seastar/main, CU 0x26fec60, DIE 0x28dd4---Type <return> to continue, or q <return> to quit---
@iwanbk iwanbk added the type_bug label Mar 7, 2017
@iwanbk iwanbk self-assigned this Mar 7, 2017
@iwanbk iwanbk changed the title seastar : semaphore's signal crashed seastar : semaphore's signal / memcpy crashed Mar 7, 2017
@iwanbk
Copy link
Member Author

iwanbk commented Mar 8, 2017

with 4da41c6 and 9510914, the crashed only happens in multi core setup

@iwanbk
Copy link
Member Author

iwanbk commented Mar 13, 2017

doesn't happen anymore, it seems because previous memory leak (fixed in d65145a) and locking issue

@iwanbk iwanbk closed this as completed Mar 13, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant