Segmentation fault on EventHttpRequest->free()
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)
-
repo owner -
repo owner - changed status to resolved
-
Impressed with prompt reply :) will try Monday. Thanx.
-
works! no memory leaks, not SegFault.
-
repo owner Issue
#4was marked as a duplicate of this issue. - Log in to comment
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 theEventHttpRequest::free()
method. It so happens that Libevent handles memory all right.I'll wait for your reply.