Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic BM v0.7.0 Crash While Adding Safari Bookmark (Read 6949 times)
Jerry Krinock
Admin
Offline
Posts: 1666
Location: San Jose, California, USA
Joined: Sep 29th, 2008
Re: BM v0.7.0 Crash While Adding Safari Bookmark
Reply #3 - Dec 18th, 2009 at 1:04pm
Print Post  
F451 wrote on Dec 18th, 2009 at 7:08am:
Okay, I've been experimenting with this version and have yet to crash Safari or BookMacster.
A few months ago we'd discovered a file locking mechanism in Safari.  It's probably what Apple's Sync Services – and thus MobileMe – use for safely syncing to the iPhone.  Briefly, the file locking mechanism should make these crashes impossible.  We had written code to implement this, but yesterday I discovered we hadn't activated it.  So, yesterday we activated it.  After testing even more vigorously than the day before, I was unable to get Safari to crash.  So then I turned it off, retested, and arghhh, found the same as you, that now Safari won't crash either even without the file locking.  (To clarify, version 0.8.2 which you tested does not have the file locking, so it should crash once in awhile.)

Well, anyhow, the file locking mechanism is all tested now, and it makes sense, so we're going to leave it activated – it's an official change as of 0.8.3.  I did find, though, that with it activated, I seem to get the "You can't change your bookmarks now" alert more often from Safari.  I believe this is because, in our implementation, BookMacster locks the file for longer than the few milliseconds it's actually writing it, thus closing the window for longer, and therefore we have design margin – which is good.  I'd much rather have Safari issue that warning to someone twice a year than have it crash once every ten years.

Just once, Safari issued an even more interesting alert: "You can't change your bookmarks now because they are being synchronized.  Wait a few minutes and then try again."  I like that one better and don't understand why sometimes I see one and sometimes the other.  But it looks like we've successfully mimicked Apple's Sync Services behavior.

F451 wrote on Dec 18th, 2009 at 7:08am:
The sounds work well too as I actually enjoy the confirmations.
Oh, those sounds are on in all of our debug builds and indeed they have been great for development work.  Maybe one of these days we'll make it a preference, or at least a hidden preference.  But then I'd have to make sure that it really works all the time, document it, explain that it doesn't work until you re-save the Bookmarkshelf, etc., etc.  There's no such thing as a "free" feature.

F451 wrote on Dec 18th, 2009 at 7:08am:
In the crashes (and you are correct it is Safari that crashed, not BookMacster) there were no crash logs for BookMacster.
Ha!  You should see my Crash Logs folder.  But that's my job – try  like hell to make it crash, so that we have everything fixed before 1.0 hits the streets.
  

Jerry Krinock
Back to top
IP Logged
 
F451
Senior Member
Offline
Posts: 54
Location: Southern California
Joined: Oct 7th, 2008
Re: BM v0.7.0 Crash While Adding Safari Bookmark
Reply #2 - Dec 18th, 2009 at 7:08am
Print Post  
Okay, I've been experimenting with this version and have yet to crash Safari or BookMacster. The sounds work well too as I actually enjoy the confirmations. Thanks!

P.S. In the crashes (and you are correct it is Safari that crashed, not BookMacster) there were no crash logs for BookMacster.
  
Back to top
 
IP Logged
 
Jerry Krinock
Admin
Offline
Posts: 1666
Location: San Jose, California, USA
Joined: Sep 29th, 2008
Re: BM v0.7.0 Crash While Adding Safari Bookmark
Reply #1 - Dec 17th, 2009 at 6:36pm
Print Post  
Hello, F451.

As you may have noticed, the Crash Log which you attached is a Safari Crash Log, not a BookMacster Crash Log.  Hypothetically, this could occur if you made some change to your bookmarks in Safari (such as adding a bookmark), this was sensed by an Agent, and then a BookMacster Worker was launched to import, sort and export them.  This takes maybe 10 seconds.  Now, if 10 seconds later you just happened to make another change, such as add a a(nother) bookmark, there will be a conflict.  Usually, Safari will notice that the file has been modified since it last read it in, and display the "Your bookmarks can't be changed now..." dialog.

I presume that you have an Agent set in some Bookmarkshelf to Export bookmarks to Safari when Safari – Bookmarks Changed.

In real life, this could not happen any more often than once every 5 minutes, since the Agent is throttled to import/export no more often than every 5 minutes.  So I changed the throttle to 5 seconds instead of 5 minutes, and tried furiously for about ten minutes to make Safari crash by

   (a) adding bookmarks
   (b) sliding bookmarks back and forth in the Bookmarks Bar
   (c) editing bookmarks in the Show All Bookmarks window

The result was that during this couple hundred bookmarks changes, I got the "Your bookmarks can't be changed now..." dialog about a dozen times, but I also got one crash.  The crash occurred when I was doing action (b).  The dialog appeared, I clicked "OK", but it was apparently "too late" – Safari was already going down.

I believe that action (c) could not cause a crash because BookMacster sees if that window is open and closes it before exporting (via some AppleScript).  However, it looks like it is still possible to get a rare crash by doing (a) or (b).

I wonder, though, if it is more than rare on your Mac, because in your report I see that you've got a few more processor cores on that baby than the two I have in my Mac Mini.  This will allow the system to run more simultaneous threads, making it more likely that the conflict would cause a crash. So I packaged up my "unthrottled" version as BookMacster 8.6.2, a special version for you to test.  Besides being unthrottled, its Worker also plays a "tink" sound when it begins and a "pop" sound when it ends.  When you have a few minutes, please download it from here:

http://sheepsystems.com/bookmacster/debug/F451/BookMacster.zip

In order to load the unthrottled Agent and direct it to the Worker with sound effects, launch the new version, open the Bookmarkshelf with the Agent which is watching Safari for Bookmarks Changed, make some trivial change if it won't save, change the trivial change back, and then save the Bookmarkshelf.  Then add add some bookmarks in Safari.  You should hear tinks and pops as the Worker does it work.  Let me know what the Safari crash rate is.

In the meantime, we'll be thinking about ways to work around this.
  

Jerry Krinock
Back to top
IP Logged
 
F451
Senior Member
Offline
Posts: 54
Location: Southern California
Joined: Oct 7th, 2008
BM v0.7.0 Crash While Adding Safari Bookmark
Dec 16th, 2009 at 9:29pm
Print Post  
Attached is the log. This has happened twice, and the quick BM dialog window I receive just belong crashing says that I cannot change bookmarks at the present time.
  

BM_Crash_Log_rtf.tar ( 101 KB | 359 Downloads )
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint