Elegant Recovery From Crashes - Avoid Crash Loops

  • I've had Vivaldi crash a number of times recently and this usually leads to what I refer to as the "crash loop". Vivaldi crashes, I restart it, it crashes immediately, and this repeats. Basically once a crash happens the application is left in such a state that it cannot be started again. The only quick way I've found to get Vivaldi running again is removing the ~/Library/Application Support/Vivaldi directory. I also remove the Cache and Saved Application State entries, but they seem to have no affect on my ability to run Vivaldi again. Even installing different Vivaldi versions doesn't help, I assume because they use these same entries.

    For the record I'm on macOS Sierra, 10.12.1, and Vivaldi is at 1.6.687.3 (although I think all the crashes occurred on earlier versions).

    I expect an occasional crash. My concern with this post is how do I avoid the dreaded "crash loop" without losing all my settings? Removing the Application Support directory eliminates my bookmarks, extensions, pinned tabs, etc, so it's obviously an extreme approach. What should I do differently? Has anyone else dealt with this?

    Note that I did just update my Vivaldi startup settings to open the homepage rather than the last session on the hope that would help when this comes up again, but I'd rather not rely on that even if it does end up working.

  • Moderator

    Your best bet may be to install Vivaldi snapshots as a "standalone" installation. This involves creating a directory that will contain both the Vivaldi binary as well as profile data. @ruario has developed some scripts to automate the standalone installation and create a launcher. If you search the web for "vivaldi mac standalone", you'll find his github repo with all the information you need. One you have this working, you can then back up the standalone directory prior to upgrading and restore it if your Vivaldi installation goes screwy. This also allows Stable releases to co-exist with Snapshots.

    The real problem is when a new Vivaldi snapshot release totally chokes on the old profile. In this case, you're snookered until Vivaldi fixes the problem or develops a tool to scrub and sanitize the profile.

    I take a different approach: I don't expect Vivaldi Snapshots to be stable. I maintain everything that I want to keep long-term (e.g. bookmarks, etc.) in Safari. When Vivaldi messes up, I blow away ALL of the Vivaldi files in ~/Library, and since I (usually) don't have Chrome installed, I also delete "~/Library/Application Support/Google/" (yes, Vivaldi actually creates this!) along with "Chrome Safe Storage" in my keychain. When I re-launch Vivaldi, I get a totally clean out-of-the-box install. From there I set my preferences again, install my extensions, import my bookmarks, and I'm good to go. The reset process takes me less than 5 minutes, including setting up my themes.

  • The standalone script looks very interesting. Although it won't solve my problem it will allow me to test some possible fixes or just generally play around. Thanks for that. Maintaining everything separately will unfortunately only work in the short term while everything is relatively synced up, but once Vivaldi has been in use for a while (my goal) I expect I'll have bookmarks that are unique to Vivaldi. For now I do something similar to what you mentioned, just importing items from Chrome (in my case) again. Of this also overlooks other items like extensions

    For a decent recovery I think the following items need to be restored:

    • Bookmarks
    • Web Panels
    • Notes
    • Pinned Tabs
    • Extensions
    • Browser Settings

    In digging around I've come up with some incomplete information for some of these items which I've poorly vomited out below. This is quite incomplete so I'll update in the future if I have time to poke around some more. I assume that some of these files could be restored into the Application Support directory after a crash if a crash loop state was encountered (all of this after removing Application Support and running Vivaldi again to recreate with defaults). Of course a better approach might be pinpointing some files to remove and I've listed a few candidates below.

    ~/Library/Application Support/Vivaldi/Default/Bookmarks
    This file has JSON information for bookmarks along with a checksum key. The checksum seems based only on the information in the file (code in https://github.com/ograycode/vivaldi-source/blob/22a46f2c969f6a0b7ca239a05575d1ea2738768c/chromium/components/bookmarks/browser/bookmark_codec.cc) so I don't see any issue moving a copy into an existing Vivaldi installation.

    ~/Library/Application Support/Vivaldi/Default/Notes
    This appears to be JSON information for any notes you've entered.

    ~/Library/Application Support/Vivaldi/Default/Extensions
    This folder seems to contain child folder for each extension. Do these folders contain enough to bring an extension back to life?

    Web Panels

    Pinned Tabs

    Browser Settings
    ~/Library/Application Support/Vivaldi/Default/Preferences ??
    This file seems like it may contain some settings, including some related to extensions.

    Rather than restoring certain files, what files might be targeted for removal to overcome a crash loop?
    "Current Session" and "Current Tabs"?

  • Moderator

    @milton_toast - With Extensions and Settings, you are asking to restore the very things which may be causing the crash. But FOR SURE, sessions should never be restored from a crash.

  • With Extensions and Settings, you are asking to restore the very things which may be causing the crash.

    No doubt. I'm just trying to avoid the annoyance of setting everything up again - pinned tabs, web panels, importing bookmarks - and of course I lose notes and bookmarks from Vivaldi with my aggressive deletion approach. I think deleting the Current Session and Current Tabs files might be a better option to try the next time this happens. This post - https://forum.vivaldi.net/topic/5040/blocked-at-start - seems similar and suggests that would be a much less disruptive way to handle the "crash loop".

    Ultimately all of this would become unnecessary because Vivaldi would try to prevent it from occurring in the first place. I imagine it would be similar to Chrome, where an unclean exit is detected and you are prompted to restore the previous session or start a new one; at least that's how I remember it working.

  • Moderator

    @milton_toast - The numbers of crashes you experience is highly unusual, even for a Mac, which is Vivaldi's most problematic platform right now. Some Mac users, despite some glitches, don't get crashes. At all. So just how the developers would address your unique situation is unknown.

    Vivaldi will continue to get better and better with Mac (the developers have a larger percentage of Mac users than the overall population - they want theirs to work, too), which may affect your situation overall, but I have to suspect you are doing something which is not common even among Mac users.

  • Yes, I may certainly be doing something unusual. That said, I don't think the better crash handling I hinted at in my last post is in any way asking for developers to address a unique situation. I'm not asking for a specific crash fix or whining that Vivaldi crashes all the time. I'll spend more time with it and if a pattern is noticed I'll stop using whatever I think is the source and, if actionable, report a bug.

    Crashes happen. Applications need to handle it, and browsers especially need to handle the fact that they commonly launch with the last open session. Obviously if that last session caused the crash then you're gonna have a bad time. Perhaps that's an area that the developers need to address, if they aren't already.

    I'm hoping to continue using Vivaldi as my main browser as I think it's extremely promising and that's the reason I posted this in the first place. Even if I wasn't experiencing these crashes (and it's not a huge number), even if it worked perfectly, it would be hard to accept using it full time if the possibility existed that the application could end up in such a state that I could lose all history, bookmarks, notes, and more. I'm certain there's a relatively simple way to recover from this state and what I've outlined before might be sufficient. If anyone else has ideas or has gone through this and emerged unscathed please chime in. I'll post again if I have any other findings.

  • Moderator

    What extensions are you using? Also, does Vivaldi start crashing only after an upgrade, after making a configuration change, during normal browsing, or all of a sudden when you launch the application?

    If you launch Console.app, then look in ~/Library/Logs - Diagnostic Reports, you'll see a log of the Vivaldi crashes. In each, you'll see headers such as this:

    Crashed Thread:
    Exception Type:
    Exception Codes:
    Application Specific Information:
    Application Specific Backtrace 1:
    Thread 0 Crashed:

    If you look at all of the crashes, is there a common signature? If so, can you post an excerpt?

    For me, crashes are rare but I've personally seen them happening from Chromium bugs that Vivaldi inherits, bugs in the Vivaldi/Chromium integration, and issues with extensions that don't quite work right under Vivaldi. (e.g. I can make Vivaldi and Chrome crash immediately on OS X just by using a Color Picker and selecting a colour from the Apple Developer palette. Bug reported; fix from Google coming soon.)

    With Vivaldi 1.6, other people (not me) with "old profiles" seem to be having problems immediately after an upgrade. Other glitches (ranging in severity) are specific to certain hardware configurations. There are also Chromium bugs/crashes specific to macOS Sierra.

    With a bit more information, hopefully we can identify what's causing this.

  • What extensions are you using?

    • Evernote Web Clipper
    • Adblock
    • Okta
    • 1 Password

    Also, does Vivaldi start crashing only after an upgrade, after making a configuration change, during normal browsing, or all of a sudden when you launch the application?

    The initial crash has always been during normal browsing. After that the application crashes on every launch (prompting my original post) until I blow away enough stuff to make it work.

    If you look at all of the crashes, is there a common signature? If so, can you post an excerpt?

    The entries in those log files look very similar and I've included an example. Note I didn't see any entry for "Application Specific Information" or "Application Specific Backtrace".

    Crashed Thread: 0 CrBrowserMain Dispatch queue: com.apple.main-thread
    Exception Type: EXC_BAD_ACCESS (SIGSEGV)
    Exception Codes: KERN_INVALID_ADDRESS at 0x00000000000000d8

    Thread 0 Crashed:: CrBrowserMain Dispatch queue: com.apple.main-thread
    0 com.vivaldi.Vivaldi.framework 0x0000000112d7b92c 0x10f384000 + 60782892
    1 com.vivaldi.Vivaldi.framework 0x0000000112f91a2e 0x10f384000 + 62970414
    2 com.vivaldi.Vivaldi.framework 0x0000000112d76735 0x10f384000 + 60761909
    3 com.vivaldi.Vivaldi.framework 0x0000000112c8c25f 0x10f384000 + 59802207
    4 com.vivaldi.Vivaldi.framework 0x0000000112c8c718 0x10f384000 + 59803416
    5 com.vivaldi.Vivaldi.framework 0x00000001128b90af 0x10f384000 + 55791791
    6 com.vivaldi.Vivaldi.framework 0x00000001104386ff 0x10f384000 + 17516287
    7 com.vivaldi.Vivaldi.framework 0x000000011043aa29 0x10f384000 + 17525289
    8 com.vivaldi.Vivaldi.framework 0x000000011043a512 0x10f384000 + 17523986
    9 com.vivaldi.Vivaldi.framework 0x00000001104565d9 0x10f384000 + 17638873
    10 com.vivaldi.Vivaldi.framework 0x0000000110456528 0x10f384000 + 17638696
    11 com.vivaldi.Vivaldi.framework 0x00000001128ba3df 0x10f384000 + 55796703
    12 com.vivaldi.Vivaldi.framework 0x00000001103200b1 0x10f384000 + 16367793
    13 com.vivaldi.Vivaldi.framework 0x00000001100de561 0x10f384000 + 14001505
    14 com.vivaldi.Vivaldi.framework 0x00000001114e0f9b 0x10f384000 + 34983835
    15 com.vivaldi.Vivaldi.framework 0x0000000110b6fe39 0x10f384000 + 25083449
    16 com.vivaldi.Vivaldi.framework 0x0000000110b93998 0x10f384000 + 25229720
    17 com.vivaldi.Vivaldi.framework 0x0000000110b93c9c 0x10f384000 + 25230492
    18 com.vivaldi.Vivaldi.framework 0x0000000110b94043 0x10f384000 + 25231427
    19 com.vivaldi.Vivaldi.framework 0x0000000110b9614d 0x10f384000 + 25239885
    20 com.vivaldi.Vivaldi.framework 0x0000000110b8903a 0x10f384000 + 25186362
    21 com.vivaldi.Vivaldi.framework 0x0000000110b95b64 0x10f384000 + 25238372
    22 com.apple.CoreFoundation 0x00007fffb95824b1 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
    23 com.apple.CoreFoundation 0x00007fffb956361d __CFRunLoopDoSources0 + 557
    24 com.apple.CoreFoundation 0x00007fffb9562b16 __CFRunLoopRun + 934
    25 com.apple.CoreFoundation 0x00007fffb9562514 CFRunLoopRunSpecific + 420
    26 com.apple.HIToolbox 0x00007fffb8afffbc RunCurrentEventLoopInMode + 240
    27 com.apple.HIToolbox 0x00007fffb8affdf1 ReceiveNextEventCommon + 432
    28 com.apple.HIToolbox 0x00007fffb8affc26 _BlockUntilNextEventMatchingListInModeWithFilter + 71
    29 com.apple.AppKit 0x00007fffb71e9b79 _DPSNextEvent + 1093
    30 com.apple.AppKit 0x00007fffb78ff1c3 -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 1637
    31 com.apple.AppKit 0x00007fffb71de53d -[NSApplication run] + 926
    32 com.vivaldi.Vivaldi.framework 0x0000000110b9696e 0x10f384000 + 25241966
    33 com.vivaldi.Vivaldi.framework 0x0000000110b95fac 0x10f384000 + 25239468
    34 com.vivaldi.Vivaldi.framework 0x0000000110bb01c1 0x10f384000 + 25346497
    35 com.vivaldi.Vivaldi.framework 0x000000011076d065 0x10f384000 + 20877413
    36 com.vivaldi.Vivaldi.framework 0x0000000110007d84 0x10f384000 + 13122948
    37 com.vivaldi.Vivaldi.framework 0x000000011000a372 0x10f384000 + 13132658
    38 com.vivaldi.Vivaldi.framework 0x00000001100040ec 0x10f384000 + 13107436
    39 com.vivaldi.Vivaldi.framework 0x000000011072735e 0x10f384000 + 20591454
    40 com.vivaldi.Vivaldi.framework 0x0000000110726596 0x10f384000 + 20587926
    41 com.vivaldi.Vivaldi.framework 0x000000010f38794c ChromeMain + 60
    42 com.vivaldi.Vivaldi 0x000000010ba8dd5a main + 522
    43 com.vivaldi.Vivaldi 0x000000010ba8db44 0x10ba8d000 + 2884

    Note that I had a crash yesterday but the browser started up without problems afterwards. This time I had it set to open to the homepage when starting rather than the previous session. I'm also up a couple versions, currently at 1.6.689.13.

  • Moderator

    What version of Vivaldi produced this crash? There's something weird about this backtrace but I can't put my finger on it. A Vivaldi dev can determine exactly where in the code that your browser died.

    Also, FYI, in the Chrome web store, a few people have left comments that Okta has been causing crashes recently. There's also an open bug report (unconfirmed by the Chromium devs) that Okta is causing Chromium on Linux to crash but not Chrome.


    Can you try disabling Okta to see if it makes a difference?

  • It looks like all the crashes, excluding one a couple days ago, were on 1.6.682.3, and the crash yesterday has a different crash log. In the last 2-3 days, during which I've been on more recent versions of Vivaldi, I've only had the single crash. Perhaps my set-up is a little more stable now.

    I would love to disable Okta as I dislike it, but I need it for work. I'll just forge ahead with it for now unless it becomes a problem.

    All the crash detail stuff aside I think there's still a need to find a way to recover from the crash loop problem. We might solve my problem for now, but there's no reason to expect that I won't experience a crash in the future. I have updated my settings to startup with the last session because I prefer that and I want to live on the edge a little bit. I still think deleting the Current Session and Current Tabs file might get around the crash loop but that's still a guess.

  • Moderator

    The big problem is that there's still something in your setup that's de-stabilizing Vivaldi, potentially even in a way that could compromise security; something that the devs really need to fix. If Vivaldi is crashing because of an extension that's critical to your workflow, file a bug report.

    As Vivaldi evolves, they're replacing more and more Chromium code. They try their best not to break compatibility but there's always a potential for breakage. Snapshots also aren't intended for "production" use; Stable build are. The snapshots are provided so we can test and stabilize new features and ensure that things critical for our day-to-day use get fixed by the time a Snapshot becomes a formal release. Early snapshots are guaranteed to be glitchy and unstable. As soon as Snapshots become solid, they're released to the Stable channel only to be replaced a week later by something else with a new hoard of annoying bugs that need to get squashed. As you've already discovered, sometimes when Vivaldi crashes, the resulting mess is a huge pain to clean up.

    I'm not sure why but Vivaldi now really wants to find out what your "favourite" extensions are:

    Let them know what you're using and report any extensions that are not working as well.

    Lastly, I would also advise reporting your "Crash Loops" as a formal bug. It's getting into this condition because the browser crashed while something in your profile was getting updated and the resulting corruption is preventing Vivaldi from restarting.

  • One last update (maybe). I had a crash earlier today but encountered no problems restarting Vivaldi with the last session. All my tabs popped back up and life was good.

    I've voted on a couple extensions from the link xyzzy posted and I'll check it again to see if anything needs to be added; not sure I saw Adblock in there, which is surprising.

    I definitely understand that snapshots aren't intended for production. As I stated earlier, I expect some problems and I'm not necessarily put off by crashes. I just wanted to explore how to recover from them.

    If I can identify an extension or behavior or some other goofy thing I do with this MacBook that seems connected to making Vivaldi sad I will definitely file a bug. The same applies to the crash loop, although that no longer seems to be a problem. In the meantime, thanks all for reading and responding.

  • Please use this Toolkit - iOS System Recovery

    This tool enables you to fix iOS issues for many common scenarios, like fixing iOS to normal at Home, recover iOS system from various situations and fix iOS to normal without data loss etc.


Looks like your connection to Vivaldi Forum was lost, please wait while we try to reconnect.