Skip to content
New issue

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

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix calendar crash #277

Merged
merged 2 commits into from
May 14, 2014

Conversation

rivera-ernesto
Copy link
Member

Related to #216 where...

利辺羅エルネスト added 2 commits May 14, 2014 12:07
…r systems as long as they are compiled agains iOS 6+ SDK)

// Calculate timestamp.
// The technique below is faster than using NSDateFormatter.

NSDateComponents *components = [calendar components:calendarUnitFlags fromDate:logMessage->timestamp];
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A NSInvalidArgumentException was being rised. Only possible cause a bad logMessage->timestamp.

@bpoplauschi
Copy link
Member

@rivera-ernesto Your fix looks legit, so I'll merge it. But I'm not sure if that is the only cause. If we look at #216, there are several flavours of crashes:

2014-02-11 21:03:59.849 Sparkle Test App[17768:3903] *** -[NSAutoCalendar class]: message sent to deallocated instance 0x10036b690
Fatal Exception: NSInvalidArgumentException
-[BKSSignal components:fromDate:]: unrecognized selector sent to instance 0x156c3830

Another potential issues would be: logMessage->timestamp has a poor mem mgm, gets deallocated and

  • if no other object is allocated in that area so we get the message sent to deallocated instance
  • if another object is allocated there, we get the unrecognized selector sent to instance

bpoplauschi added a commit that referenced this pull request May 14, 2014
@bpoplauschi bpoplauschi merged commit a51c9e4 into CocoaLumberjack:master May 14, 2014
@rivera-ernesto rivera-ernesto deleted the fix_calendar_crash branch May 15, 2014 00:36
@rivera-ernesto
Copy link
Member Author

Another potential issues would be: logMessage->timestamp has a poor mem mgm, gets deallocated and

  • if no other object is allocated in that area so we get the message sent to deallocated instance
  • if another object is allocated there, we get the unrecognized selector sent to instance

Right but probably for those cases the fixes should go to DDLogMessage.

@bpoplauschi bpoplauschi added this to the 1.9.0 milestone May 16, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants