formotion icon indicating copy to clipboard operation
formotion copied to clipboard

"Invalid Reference" crash with anything that uses CheckRow.

Open bwalton opened this issue 10 years ago • 9 comments

I'm seeing crashes in the KitchenSink example with anything that involves CheckRow.

RM 2.26 Formotion 1.7

Compile KitchenSink and tap "Check", "Select One" or "Subforms". All crash with:

(main)> 2014-04-19 09:56:01.014 KitchenSink[2382:90b] kvo.rb:93:in `observeValueForKeyPath:ofObject:change:context:': Invalid Reference - probably recycled (WeakRef::RefError)
    from check_row.rb:34:in `on_select:'
    from base.rb:70:in `_on_select:'
    from form_delegate.rb:95:in `tableView:didSelectRowAtIndexPath:'
2014-04-19 09:56:01.019 KitchenSink[2382:90b] *** Terminating app due to uncaught exception 'WeakRef::RefError', reason: 'kvo.rb:93:in `observeValueForKeyPath:ofObject:change:context:': Invalid Reference - probably recycled (WeakRef::RefError)
    from check_row.rb:34:in `on_select:'
    from base.rb:70:in `_on_select:'
    from form_delegate.rb:95:in `tableView:didSelectRowAtIndexPath:'

bwalton avatar Apr 19 '14 19:04 bwalton

As a workaround/fix, when you compile with ARR_CYCLES_DISABLE=1 it works fine. In fact I remember having to always have that on (even in shipped IPA's) but fixes to RM made it to where it didn't matter.

Is this more of a RM issue?

bwalton avatar Apr 19 '14 20:04 bwalton

Thnx for the workaround. useful.

techogate avatar Apr 29 '14 23:04 techogate

This does seem to be an RM regression, but it's taking some effort to find out exactly what's going wrong. Disabling their retain cycle detector is a good mitigation technique until then, thanks @bwalton!

clayallsopp avatar May 02 '14 17:05 clayallsopp

+1 with this problem too.

robj avatar May 17 '14 03:05 robj

+1

joepestro avatar Jun 25 '14 21:06 joepestro

Any luck in finding the issue?

dsshap avatar Jul 29 '14 21:07 dsshap

@clayallsopp Any progress?

ghost avatar Aug 26 '14 15:08 ghost

Nope, sorry guys :( I did spend a few hours digging into it in April, but I couldn't isolate it or remove it

Until someone else digs into it, I don't think it will be fixed =\

clayallsopp avatar Aug 29 '14 02:08 clayallsopp

I accidentally reproduced this issue in my own app. I think it's caused by adding subviews to cells and then scrolling, whereas you should be adding subviews to the cell's contentView. Once I changed that, I stopped seeing this error and everything began working as expected. Also, before I discovered this fix, the ARR_CYCLES_DISABLE=1 fix also worked for me. This leads me to believe the cause of our issues are probably the same.

pachun avatar Oct 14 '14 17:10 pachun