[TIMOB-24558] iOS: XML unit tests crash for iOS intermittently on build machines
GitHub Issue | n/a |
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Done |
Resolution Date | 2018-02-04T16:10:27.000+0000 |
Affected Version/s | Release 6.0.3 |
Fix Version/s | n/a |
Components | iOS |
Labels | n/a |
Reporter | Christopher Williams |
Assignee | Hans Knöchel |
Created | 2017-04-05T17:51:01.000+0000 |
Updated | 2018-08-06T17:34:48.000+0000 |
Description
Our builds have suddenly started intermittently failing for iOS due to unit test crashes. Specifically, the XML tests are now crashing. Please find attached a number of crash reports from one of the build nodes.
Appears that there's some bad GC/dealloc of xml structures.
Attachments
The crashs are indeed looking like a race-condition. There are some odd
OSSpinLockLock
references that might cause issues. We may need to move those to the GCD pattern, so I'll create a test-case that includes all XML unit-tests to get started.Test-case:
Please include the 14 attached zip files to your test project as well. The tests crash in
xmlNodeListChildren
as seen before, investigating further next week.It turned out that the previous call to
normalize
was causing the issue, leaving the nodes used in the test in an unhandled state. Thenormalize
method is not available on iOS and wasn't ever supposed to work (see docs [here|docs.appcelerator.com/platform/latest/#!/api/Titanium.XML.Node-method-normalize]). I merged [this commit](https://github.com/appcelerator/titanium-mobile-mocha-suite/commit/e0c43e674ab13c788e85f16e9e76524808032dae) into the test-suite to guard iOS with this change. This can also be reproduced by removing the "normalize" test below and run the example again.Reopening to investigate a crash Chris still sees after this fix.
More test-cases (from our current test suite):
I am unable to reproduce it, both my jscore/ticore and kroll-thread/main-thread. *EDIT*: However, as soon as I add the following test again, it crashes with the exact error that is attached to this ticket and can be seen in our suite:
Which makes me wonder if we really always grab the latest version of our mocha-suite that includes [the patch](https://github.com/appcelerator/titanium-mobile-mocha-suite/commit/e0c43e674ab13c788e85f16e9e76524808032dae).
Resolving again, due to no new crashes.
Closed as completed. If this is in error, please reopen.