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
Crash Fixes #1279
Crash Fixes #1279
Conversation
Sorry, I stupidly deleted the crash logs to try and be tidy, before putting them here. The first commit fixes a crash in the The second fixes a crash on |
3bfdb033afcf967d96d128b6b7d1f82cc8e753c7 won't fix anything, as ObjC objects are memset to 0 on allocation (which is equivalent of saying No opinion on the second though, I'd say move the retain + autorelease directly in the accessor since there are other places that depend on it not being released before ;-) (though I can't get how "before" can happen, unless the crash report had some threading weirdness). |
I can confirm you're right about 3bfdb03. I just debugged it and it is already About your idea - it looks like the delegate to a On the 2nd commit - good idea. I'll do that. Once the QSApp.com backups are up, I'll fish out the crash reports (hopefully), so you can see them. |
Right, I have in mind that IconLoader delegates were SOVs but my brain was failing me ;-). You should make sure that ResultControllers invalidate their loaders (both the normal and child one), and that Or mark |
I'm looking through crash reports from last night and getting dragged down into the catalog scanning muck with you guys. Hope you're happy. :-) entryContentsIn saveIndexThere were two reported crashes in
Using In both cases, it looks like
Which makes me wonder if we really even need double freeIn Unrelated thing I noticed while investigating: Is it necessary to create |
I wrote that part so this one's easy : not doing it like that will cause "collection changed while enumerating" since |
About the |
Yeah, I figured that out. Thanks. :-)
We're enumerating over it with |
Avoids the menemonicKey being released before it's saved
* In QSCatalogEntry, `contents` isn't written to the file, `writeArray` is. In addition, `arrayByPerformingSelector:` is alreay designed to put a lock on `contents` during enumeration. * In QSLibrarian, we don't care about `catalog`, just the immutable `leafEntries`. And now that `entryContents` is a local copy (also immutable), no need to protect it from changes on other threads.
History rewritten to bring in 58d0f25 and avoid a conflict. I've also removed the "pointless" commit. My commit won't prevent any crashes, but should reduce overhead. Reasoning is in the commit message. Let me know if I'm off on any of it. |
RE: Quicksilver_2012-12-14-141255_Eowyn.crash Basically, they got What's the answer here? Should we test |
I don't think so, since it's not a I'm still thinking that what I think may be happening is that the object is getting released after its icon is set, and the notification is sent. Tbh, I don't really know. Maybe @tiennou will do a better job deciphering Crap: not worth reading but kept for historical purposes ;-) Looking at threads 7 and 8, it seems like the notif is being sent to the same QSResultController (?)… ok looking at threads 10, 13, 15 perhaps multiple |
And a quick comment on Orochi 12-12-12 crash: perhaps we should
|
Well, the result controller watches for all of them, so removing it as an observer isn't an option. I can see how it would be a problem if the object from the notification had been released, but the notification is now only posted in one place, and the object passed is Also, should we have |
But how does the array end up containing On a related note, I'm wondering why |
(My connection is not sufficient for doing high-level things like fetching crash reports, so I'll comment instead ;-)). An array can never contain nil, because you'd eat an exception immediately upon adding it. So it looks to me the crash is related to one object inside getting released and a dangling pointer left in its place, which will cause a crash on next access and thus will have a backtrace utterly unrelated. If you're happy enough to have reproducible, then use And |
Unfortunately not, in this case. I even tried enabling that damned "child results list" for a while to see if it would happen for me, but no luck. So… Time to switch to ARC? ;-)
Makes sense. We should add a comment in there to explain that. |
Great, so those 'crash fixes' I made are pointless ;-) So… can we do anything more? Should we just leave this and get another pre release build out? |
How about if we make the |
@pjrobertson on IRC:
I had always assumed that objects were sent Since we're talking about an array of dictionaries, I wonder if the released object isn't one of the dictionaries itself, but an object inside it somewhere. (Not that this helps narrow it down at all.) |
I think this is the only pull we're waiting on for release right? Since we can't figure out how to actually fix the catalog fixes, shall we merge what we have and release another ß71 preview (hopefully the final) |
Also - make the 'contents' array immutable.
Sorry, I forgot I had a few more 'fixes' lying around. I've pushed 2 more commits. The 2nd attempts to fix the following crash:
|
OK so I've had another think about this crash:
Still can't really figure it out, but the Doesn't really help us towards figuring out the problem, but we know that See my sample code: Just a though: where we're getting crashes, could we just wrap them in |
Well, we clearly aren't manipulating the C array, so I don't know where this is coming from. Yes, I think we should catch the exception. Maybe log some info that would help us see what is in the array? FYI, I got tired of creating full-blown Xcode projects for little stand-alone tests like that. I saw a tip from a guy at Big Nerd Ranch. Now I just have a directory full of single-purpose #!/bin/zsh
EXE=$1:r
clang -Wall -framework Foundation -framework CoreServices $1 -o $EXE
$EXE If you keep it simple enough (use older syntax), you can just do ⌘R in TextMate. I assume it's using GCC and could be configured to use LLVM somehow, but haven't dug into it. |
Alright, I'll add a try catch in there.
Thanks for that tie bit. Useful :) On 18 December 2012 18:50, Rob McBroom notifications@github.com wrote:
|
Also: perform saveIndex run on the scanQueue
OK, another commit added |
Great. I'll try it out for a while and get another release out. |
RE the following crash, @HenningJ had this crash, but couldn't reproduce with a fresh build of the release branch. I just tried to update from 3936→3937 on 10.7.5 and got the crash. I made sure that I needed admin rights to write over my old app. Possible reasons:
We can hopefully check for the crash again going from 3937→3938 (next pre). Crash:
|
} | ||
for(QSCatalogEntry * entry in [catalog leafEntries]) { | ||
NSArray *entryContents = [[entry contents] copy]; | ||
if (entryContents && [entryContents count]) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could this be simplified to just [entryContents count]
since 0 == nil ?
I'll try. For some reason, other users are never able to run a copy I build under my account, so it could be difficult. I usually just copy it out of the DMG as the other user, but Debug = no DMG. I'll figure something out, though. |
Yep, I've had that problem. I suggest you do the following, to save having
On 19 December 2012 14:06, Rob McBroom notifications@github.com wrote:
|
What I did:
No problems. I was asked to authenticate, and I ended up with a running copy of 3937. Here's the build if you want to try it yourself. FYI, if Gatekeeper thinks the app is OK, it should say this:
|
Here's crash I've gotten myself 3 times. Not sure how to reproduce it at will. I think there are only 3 places in the Core Support plug-in that call
|
We can deduce from the log that the crash is in QSFileSystemObjectSource.m, since the method is called from a notif sent by VDKQueue (file observing class), and only file object sources use QSVoyer (the file watching class which calls VDKQueue). So the crash is in Possibly, My guess is that this is a red herring. |
OK, merging. You said on IRC that it may be somewhere else where the crash is occurring, so I'll let you look into it further. |
Crash fixes for a few crash logs that have popped up in the latest pre-release.
This is a branch on the Quicksilver repo so if anybody else has any fixes they can push to it… :)