Skip to content

Sauko22/Crash-Report

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Crash Reports

I am Pol Juan Santos, student of the Bachelor’s Degree in Video Games by UPC at CITM. This content is generated for the second year’s subject Project 2, under supervision of lecturer Marc Garrigó.

Index

1. What is a Crash?

2. What is Crash Reporting?

3. Crash dump and Minidump files

4. How to create a dump file in Visual Studio?

5. How to make our own Crash reporter?

6. Bibliography

What is a Crash?

We call crash when a computer program such as a videogame, app or any kind fo software stops functioning as normal and exits. This is because the application performs an operation that is not allowed to do. Then, the operating system shuts down the program and triggers a exception or signal indicating what was the reason the crash was produced. Typical causes include incorrect address values in the couter of the program, buffer overflow, accessing invalid memory addresses or attempting to execute machine instructions with bad arguments. In order to fix a crash, the code must be debugged, which is the process of finding and fixing the faulty code which caused the crash so the program can run smoothly again. Then, we should report the crash to get it fixed by the company.

Crash to desktop

A crash to desktop occurs when a program(usually videogames) unexpectedly quits,abruptly taking the user back to the desktop. Most of the time, an exception is no displayed , leaving the user without knowing what was the problem. Many times there is no apparent action that causes a crash to desktop. During normal function, the program may freeze for a shorter period of time, and then close by itself, or it may appear to be triggered by a certain action, such as loading an area.

Example

* League of Legends

* Overwatch

What is Crash Reporting?

Is a system software whose main function is to identify reporting crash details and to alert when there are crashes.In them we can find data about he problem such as stack traces, type of crash version of the sofware we are using and general system info. These reports help sofware developers(webs,videogames,apps) to seek and fix the underlying problem causing the crashes. They may also contain sensitive information such as email addreses, users names and passwords, and so have become objects of priority security in the field of computer security.

* Minecraft crash reporter

Implementing crash reporting tools as an esencial part of the development cycle has become an obligation,thanks to the commodity that gives. Not only for issues dicovery, but making your workflow easier. That's the case of Sentry, an open-source company, providing an application monitoring platform that helps you identify issues in real-time.Very used in Unreal and an excellent tool.

Sentry

But,how it works? Let's see an example: There’s a bug — let’s say it’s a NullPointerException — that users start hitting post-deployment. Sentry picks up the error immediately and alerts you (or whoever is on-call) via Slack, PagerDuty, or one of many other integrations based on your notification rules.

This notification takes you to a dashboard that gives you the necessary context to quickly triage the problem — frequency, user impact, which part of the code is affected, and which team member is a likely owner for the issue (just like Github issues). Then it shows you detailed information to help you debug, like the stack trace, stack locals, preceding events, commits that likely caused the issue, type of the exception and custom data captured at the time of the error. You can also automatically start tracking the issue in your project management tool. After identifying the problem you commit a fix to the repository. At this point, you no longer need to on alert about the fix because Sentry watches commits as they go in and automatically resolves the issue when it gets deployed. If the issue returns later, it’s marked as a regression and you’re notified again.

Meanwhile, the user who encountered the error didn’t even need to send you a message to help you fix the bug. Notably, though, Sentry can also offer those users a friendly way to send additional information that might help you resolve the issue even faster.

Crash dump and Minidump files

However, let's get back on crash reporting. We could compare a crash report as a Blackbox, and its application as an airplane.

Blackbox records all vital information so when the application crash, you can easily find the reason, in this case:

  • Error type
  • Callstack
  • Register Contents
  • General system info(CPU,memory,OS,etc)
Messages aren’t displayed anywhere, so users aren’t bothered, they don’t even know it’s happening. What to record? Well, it’s up to you. In our case, name of loaded resource, would surely be a good bet. This way, on crash all you have to do is to check latest blackbox messages (for thread that crashed). But, what are these blackbox messages? Well, would be talking about Crash Dump and Mini Dump files.

Crash Dumps

Crash dump or memory dump consists of the recorde state of the working memory of a program at a specific time, generally when that one has crashed.In practice, are used to assist in diagnosing and debbugging errors. Other key pieces of program state are usually dumped at the same time, including the processor registers, which may include the program counter and stack pointer, memory management information, and other processor and operating system flags and information. A snapshot dump is a memory dump requested by the computer operator or by the running program, after which the program is able to continue.

MiniDumps

Minidumps are files containing the most important memory regions of a crashed process. When the process crashes, the minidump is written to the user’s disk. A minidump typically includes:
  • The runtime stack of each thread that was active during the time of the crash. This allows yout to reconstruct stack traces for all stacks and even infer variable values in some cases.
  • Thread contexts – that is, register values – at the time of the crash. This is especially relevant for stack walking.
  • The crash reason and an optional memory address associated to with the crash. For example, memory access violations. In the case of assertions, the assertion message is also included in the dump.
  • Meta data about the CPU architecture and the user’s operating system.

MiniDump files may or may not have heap information.

  • Dump files with heaps contain a snapshot of the app's memory, including the values of variables, at the time of the dump.
  • Dump files without heaps are much smaller than dumps with heaps, but the debugger must load the app binaries to find symbol information. The loaded binaries must exactly match the ones running during dump creation. Dump files without heaps save the values of stack variables only.

How to create a dump file in Visual Studio?

Now that we know what dump files are used for, let's used them on visual studio. While you are debugging a process in Visual Studio, you can save a dump when the debugger has stopped at an exception or breakpoint. Before we start, you need to have Just-In-Time Debbugging enable,that allow you to attach the Visual Studio debugger to a crashed process outside of Visual Studio, and then save a dump file from the debugger. Attach to running processes

To save a dump file

  • While stopped at an error or breakpoint during debugging, select Debug > Save Dump As.
  • In the Save Dump As dialog box, under Save as type, select Minidump or Minidump with Heap (the default).
  • Browse to a path and select a name for the dump file, and then select Save.

Open a dump file

  • In Visual Studio, select File > Open > File.
  • In the Open File dialog box, locate and select the dump file. It will usually have a .dmp extension. Select OK.
The Minidump File Summary window shows summary and module information for the dump file, and actions you can take.

If you press debug Native Only, it will send you to where the problem or the breakpoint produced the crash.

How to make our own Crash reporter?

So ,there you have it. You now know all the basic about crash report, and how to use it in visual studio. But, can we make a crash reporter for our own videogame? Well, it is posible to do it. Down below you can read an article done by a programmer from The Witcher, explaining how was his experience proggramming one, talking about what we just saw but in action and giving some advices about the topic.

Crash handler/reporter (Win32) by Maciej Sinilo

Bibliography

About

Personal Research done by Pol Juan

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors