Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-18724] Windows::HTTPClient crashes on firing onreadystatechange after being GCed

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2015-03-25T09:58:42.000+0000
Affected Version/sn/a
Fix Version/sRelease 4.1.0
ComponentsWindows
Labelsn/a
ReporterChristopher Williams
AssigneeChristopher Williams
Created2015-03-20T15:01:56.000+0000
Updated2017-03-16T22:25:21.000+0000

Description

When running the mocha tests, I'm seeing some bad behavior from HTTPclient. We fire off requests in tests and continue on and eventually in a a later test (typically the layout suite) we'll get an error stemming from the HTTPClient firing an onreadystatechange callback:
Unhandled exception at 0x6B83D4C6 (HAL.dll) in NMocha.exe: 0xC0000005: Access violation reading location 0xDDDDDDDD.
It's in HTTPClient::onreadystatechange in Titaniumkit, where it's testing if the callback is a function. The issue is likely because we've long moved on from the test where the httpclient was generated - I'm thinking maybe it was GCed and we didn't properly cancel and clean up in our destructor. The request was continuing in an async chain. My best guess is that we need to cancel all outstanding requests when the Windows impl desturctor hits, and null out the callback objects up in the TitaniumKit destructor?

Comments

  1. Kota Iguchi 2015-03-23

    https://github.com/appcelerator/titanium_mobile_windows/pull/181
  2. Christopher Williams 2015-03-23

    Still seeing this locally when running the full mocha tests suite.
  3. Lee Morris 2017-03-16

    Closing ticket as fixed.

JSON Source