It is currently 19 Apr 2024, 18:36
   
Text Size

Stack trace explained or What to do with dump files

Discuss Upcoming Releases, Coding New Cards, Etc.
PLEASE DO NOT REPORT BUGS HERE!

Moderators: BAgate, drool66, Aswan jaguar, gmzombie, stassy, CCGHQ Admins

Stack trace explained or What to do with dump files

Postby FastEddie » 02 Aug 2020, 16:24

This paper describes what the dump.dmp files are good for and how to use them.

Summary and quick start
Once in a while Manalink shows a message to inform us about a function call that didn‘t go as expected, for example get_card_instance(1, -1). The dump.dmp file provides us the information which function was the culprit. It consists of an error message („bad parameters“), what went wrong („get_card_instance(1, -1)“) and the way the program took in the form of a stack trace. If you don’t want details this section is all you need. If you want to look under the hood, read the whole thing.

Without going into too much detail, a stack trace is the call order of functions with the last function at the top, when things went haywire. So if you know who called whom you can work backwards and see where the actual bug happens. Fortunately, some friendly programmer provided us with a perl script called dmp.pl in the main directory where also ManalinkEh.dll resides. It worked for me under the Linux Subsystem for Windows. Might as well under MinGW64 but I didn’t test this. To get it going do as follows:

Install perl and the package libcapture-tiny-perl. Under the Linux Subsystem enter

sudo apt install perl
sudo apt install libcapture-tiny-perl

in the command line and the packages will install. Fix the path to Magic-trace in line 33, Easiest thing to do is to set it to ‘./Magic-trace.c’ as both are in the same folder.
Say you dump file is in the same folder and called dump_23_v3.dmp. Then run it with

./dmp.pl ../bugs/dump_23_v3.dmp

You get an output like this:

Output_dmp.pl.png


At the top is the actual error message in turquoise. The yellow functions belong to the dll and are shown with file name and line number. Turquoise functions lower on the screen are from the exe. There we don’t have line numbers, unfortunately. The grey functions (actually the addresses in hex code) are system calls.
Attachments
stackTrace.zip
A demo program explaining the stack trace mechanics
(1.02 KiB) Downloaded 215 times
dump.zip
A demo dump for testing
(399 Bytes) Downloaded 209 times
StackTrace explained.pdf
The paper
(86.15 KiB) Downloaded 253 times
---
Argivian Archaeologist in the Library of Leng studying the Spells of the Ancients
User avatar
FastEddie
 
Posts: 246
Joined: 24 Dec 2019, 10:59
Has thanked: 15 times
Been thanked: 19 times

Return to Development

Who is online

Users browsing this forum: No registered users and 28 guests


Who is online

In total there are 28 users online :: 0 registered, 0 hidden and 28 guests (based on users active over the past 10 minutes)
Most users ever online was 4143 on 23 Jan 2024, 08:21

Users browsing this forum: No registered users and 28 guests

Login Form