Comments (4)
Pretty sure the request should be freed automatically after the http_request_done has finished executing since you didn't use evhttp_request_own to take ownership of the request object so it results in a double free.
If you could paste a dump of the segfault information it may be helpful.
from libevent.
Thanks John for the quick reply. I would like to see "http_request_done" call back to free request object automatically. However, I see the TCP session is still there after the call back - which I wish to be closed.
Program received signal SIGSEGV, Segmentation fault.
0x00007ffff7bb9fd7 in evhttp_clear_headers () from /usr/lib/libevent-2.0.so.5
(gdb) bt
#0 0x00007ffff7bb9fd7 in evhttp_clear_headers ()
from /usr/lib/libevent-2.0.so.5
#1 0x00007ffff7bbbe9e in evhttp_request_free ()
from /usr/lib/libevent-2.0.so.5
#2 0x00007ffff7bbd96d in ?? () from /usr/lib/libevent-2.0.so.5
#3 0x00007ffff7bbdaa8 in ?? () from /usr/lib/libevent-2.0.so.5
#4 0x00007ffff7bade2d in ?? () from /usr/lib/libevent-2.0.so.5
#5 0x00007ffff7ba394c in event_base_loop () from /usr/lib/libevent-2.0.so.5
#6 0x00000000004015db in main (argc=3, argv=0x7fffffffe678)
at libEventAgent.c:136
from libevent.
John, you are right.
I used a debugger and found that even when I removed the call to "evhttp_request_free()", this function is still called.
But my test (wireshark sniffer) shows that the connection for the http request was not closed. Any idea how to close it? Thanks.
from libevent.
Better close this issue and open a new one. Thanks John.
from libevent.
Related Issues (20)
- Warnings reported by Infer HOT 2
- Bug in make_ws_frame (ws.c), bug in get_ws_frame (ws.c) HOT 1
- Suggest hash-pin GitHub Actions with sensitive permissions and a Dependency-Update-Tool HOT 5
- Which version is currently most suitable for libevent? HOT 2
- How to get the reqeust queue length of one evhttp_connection? HOT 1
- libevent debugging HOT 1
- [bug] Event activated by event_active on another thread may loss while event timeout HOT 4
- clang: error: linker command failed with exit code 1 (use -v to see invocation) make[1]: *** [sample/le-proxy] Error 1 HOT 1
- Fix MbedTLS and ZLIB for windows on CI HOT 1
- May bug in evhttp_connection_free_on_completion when the evhttp_connection fail to connect HOT 2
- Security advisory link is broken HOT 2
- find_dependency for MBedTLS failed for LibeventConfig.cmake HOT 1
- Test Failure and Warnings in http/bad_request under SELECT Event Mechanism on Raspberry Pi HOT 2
- install DESTINATIONs inconsistent.
- How to implement a websocket client? HOT 6
- bufferevent_write does not immediately write data to the socket HOT 4
- Use checksec to scan the libevent_pthreads-2.1.so.7.0.1 file FORTIFY item is 'No' HOT 5
- How to deal with bufferevent pointer when used externally? HOT 5
- Upgrading libevent based TCP server implementation from commit id 665d79f1 to ec8d7a5a results in random crashes HOT 5
- evbuffer use after free HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from libevent.