How do I debug a tab crash in Google Chrome - debugging

We have a single page application that randomly crashes the whole browser tab. I observed the memory for more than an hour but it wasn't increasing and everything looks just fine. Than out of a sudden after some more time passes, the tab crashes.
I looked for a crash dump in
C:\Users\cburgdorf\AppData\Local\Google\CrashReports
but the Chrome-last.dmp is totally outdated. Is there any place where I can look for additional information about the crash? Not to mention it's a hard to reproduce beast.
I wonder if I could start Chrome with windbg attached and wait (2 hours or so sigh) for the tab crash. Would that work?
UPDATE
All of you gave good answers and provided valueable advice for bug hunting. In the end I was able to reproduce the bug and get a clear crash dump using the following steps:
1.) windbg.exe -o chrome.exe
2.) reproduce crash
3.) .dump /ma C:\Path\To\A\CrashDump\File.dmp (as Paul pointed out)
4.) end session and load the crash dum with windbg
5.) use !analyze -v to extract valuable information

Once WinDbg breaks in, use this command to create a full crash dump:
.dump /ma C:\Path\To\A\CrashDump\File.dmp

If you want analyze only specific tab, you should follow below steps.
Open Chrome's Task Manager (View Background Pages option in menu).
Right click on grid and activate Process ID column.
And attach windbg to this pid.

Follow the instructions on http://www.chromium.org/for-testers/bug-reporting-guidelines/reporting-crash-bug to report the renderer crash so the Chromium developers can debug it.

Could you try to use firebug in chrome and give me a log?
http://getfirebug.com/wiki/index.php/Command_Line_API
upd. you need launch chrome with debug option.
--enable-logging --v=1

Related

Firefox: debugger: does not stop at breakpoints

There seem to be a lot of postings about this class of problems. Perhaps there is a Mozilla forum where I can ask about this, instead of here?
In my case, I can set breakpoints easily and I can see that they are set. But they are not hit when I refresh the page. Instead, an exception I throw (occurring after the breakpoint) is caught.
EDIT: I found an obscure icon near the top of the window to activate and deactivate the breakpoints! I enabled the breakpoints, but now the page is infinitely looping in some of the debugger's own code and reporting "Paused on exception SyntaxError: '*,:x' is not a valid selector."
I was using the debugger for a Web Extension. Did that put it in a strange mode for regular debugging? How would I get out of this mode?
Question Firefox debugger breakpoint not working did not help me.
This is an old post, but I recently had the same issue and decided to share my solution with the world.
I'm on Firefox 89.0.2 and recently noticed that the debugger does not stop at breakpoints. Completely removing my profile directory and restarting Firefox solved the issue.
To find out the location of your profile folder check the following page from Mozilla: https://support.mozilla.org/en-US/kb/profiles-where-firefox-stores-user-data

Linking Windows Debugger to Project

i coded a big project that runs when I open it in Debug or Release Mode, but when i open it without Debugging (ctrl + f5) it crashs. I searched a long time to find the heap error, but didnt find anything. The problem is i need the running .exe of the programm, so i wanted to ask if there is a possibility to link the windows debugger to the .exe so it always starts with it.
If it doesn't crash right away, maybe this helps:
You can run the executable.
Open your solution in visual studio. Make sure it's the same build.
Open the DEBUG menu and click attach to process.
A window will open, listing all processes that are running. Select the executable that's crashing
Click the DEBUG menu again and select Exceptions (ctrl-alt-E)
Make sure the checkbox "Thrown" is checked for Common Language Runtime Exceptions
Now crash your application.. It will halt at the line that causes it.
Also look for environment directives. like #IF DEBUG #END IF. or #IF RELEASE That kind of stuff. Tricked me a couple of times too..
Good luck. Hope this helps!
You can do various things. First make sure you have a "big out try block" in main. i.e. put the main logic in a try can catch exceptions and report these clearly. This probably isn't what's happening in your case.
You can attach a debugger - including Visual Studio, to a running process - see the "Attach to process" option under the debug menu. If it's built with debug symbols, which you can do, even for release code this may help. If it's optimised you may find it difficult though.
Finally, you could generate a crash dump and inspect that after it's failed. See docs on MiniDumpWriteDump. There are several examples on its usage. Or you can install an abort handler: See here. This mentions _set_abort_behavior which if invoked with _CALL_REPORTFAULT will generate a crash dump too.

debug disassembled dylib with hopper?

Is there a way to connect gdb to hopper, then load a dylyb that is loaded by an app and then run the app while stepping through the dylib code? is there a way to do this?
Today (2020) actually you can debug dylibs by opening them in a separate window before starting debugger. When you go back in the callstack window it shows the actual code in the window of dylib. You can also place breakpoints and do whatever you want in it.
For debugging to work you should remove the codesigning of the main executable.
I asked the developer and got a reply indicating that this feature (debugging a dylib), is not available in the current version.
The best way to go for now seems to be to use the available tools to find the right place to edit the code and then reassemble it.

Debug problem occurs sometimes in Silverlight when in Chrome

I am using a dedicated test SL web application that hosts SL object I am debugging.
I am debugging using basic F5 and use browser Google Chrome. Sometimes a bug happens, how I reproduce it.
I was running build->debug like 100 times already, but then I made a mistake that caused StackOverflowException and happened in main page constructor and afterwards when I rebuild and hit F5 it says no symbols have been loaded. Note that NOTHING has changed , I use the same 2 buttons combinations rebuild solution-> start debugging.
In order for debug to continue to attach I need to close XAML main page , open it again (in visual stuido) and hit rebuild ->f5 again, afterwards it works fine. (found this solution after SOME time)
I am not sure whats bugged but it appears to be a bug somewhere in SL to me.
Question is - whats going on maybe someone can explain.
This sounds more like Chrome's isolation mode for plug-ins. Generally speaking it's best to manually attach to the Chrome process that is running Silverlight (which isn't always one VS attaches to when pressing F5).
Actually error was super simple, I wasn't understanding how "exactly" xap works, it was a little more magical to me than it is. I just needed to rebuild & clear cache in browser ( chrome in this case) to attach successfully. For some reason I thought that local version doesn't require clear cache call.
Actually chrome is pretty bad to debug silverlight so I recommend IE for this sole purpose, sometimes debugger simply fails to attach to chrome, in that case you usually need to do this by attach to process - choose chrome with silverlight name there.

What is the best way to debug a crashing explorer.exe?

I work for an orginization that has a custom built Access/SQL Application running in house. We have a problem Explorer.exe throwing an error and crashing.
This is a picture of the crash:
What is the best way to start tracking this problem down and finding a solution ?
Make sure WinDBG is installed, set it up as the default debugger then use Analyze and get a crash dump.
The next time you get that dialog click "OK" to attach in WinDbg
Keep in mind that if you attach a debugger to explorer, then break, that you should not try to do anything in the debugger that invokes a call to explorer or you will deadlock the debugger. This can be surprisingly tricky as it means you cannot open a "File Open" dialog, print, browse to another computer and any number of other things.

Resources