49

Does anybody know if there is a practical way to determine the cause of the "Aw Snap!" message that occasionally appears on Google Chrome? Does Chrome have an error log I can refer to? I'm suspecting this issue is caused by a recursive loop in the code which is then swallowing up all the memory? Is there any way I can confirm this?

2

5 Answers 5

36

There is, see explanations here: for ordinary logging in Chrome, you could try:

7
  • 2
    I think the first option will help isolate this problem. The dev console hangs before it can output anything of use.
    – QFDev
    Jun 14, 2013 at 9:02
  • 4
    I enabled the log and upon chrome crash, it didn't logged any error at the time of crash. Is there any reference that could provide insights into the log items?
    – Khadim Ali
    Jan 25, 2016 at 13:49
  • Is this chromium page about logging.h what you want?
    – vinnief
    Jan 26, 2016 at 20:32
  • 2
    Could you please include the abbreviated content of the links in this answer. It will go stale if the links die.
    – mafu
    Aug 6, 2016 at 1:16
  • 4
    The Javascript console is usually not useful in this case, as the dev tools disconnect when the page crashes. Jul 17, 2017 at 15:48
37

The offical Chrome Developers Twitter account linked to a website which helps you to debug the "Aw snap" pages: http://www.chromium.org/for-testers/enable-logging

The recommendation is to launch Chrome with these flags:

--enable-logging --v=1

If you do that, then you can grab a crash log from the file chrome_debug.log in Chrome's user data directory (in the parent directory of Default/) or in the binary build folder (out\Debug) if you are using a debug build.

1
  • 8
    upvote because this post mentioned --enable-logging --v=1 long before the edit to the accepted answer added it.
    – CAD bloke
    Jan 13, 2017 at 22:31
5

The Aw, Snap! page is usually related to process segmentation fault crash which could be related to the software bug. To determine the cause, you can enable logging (as suggested in other answers) or analyse the backtrace of the core dump file (on macOS, Linux, e.g. Ubuntu).

If you don't know the cause (e.g. stack trace consist only memory addresses), you can create a new support ticket at the Chrome bug tracking system (or double-check whether there is one already). While reporting, you should upload and include Crash ID by going to chrome://crashes/ page, so memory addresses can be translated into debug symbols by the Chrome maintainers.

Alternatively you can decode crash dumps yourself.

See also: Where is Google Chrome Crash Dump Located?


To simplify above, here are the main reasons why the page can crash:

  • You have found the bug (either on the website or with the web browser it-self).

    • Website bug

      • Example: JavaScript VM reached the maximum allocated memory (out-of-memory crash).

        To check that, run DevTools and check the Memory tab. If that's the case, the code should automatically pause just before the potential out-of-memory crash (e.g. Issue 810015). If so, report the problem to the website owner, or profile the JS code to find the bug.

    • Browser bug

      • Consider disabling extensions or run in Incognito mode.
      • Consider removing cached files.
      • Report a bug.
      • Re-install the browser.
      • Use a different version of Chrome such as Chromium, Dev or Canary channel.
      • Use different browser such as Epic, Firefox, Opera, Brave, Waterfox, Torch or other.
      • If issue is repeatable, you can try to re-compile Chrome sources with debug symbols and analyse the stack trace or report it.
  • You've reached the maximum open files in your system (see: #787381).

    On Linux/Unix/macOS, to verify that, run:

    sysctl -a | grep files
    

    and check whether kern.num_files reached the limit of kern.maxfiles.

    If that's the case, increase the limit by running the following commands:

    sysctl -w kern.maxfiles=20480
    which launchctl && launchctl limit maxfiles 65536 unlimited
    which ulimit && ulimit -c unlimited
    
  • You could have some malware/virus which alters your Chrome files causing the crash.

  • You could have some hardware memory-related issue. So run some test (such as memtest).

macOS

To display logs from Chrome, run:

log stream --level debug --predicate 'processImagePath contains "Google"'

or by running Console app, where you can also check for any crash dumps (or check in ~/Library/Logs/DiagnosticReports). See: Debug “Aw, Snap!” error in Chrome


Debugging

If none of above helps, you can consider compiling Chrome from the source (takes a long time), then run directly from the Terminal. After that, each “Aw, Snap!” error should be followed by the full stack trace including functions and line in the source code file where it happened.

1

On an Android where I did not have the startup logging flag option I found it useful to record a Performance Profile in the DevTools.

It showed me the last javascript function call made before the Aw Snap.

It turned out document.innerHtml threw an uncaught string allocation error of some sorts on a large div...

1
  • When the Aw Snap happens my dev tools disconnect and I lose my Performance Profile, how did you keep it?
    – eri0o
    Apr 26, 2021 at 19:52
0

I'm a web developer and I cant wait for all my customers to update Google Chrome, so.. We have been debugging this issue and founded a solution!

Seem to be a CSS simple-to-fix problem. Seems that in some version of Chromes update's they have forbidden some html TAGs to have BEFORE and AFTER contents. One of this tags is Fieldset. Our team didnt find any other, but removing a fieldset:before{ content: ''; ... } solves the problem immeadiatly!

If you found any others TAGS please post it here. If you having the same problem, search your CSS code for :before and :after statements, should be easy to fix.

Recently added here: https://stackoverflow.com/questions/69161461/google-chrome-status-access-violation-error/69161462#69161462

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .