alexrothenberg / motion-addressbook

MIT License
89 stars 30 forks source link

AddressBook::Person.all causes crash in 1.1.0 #22

Closed wink closed 11 years ago

wink commented 11 years ago

Steps to reproduce using 1.1.0 in Gemfile (latest from master branch):

1) rake 2) run AddressBook::Person.all in console 3) observe crash

(main)> AddressBook::Person.all *\ simulator session ended with error: Error Domain=DTiPhoneSimulatorErrorDomain Code=1 "The simulated application quit." UserInfo=0x101d02860 {NSLocalizedDescription=The simulated application quit., DTiPhoneSimulatorUnderlyingErrorCodeKey=-1} rake aborted! Command failed with status (1): [DYLD_FRAMEWORK_PATH="/Applications/Xcode.a...] /Users/wink/.rvm/gems/ruby-1.9.3-p194@kollekt/gems/rake-10.0.3/lib/rake/file_utils.rb:53:in block in create_shell_runner' /Users/wink/.rvm/gems/ruby-1.9.3-p194@kollekt/gems/rake-10.0.3/lib/rake/file_utils.rb:45:incall' /Users/wink/.rvm/gems/ruby-1.9.3-p194@kollekt/gems/rake-10.0.3/lib/rake/file_utils.rb:45:in sh' /Users/wink/.rvm/gems/ruby-1.9.3-p194@kollekt/gems/rake-10.0.3/lib/rake/file_utils_ext.rb:40:insh' /Library/RubyMotion/lib/motion/project.rb:102:in block in <top (required)>' /Users/wink/.rvm/gems/ruby-1.9.3-p194@kollekt/gems/rake-10.0.3/lib/rake/task.rb:228:incall' /Users/wink/.rvm/gems/ruby-1.9.3-p194@kollekt/gems/rake-10.0.3/lib/rake/task.rb:228:in block in execute' /Users/wink/.rvm/gems/ruby-1.9.3-p194@kollekt/gems/rake-10.0.3/lib/rake/task.rb:223:ineach' /Users/wink/.rvm/gems/ruby-1.9.3-p194@kollekt/gems/rake-10.0.3/lib/rake/task.rb:223:in execute' /Users/wink/.rvm/gems/ruby-1.9.3-p194@kollekt/gems/rake-10.0.3/lib/rake/task.rb:166:inblock in invoke_with_call_chain' /Users/wink/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/monitor.rb:211:in mon_synchronize' /Users/wink/.rvm/gems/ruby-1.9.3-p194@kollekt/gems/rake-10.0.3/lib/rake/task.rb:159:ininvoke_with_call_chain' /Users/wink/.rvm/gems/ruby-1.9.3-p194@kollekt/gems/rake-10.0.3/lib/rake/task.rb:187:in block in invoke_prerequisites' /Users/wink/.rvm/gems/ruby-1.9.3-p194@kollekt/gems/rake-10.0.3/lib/rake/task.rb:185:ineach' /Users/wink/.rvm/gems/ruby-1.9.3-p194@kollekt/gems/rake-10.0.3/lib/rake/task.rb:185:in invoke_prerequisites' /Users/wink/.rvm/gems/ruby-1.9.3-p194@kollekt/gems/rake-10.0.3/lib/rake/task.rb:165:inblock in invoke_with_call_chain' /Users/wink/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/monitor.rb:211:in mon_synchronize' /Users/wink/.rvm/gems/ruby-1.9.3-p194@kollekt/gems/rake-10.0.3/lib/rake/task.rb:159:ininvoke_with_call_chain' /Users/wink/.rvm/gems/ruby-1.9.3-p194@kollekt/gems/rake-10.0.3/lib/rake/task.rb:152:in invoke' /Users/wink/.rvm/gems/ruby-1.9.3-p194@kollekt/gems/rake-10.0.3/lib/rake/application.rb:143:ininvoke_task' /Users/wink/.rvm/gems/ruby-1.9.3-p194@kollekt/gems/rake-10.0.3/lib/rake/application.rb:101:in block (2 levels) in top_level' /Users/wink/.rvm/gems/ruby-1.9.3-p194@kollekt/gems/rake-10.0.3/lib/rake/application.rb:101:ineach' /Users/wink/.rvm/gems/ruby-1.9.3-p194@kollekt/gems/rake-10.0.3/lib/rake/application.rb:101:in block in top_level' /Users/wink/.rvm/gems/ruby-1.9.3-p194@kollekt/gems/rake-10.0.3/lib/rake/application.rb:110:inrun_with_threads' /Users/wink/.rvm/gems/ruby-1.9.3-p194@kollekt/gems/rake-10.0.3/lib/rake/application.rb:95:in top_level' /Users/wink/.rvm/gems/ruby-1.9.3-p194@kollekt/gems/rake-10.0.3/lib/rake/application.rb:73:inblock in run' /Users/wink/.rvm/gems/ruby-1.9.3-p194@kollekt/gems/rake-10.0.3/lib/rake/application.rb:160:in standard_exception_handling' /Users/wink/.rvm/gems/ruby-1.9.3-p194@kollekt/gems/rake-10.0.3/lib/rake/application.rb:70:inrun' /Users/wink/.rvm/gems/ruby-1.9.3-p194@kollekt/gems/rake-10.0.3/bin/rake:33:in <top (required)>' /Users/wink/.rvm/gems/ruby-1.9.3-p194@kollekt/bin/rake:19:inload' /Users/wink/.rvm/gems/ruby-1.9.3-p194@kollekt/bin/rake:19:in <main>' /Users/wink/.rvm/gems/ruby-1.9.3-p194@kollekt/bin/ruby_noexec_wrapper:14:ineval' /Users/wink/.rvm/gems/ruby-1.9.3-p194@kollekt/bin/ruby_noexec_wrapper:14:in `

'

jmay commented 11 years ago

@wink, is the test suite (rake spec) running cleanly for you? I can't reproduce this error.

wink commented 11 years ago

Yes it is. I'm not sure what's going on. Ill try to take a deeper look tonight.

On Wednesday, March 27, 2013, Jason May wrote:

@wink https://github.com/wink, is the test suite (rake spec) running cleanly for you? I can't reproduce this error.

— Reply to this email directly or view it on GitHubhttps://github.com/alexrothenberg/motion-addressbook/issues/22#issuecomment-15532017 .

alexrothenberg commented 11 years ago

Thanks for looking into this @jmay.

I'm at the rubymotion inspect conference this week and will not have time to look at this until next week.

On Wed, Mar 27, 2013 at 12:21 PM, Micah Winkelspecht < notifications@github.com> wrote:

Yes it is. I'm not sure what's going on. Ill try to take a deeper look tonight.

On Wednesday, March 27, 2013, Jason May wrote:

@wink https://github.com/wink, is the test suite (rake spec) running cleanly for you? I can't reproduce this error.

— Reply to this email directly or view it on GitHub< https://github.com/alexrothenberg/motion-addressbook/issues/22#issuecomment-15532017>

.

— Reply to this email directly or view it on GitHubhttps://github.com/alexrothenberg/motion-addressbook/issues/22#issuecomment-15533695 .

jmay commented 11 years ago

@wink: Do you have any contacts in the AB when you get this error? You can also try my fork jmay/rubymotion_addressbook and see if the same issue exists there.

wink commented 11 years ago

Yes, I do have the default simulator contacts in the AB. I will try your fork tonight.

On Wed, Mar 27, 2013 at 2:02 PM, Jason May notifications@github.com wrote:

@wink https://github.com/wink: Do you have any contacts in the AB when you get this error? You can also try my fork jmay/rubymotion_addressbook and see if the same issue exists there.

— Reply to this email directly or view it on GitHubhttps://github.com/alexrothenberg/motion-addressbook/issues/22#issuecomment-15552932 .

jmay commented 11 years ago

Reproed with the default contacts on my branch. Investigating.

jmay commented 11 years ago

Found it. One of the default contacts has a birthday in the record. I've found that RubyMotion often crashes when reading any Time properties (NSDateRef) from the Address Book. I filed a bug report, but if they're all at the conference this week it might take them a while to look into it.

Quick workaround: comment out line #300 (KABPersonBirthdayProperty => :dob) in person.rb.

wink commented 11 years ago

Great, thanks for looking into it!

jmay commented 11 years ago

This is HipByte ticket #633

Blows up on all NSDate properties: Birthday, ModificationDate, CreationDate, and the multi-valued ABPersonDateProperty.

wink commented 11 years ago

@jmay Is there a public place where I can track this ticket? I checked the RubyMotion github issues as well as the RubyMotion YouTrack app and couldn't find it.

jmay commented 11 years ago

Looks like they are still using freshdesk for support issues & that isn't open access. I'll post any updates here. Hopefully they'll get it all moved over to YouTrack soon.

jmay commented 11 years ago

RubyMotion folks still haven't reproduced. I posted a simple test case to github:

$ git clone https://github.com/jmay/motion-test $ cd motion-test $ rake

d = UIApplication.sharedApplication.delegate d.this_will_fail

jmay commented 11 years ago

I pushed a 1.1.1 version so the crash doesn't occur on master. Hope to get this problem solved properly, it's a nuisance if we can't safely access all the properties in the AB.

jmay commented 11 years ago

There is now a ticket for this on the open server: http://hipbyte.myjetbrains.com/youtrack/issue/RM-81

wink commented 11 years ago

Great, thanks for the follow up!

On Fri, Mar 29, 2013 at 12:32 PM, Jason May notifications@github.comwrote:

There is now a ticket for this on the open server: http://hipbyte.myjetbrains.com/youtrack/issue/RM-81

— Reply to this email directly or view it on GitHubhttps://github.com/alexrothenberg/motion-addressbook/issues/22#issuecomment-15656861 .

alexrothenberg commented 11 years ago

I just pushed v1.2.0 up to rubygems with birthday commented out as @jmay did above. We can add it back once rubymotion fixes the issue.

jmay commented 11 years ago

bug still exists in RubyMotion 1.35

alexrothenberg commented 11 years ago

That's too bad, but the workaround still works right?

wink commented 11 years ago

Yes, that latest gem in RubyGems works ok. — Sent from Mailbox for iPhone

On Fri, Apr 5, 2013 at 11:54 AM, Alex Rothenberg notifications@github.com wrote:

That's too bad, but the workaround still works right?

Reply to this email directly or view it on GitHub: https://github.com/alexrothenberg/motion-addressbook/issues/22#issuecomment-15973947

jmay commented 11 years ago

I think I've found a workaround for this (needed an Objective-C hack). Included in pull request #27. Please check if I got this right before we merge.

jmay commented 11 years ago

Not quite finished yet. When you put gem 'motion-addressbook' in your Gemfile, it doesn't bring in the C code. Figuring out how to do that now. Maybe CocoaPods does this?

jmay commented 11 years ago

Found it. Not Cocoapods, need to put App.setup in the motion-addressbook.rb file

jmay commented 11 years ago

merged pull request #27, this should be working properly now

jmay commented 11 years ago

RubyMotion bug still not fixed in 2.4, hack still necessary.

http://hipbyte.myjetbrains.com/youtrack/issue/RM-81

jmay commented 11 years ago

Fix for this reported on YouTrack. Hope to see it in next release of RM.

Is it safe to assume that all RM users will be upgrading quickly to new releases? I hate to leave in workarounds for bugs in prior versions.