Prevent possible leaks#169
Conversation
|
3 out of 4 builds in the matrix failed because Travis couldn't |
|
All build passed now that Github is accessible. |
|
Thanks. I will test tomorrow with the load tester. Now that it's not crashing anymore, I'm seeing some nice memory leaks and (possibly) hanging threads. That is, before applying this patch. |
|
I'm running this patch and your refactor patch and the load tester is behaving a bit weird... it seems that one of the HTTP call raises an exception. When I print it, I only get the empty string ''. Of course, the request does not seem to fire. I will investigate further tomorrow. |
There was a problem hiding this comment.
Shouldn't we have a DEBUG log here? Or is an interrupted system call something that happens regularly?
There was a problem hiding this comment.
It should happen a lot when a gateway is not in use.
There was a problem hiding this comment.
No, I don't think so. The timeout argument to select is NULL:
If timeout is NULL (no time‐out), select() can block indefinitely.
The load tester runs fine until, at some point, I am seeing a lot of bad (empty) HTTP status lines which possibly come from somewhere in that code path. I added a debug print and the bad status lines and webServr->lastError == -1 do coincide.
|
Ah, I think the problem happens because server->lastError is never reset. This way, the code always takes the error handling path even if the request was actually succesfull. |
In some error scenarios, HTTP
requestobjects could not have been freed.Prompted by
valgrindresults from #34