Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

NSLocale.alloc() causes segmentation fault #3

Open
logancollins opened this Issue Jul 25, 2012 · 2 comments

Comments

Projects
None yet
1 participant
Owner

logancollins commented Jul 25, 2012

Attempting to allocate an instance of NSLocale causes a segmentation fault, with a recursive loop in -alloc(). It appears that after -alloc() is evaluated, we attempt to retain the result, which NSLocale does not like.

This also affects NSCalendar, and possibly other classes. We should attempt to not retain the value in this case, or special case -alloc.

Owner

logancollins commented Jul 25, 2012

Should be fixed in 3dd6eb4.

@logancollins logancollins reopened this Aug 8, 2012

Owner

logancollins commented Aug 8, 2012

This is once again an issue due to the switch to ARC. While we properly create the result of -alloc during the one-step alloc/init phase, ARC now performs an implicit objc_retain on the object in order to keep it alive in scope. This leads to the same issue we encountered before, as NSLocale and NSCalendar have a special (incorrect) implementation that impedes this behavior.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment