Crash in folly::future FSM

82 views
Skip to first unread message

sanj...@gmail.com

unread,
Apr 20, 2016, 4:22:31 AM4/20/16
to Folly: the Facebook Open-source LibrarY

Hi,

I am seeing intermittent crashes while fulfilling a folly::Promise between 2 threads
The program ties different threads to different cores and the promise fulfiller is on a different core than the one waiting.
This is happening on 2 different machines (one 16 core, one 32 core).
The failure occurs when running on 4 or more cores.
The machines run Linux 4.2 on Ubuntu 14.04.
Folly version is as of Feb 6 (sorry, don't have exact git tag because I built off the downloaded zip file)

Has this problem been seen before ?

Stack is as follows

#7  0x000000000052954a in folly::MicroSpinLock::unlock() ()
#8  0x00007ffff78944bc in
folly::detail::FSM<folly::detail::State>::updateState<folly::detail::Core<int>::setResult(folly::Try<int>&&)::{lambda()#1}>(folly::detail::State,
folly::detail::State,
folly::detail::Core<int>::setResult(folly::Try<int>&&)::{lambda()#1} const&) (
    this=0x25b8068, A=folly::detail::Start, B=folly::detail::OnlyResult,
action=...)
    at /usr/local/include/folly/futures/detail/FSM.h:64
#9  0x00007ffff789066e in
folly::detail::FSM<folly::detail::State>::updateState<folly::detail::Core<int>::setResult(folly::Try<int>&&)::{lambda()#1},
folly::detail::Core<int>::setResult(folly::Try<int>&&)::{lambda()#2}>(folly::detail::State,
folly::detail::State,
folly::detail::Core<int>::setResult(folly::Try<int>&&)::{lambda()#1} const&,
folly::detail::Core<int>::setResult(folly::Try<int>&&)::{lambda()#2} const&)
(this=0x25b8068, A=folly::detail::Start,
    B=folly::detail::OnlyResult, protectedAction=..., unprotectedAction=...)
at /usr/local/include/folly/futures/detail/FSM.h:98

#10 0x00007ffff788c158 in folly::detail::Core<int>::setResult(folly::Try<int>&&)
(
    this=0x25b8000,
    t=<unknown type in /home/sandeep/lib/libs.so, CU 0x0, DIE
0x8b533>)
    at /usr/local/include/folly/futures/detail/Core.h:188
---Type <return> to continue, or q <return> to quit---
#11 0x00007ffff788fdc9 in folly::Promise<int>::setTry(folly::Try<int>&&)
(this=0x25ed150,
    t=<unknown type in /home/sandeep/lib/libsample.so, CU 0x0, DIE
0x8e6e1>)
    at /usr/local/include/folly/futures/Promise-inl.h:117
#12 0x00007ffff78d989d in folly::Promise<int>::setValue<int&> (this=0x25ed150,
    v=@0x25ed148: -33) at /usr/local/include/folly/futures/Promise-inl.h:126
#13 0x00007ffff78d5021 in MyClass::reset (this=0x25ed110)

The state of the promise in gdb
> p promise_
$10 = {retrieved_ = true, core_ = 0x25b8000}

The state of the core_ object inside the promise

$2 = {
  callback_ =
{<folly::detail::function::FunctionTypeTraits<void(folly::Try<int>&&)>::InvokeOperator<folly::Function<void(folly::Try<int>&&),
(folly::FunctionMoveCtor)1, 64ul> >> = {<No data fields>},
<folly::detail::function::MaybeUnaryOrBinaryFunctionImpl<void,
std::tuple<folly::Try<int>&&> >> = {<std::unary_function<folly::Try<int>&&,
void>> = {<No data fields>}, <No data fields>}, data_ = {
      __data =
"h\370\272\367\377\177\000\000\330\067\211\367\377\177\000\000\340\200\277\354\377\177\000\000",
'v' <repeats 56 times>, __align = {<No data fields>}},
    static kStorageSize = <optimized out>}, result_ = {storage_ = {{value = {
          contains_ = folly::Try<int>::VALUE, {value_ = 0,
            e_ = std::unique_ptr<folly::exception_wrapper> containing
0x7676767600000000}}},
      hasValue = false}}, fsm_ = {mutex_ = {lock_ = 0 '\000'}, state_ = {
      static _S_min_alignment = 1, static _S_alignment = 1, _M_i =
folly::detail::Start}},
  attached_ = {<std::__atomic_base<unsigned char>> = {static _S_alignment = 1,
      _M_i = 2 '\002'}, <No data fields>}, active_ = {_M_base = {static
_S_alignment = 1,
      _M_i = true}}, interruptHandlerSet_ = {_M_base = {static _S_alignment = 1,
      _M_i = false}}, interruptLock_ = {lock_ = 0 '\000'}, executorLock_ =
{lock_ = 0 '\000'},
  priority_ = -1 '\377', executor_ = 0x0, context_ = std::shared_ptr (empty)
0x0,
  interrupt_ = std::unique_ptr<folly::exception_wrapper> containing 0x0,
  interruptHandler_ = {<std::_Maybe_unary_or_binary_function<void,
folly::exception_wrapper const&>> =
{<std::unary_function<folly::exception_wrapper const&, void>> = {<No data
fields>}, <No data fields>}, <std::_Function_base> = {static _M_max_size = 16,
static _M_max_align = 8,
      _M_functor = {_M_unused = {_M_object = 0x7676767676767676,
          _M_const_object = 0x7676767676767676, _M_function_pointer =
0x7676767676767676,
          _M_member_pointer = (void
(std::_Undefined_class::*)(std::_Undefined_class * const)) 0x7676767676767676,
this adjustment 8536140394893047414},
        _M_pod_data = 'v' <repeats 16 times>}, _M_manager = 0x0},
    _M_invoker = 0x7676767676767676}}

-Sandeep


-Sandeep
Reply all
Reply to author
Forward
0 new messages