Issue #3 resolved

Segmentation fault on EventHttpRequest->free()

Anonymous created an issue

Got Segmentation fault (double free or corruption (!prev):) trying to free http request object if both http client and http server run on the same machine. Does not matter if server and client running in single process or different.

After some debugging and googling found http://stackoverflow.com/questions/2902064/how-to-track-down-a-double-free-or-corruption-error-in-c-with-gdb So I guess httpRequest object in sever and client internally use the same memory segments, and if server free httpRequest early then client, client try to unset already destructed object. But this is just my guess. If client does not free httpRequest we get uncontrolled memory usage. To show this, run test script.

Comments (5)

  1. Ruslan Osmanov repo owner

    Thanks for your report.

    I've just pushed a fix. Please check it out.

    Honestly, I doubt if the fix is correct. I've merely dropped the evhttp_request_free() call in the EventHttpRequest::free() method. It so happens that Libevent handles memory all right.

    I'll wait for your reply.

  2. Log in to comment