Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-28413] iOS: intermittent crash on TableView INSET_GROUPED test

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2021-04-29T16:58:39.000+0000
Affected Version/sRelease 10.0.0
Fix Version/sRelease 10.0.0
ComponentsiOS
Labelsn/a
ReporterChristopher Williams
AssigneeVijay Singh
Created2021-04-05T14:31:27.000+0000
Updated2021-04-29T16:58:39.000+0000

Description

Our unit test suite is crashing frequently after the addition of the TableView.INSET_GROUPED test. It's crashing on iPhone, iPad, and macOS. Here is the test in question: https://github.com/appcelerator/titanium_mobile/blob/master/tests/Resources/ti.ui.tableview.test.js#L1786-L1815

Attachments

FileDateSize
mocha_2021-03-31-070518_macos-lepew.crash2021-04-05T14:35:48.000+0000190836
mocha_2021-03-31-090948_macos-eve.crash2021-04-05T14:34:52.000+0000190923

Comments

  1. Hans Knöchel 2021-04-07

    Looks like a threading issue. Here is the line causing the crash:
       - (void)updateRow:(TiUITableViewAction *)action
       {
         OSAtomicTestAndClearBarrier(NEEDS_UPDATE_ROW, &dirtyRowFlags);
         [table dispatchAction:action];
       }
       
    I never used OSAtomicTestAndClearBarrier, but there must be a better solution
  2. Joshua Quick 2021-04-08

    Segfaults are typically caused by using a null/nil pointer or wild pointer. The table member variable in the updateRow() method is missing a nil check like the rest of the code. So, we probably just need to do this...
       - (void)updateRow:(TiUITableViewAction *)action
       {
         if (table != nil) {
           OSAtomicTestAndClearBarrier(NEEDS_UPDATE_ROW, &dirtyRowFlags);
           [table dispatchAction:action];
         }
       }
       
  3. Vijay Singh 2021-04-08

    In objective c, passing message to nil (calling method on an object which is nil) is valid. It'll do nothing and not even crash.
  4. Vijay Singh 2021-04-08

    PR - https://github.com/appcelerator/titanium_mobile/pull/12706
  5. Christopher Williams 2021-04-29

    merged to master and 10_0_X branch (post-RC, but pre-GA) for target 10.0.0 release.

JSON Source