You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the same unit test,
VERIFY_ARE_EQUAL(S_OK, HCHttpCallCloseHandle(call));
HCCleanup();
are both called but inside HCCleanup is where the http_singleton is destroyed
I believe the issue might have been originating from the use of 2 httpcalls in the example. One to setup the fake response and 1 to setup the actual call.
Since we had written our own thread scheduler to consume the task. We recently started some seeing unusual results.
I started with a ExampleSingleGenericMock from https://github.com/Microsoft/libHttpClient/blob/master/Tests/UnitTests/Tests/MockTests.cpp
In the same unit test,
VERIFY_ARE_EQUAL(S_OK, HCHttpCallCloseHandle(call));
HCCleanup();
are both called but inside HCCleanup is where the http_singleton is destroyed
https://github.com/Microsoft/libHttpClient/blob/e7726a89b99b715287469e2651b9b7bff9692797/Source/Global/global.cpp#L45
HCHttpCallCloseHandle(mockCall); is called on all the mock calls.
So HCHttpCallCloseHandle is being called both by the unit test AND in the httpsingleton cleanup.
This caused some unusual behavior.
We ultimately were hitting this assert. Since it had been free'd earlier, it now contained garbage data (e.g. if (refCount was equal to like -2384234)
https://github.com/Microsoft/libHttpClient/blob/1d749c20bd522d056f339e18b01d8df70e132482/Source/HTTP/httpcall.cpp#L84
Proposed solutions:
Let me know if you need additional information and clarity.
The text was updated successfully, but these errors were encountered: