8

When I build my macOS application that has an Safari extension in it, which I run on Safari, it crashes after a couple of seconds of running (though it does show up in the extensions).

It seems to be a problem of Safari trying to obtain data from the local Library folder. It also seems to struggle with Info.plist.

Here is the crash log:

2018-08-02 17:33:47.464379+0200 Safari[14693:1179568] [default] Unable to load Info.plist exceptions (eGPUOverrides)
2018-08-02 17:33:47.487993+0200 Safari[14693:1179565] [SQLiteStore] Failed to acquire database store coordination lock at /Users/lukasmuller/Library/Safari/Favicon Cache/favicons.db-lock: [35: Resource temporarily unavailable]
2018-08-02 17:33:47.488150+0200 Safari[14693:1179565] [SQLiteStore] Failed to acquire exclusive access to database at file:///Users/lukasmuller/Library/Safari/Favicon%20Cache/favicons.db.
2018-08-02 17:33:47.488580+0200 Safari[14693:1179565] [SQLiteStore] Failed to acquire database store coordination lock at /Users/lukasmuller/Library/Safari/Favicon Cache/favicons.db-lock: [35: Resource temporarily unavailable]
2018-08-02 17:33:47.488615+0200 Safari[14693:1179565] [SQLiteStore] Failed to acquire exclusive access to database at file:///Users/lukasmuller/Library/Safari/Favicon%20Cache/favicons.db.
2018-08-02 17:33:47.488694+0200 Safari[14693:1179565] [SQLiteStore] Falling back to an in-memory store
2018-08-02 17:33:47.489617+0200 Safari[14693:1179565] [FaviconPersistence] Using in-memory representation for database /Users/lukasmuller/Library/Safari/Favicon Cache/favicons.db
2018-08-02 17:33:47.505346+0200 Safari[14693:1179572] [SQLiteStore] Failed to acquire database store coordination lock at /Users/lukasmuller/Library/Containers/com.apple.Safari/Data/Library/Caches/com.apple.Safari/TabSnapshots/Metadata.db-lock: [35: Resource temporarily unavailable]
2018-08-02 17:33:47.505870+0200 Safari[14693:1179572] [SQLiteStore] Failed to acquire exclusive access to database at file:///Users/lukasmuller/Library/Containers/com.apple.Safari/Data/Library/Caches/com.apple.Safari/TabSnapshots/Metadata.db.
2018-08-02 17:33:47.572816+0200 Safari[14693:1179583] flock failed to lock maps file: errno = 35
2018-08-02 17:33:47.573799+0200 Safari[14693:1179583] flock failed to lock maps file: errno = 35
2018-08-02 17:33:47.604115+0200 Safari[14693:1179588] Failed to acquire exclusive access to AutoFill corrections SQLite store at AutoFillCorrections.db.
Failed to acquire exclusive access to AutoFill corrections SQLite store at AutoFillCorrections.db.
2018-08-02 17:33:47.607520+0200 Safari[14693:1179588] Failed to acquire exclusive access to AutoFill corrections SQLite store at CloudAutoFillCorrections.db.
Failed to acquire exclusive access to AutoFill corrections SQLite store at CloudAutoFillCorrections.db.
2018-08-02 17:33:47.608239+0200 Safari[14693:1179588] Failed to acquire exclusive access to AutoFill corrections SQLite store at AutoFillCorrections.db.
Failed to acquire exclusive access to AutoFill corrections SQLite store at AutoFillCorrections.db.
2018-08-02 17:33:47.609424+0200 Safari[14693:1179588] Failed to acquire exclusive access to AutoFill corrections SQLite store at CloudAutoFillCorrections.db.
Failed to acquire exclusive access to AutoFill corrections SQLite store at CloudAutoFillCorrections.db.
2018-08-02 17:33:47.857619+0200 Safari[14693:1179579] Failed to acquire exclusive access to AutoFill corrections SQLite store at AutoFillCorrections.db.
Failed to acquire exclusive access to AutoFill corrections SQLite store at AutoFillCorrections.db.
2018-08-02 17:33:47.859043+0200 Safari[14693:1179565] [CrowdsourcedAutoFill] Unable to read cloud AutoFill correction sets, error: Error Domain=NSCocoaErrorDomain Code=260 "The file couldn’t be opened because it doesn’t exist."
2018-08-02 17:33:47.859839+0200 Safari[14693:1179579] Failed to acquire exclusive access to AutoFill corrections SQLite store at CloudAutoFillCorrections.db.
Failed to acquire exclusive access to AutoFill corrections SQLite store at CloudAutoFillCorrections.db.
2018-08-02 17:33:47.871122+0200 Safari[14693:1179640] [CloudBookmarks] Error fetching remote migration state: Error Domain=com.apple.SafariBookmarksSync.CloudBookmarksErrorDomain Code=0 "(null)"
2018-08-02 17:33:47.953061+0200 Safari[14693:1179640] [RemotePlistController] The downloaded plist could not be loaded: Error Domain=NSCocoaErrorDomain Code=260 "The file couldn’t be opened because it doesn’t exist."
2018-08-02 17:33:48.191583+0200 Safari[14693:1179568] [trace] RWIMobileDeviceConnection (Direct): Unable to start a session: The host is not paired with the device.
2018-08-02 17:33:48.202902+0200 Safari[14693:1179568] [trace] RWIMobileDeviceConnection (Direct): Unable to stop session: The session is inactive.
2018-08-02 17:33:48.234006+0200 Safari[14693:1179572] Failed to acquire exclusive access to AutoFill corrections SQLite store at AutoFillCorrections.db.
Failed to acquire exclusive access to AutoFill corrections SQLite store at AutoFillCorrections.db.
2018-08-02 17:33:48.235327+0200 Safari[14693:1179572] Failed to acquire exclusive access to AutoFill corrections SQLite store at CloudAutoFillCorrections.db.
Failed to acquire exclusive access to AutoFill corrections SQLite store at CloudAutoFillCorrections.db.
2018-08-02 17:33:52.195337+0200 Hockey Crahses to Jira[14702:1180067] [default] Unable to load Info.plist exceptions (eGPUOverrides)
2018-08-02 17:30:28.465503+0200 Hockey Crashes to Jira[14575:1165922] [default] Unable to load Info.plist exceptions (eGPUOverrides)
2018-08-02 17:30:43.565677+0200 Hockey Crashes to Jira[14575:1165922] [default] Unable to load Info.plist exceptions (eGPUOverrides)

Has anyone faced similar problems and has figured out a way of fixing it?

Richie Thomas
  • 3,073
  • 4
  • 32
  • 55
Lukas Süsslin
  • 553
  • 1
  • 3
  • 12
  • 1
    "trying", "struggle" - kind of vague, no? What about showing us some actual code, and the crash log? – matt Aug 02 '18 at 15:45
  • @matt, only described it instead of adding a very subjective crash log. However, now I've edited the question and added it. – Lukas Süsslin Aug 02 '18 at 15:52
  • Thanks for pointing out this bug @richie. I am experiencing this error on the default Safari Extension App. Was a solution ever established? – Jeff Jenkins Jan 07 '19 at 19:13
  • Seems this is related to -> https://stackoverflow.com/questions/51657557/how-can-crashes-of-safari-extensions-on-mojave-be-avoided – Jeff Jenkins Jan 07 '19 at 19:57
  • 1
    @JeffJenkins looks like mueller is the OP for this question. – Richie Thomas Jan 08 '19 at 20:21
  • @RichieThomas Thanks Richie. – Jeff Jenkins Jan 09 '19 at 22:01
  • @mueller I was wondering if Mueller ever found a solution. – Jeff Jenkins Jan 09 '19 at 22:02
  • 1
    @jeff-jenkins, Sadly not. I was developing the extension while interning at a company. Since it was an "internal tool," I do not know whether or not they could solve it. Should I ask? – Lukas Süsslin Jan 11 '19 at 09:08
  • I also experience this error when running the default Safari App Extension without changing anything. However, I somehow created a project before (where I also haven't changed anything) that is able to run successfully. – McLawrence Mar 10 '19 at 16:53

3 Answers3

4

I have the same (random) problem. It seems the problem disappears after a cleaning of the project (Product/Clean) and of the build folder (Alt on Product/Clean menu)

However the message "[default] Unable to load Info.plist exceptions (eGPUOverrides)" is still present... It does not seem to be relavant since everything works fine.

I have created a Slack community for Safari App Extensions devs, you are welcome to join us: https://slofile.com/slack/safariappextdevs

Emmanuel Sellier
  • 526
  • 1
  • 5
  • 13
0

Basically, you're trying to run it on a device. For example, if you wish to run an iOS app on iOS-Device, you need provisioning profile. Similarly, if you wish to run an macOS app on macOS device, you've to set provisioning profile for it.

  • Select Project, select main target, make sure you've set the provisioning profile, team.
  • Also set the provisioning profile for safari extension target.
  • Once you're done setting up, run the safari extension.
  • Go to safari preferences, extensions tab & enable your extension.

Hope that helps. Cheers.

sagarkothari
  • 24,520
  • 50
  • 165
  • 235
0

So, apparently :

The Xcode debugger kills the browser if no interaction/messaging is found during a certain lapse of time.

So to avoid this, what you have to do is to write that code inside your injected script :

setInterval(() => safari.extension.dispatchMessage("ping", {}), 1000);

I wrote this article that explains the common problems encountered while developing Safari App Extensions.

Christopher J.
  • 1,154
  • 1
  • 12
  • 21