Latest Posts

Topic: gdb backtrace easy way

Tibor

Topic Opener
Joined: 2009-03-23, 22:24
Posts: 1377
Ranking
One Elder of Players
Location: Slovakia
Posted at: 2017-10-07, 21:51

Hi,

This is to share with you an easy way how to get backtrace in case of crash on Linux, without deeper understanding how gdb tool works.

Just use command like this:

gdb -batch -ex "run" -ex "bt" ${widelands binary with path if needed} > ${log with gdb output} 2>&1

So the entire command can look like:

gdb -batch -ex "run" -ex "bt" ./widelands >> gdb.log 2>&1

So this will start the game, just play as usual and if game crashes, the file gdb.log will contain all console output including gdb backtrace at the end of file. Than you can provide it as a part of bug report.

Edited: 2017-10-07, 21:52

Top Quote
GunChleoc
Avatar
Joined: 2013-10-07, 14:56
Posts: 3324
Ranking
One Elder of Players
Location: RenderedRect
Posted at: 2017-10-09, 20:03

I think we should have this on https://wl.widelands.org/wiki/How%20to%20Write%20a%20Good%20Bug%20Report/ face-smile.png


Busy indexing nil values

Top Quote
Tibor

Topic Opener
Joined: 2009-03-23, 22:24
Posts: 1377
Ranking
One Elder of Players
Location: Slovakia
Posted at: 2017-10-09, 20:41

I was thinking about this...

I added there item 6, please review it....


Top Quote
GunChleoc
Avatar
Joined: 2013-10-07, 14:56
Posts: 3324
Ranking
One Elder of Players
Location: RenderedRect
Posted at: 2017-10-14, 16:54

Thanks! Proofreading done face-smile.png


Busy indexing nil values

Top Quote
kaputtnik
Avatar
Joined: 2013-02-18, 19:48
Posts: 2439
OS: Archlinux
Version: current master
Ranking
One Elder of Players
Location: Germany
Posted at: 2017-10-16, 22:39

I want to suggest to add a ' LC_ALL=C' at the beginning of the command, to overwrite current localization:

LC_ALL=C gdb -batch -ex "run" -ex "bt" ./widelands >> gdb.log 2>&1

Otherwise on my system the output may contain unrecognized characters.


Fight simulator for Widelands:
https://wide-fighter.netlify.app/

Top Quote
Tibor

Topic Opener
Joined: 2009-03-23, 22:24
Posts: 1377
Ranking
One Elder of Players
Location: Slovakia
Posted at: 2017-10-17, 06:40

Good point. I updated the wiki accordingly.


Top Quote