Skip to content

Segmentation fault when concurrent requests arrives. #28

Description

@hmonfared

with a single connection and many requests, there is no problem.
but I send multiply requests concurrently, segmentation fault occurs ( line 336 in http.h ).

how to produce the error :

ab -k -n 50000 -c 100 -t 20 http://localhost:8080/
This is ApacheBench, Version 2.3 <$Revision: 1430300 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking localhost (be patient)
apr_socket_recv: Connection reset by peer (104)
Total of 14 requests completed

full Stack trace from gdb :

(gdb) bt full
#0 0x00000000004089a7 in native::http::client_context::~client_context()::{lambda()#1}::operator()() const () at ./native/http.h:336

    std::__ioinit = {static _S_refcount = <optimized out>, 
      static _S_synced_with_stdio = <optimized out>}

#1 0x000000000040c473 in std::_Function_handler<void (), native::http::client_context::~client_context()::{lambda()#1}>::_M_invoke(std::_Any_data const&) (

__functor=...) at /usr/include/c++/4.8/functional:2071

No locals.
#2 0x000000000040d112 in std::function<void ()>::operator()() const (

this=0x642750) at /usr/include/c++/4.8/functional:2464

No locals.
#3 0x000000000040b60a in native::internal::callback_object<std::function<void ()> >::invoke<>() (this=0x642740) at ./native/callback.h:46

No locals.
#4 0x00000000004098ef in native::callbacks::invoke<std::function<void ()>>(void*, int) (target=0x642550, cid=0) at ./native/callback.h:84

    __PRETTY_FUNCTION__ = "static typename std::result_of<_Functor(_ArgTypes ...)>::type native::callbacks::invoke(void*, int, A&& ...) [with callback_t = std::function<void()>; A = {}; typename std::result_of<_Functor(_ArgType"...
    x = 0x642740

#5 0x00000000004067db in native::base::handle::close(std::function<void ()>)::{lambda(uv_handle_s_)#1}::operator()(uv_handle_s_) const (__closure=0x0,

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions