Important Dates

Currently Online

Latest Posts

Topic: gdb backtrace easy way

Tibor
Joined: 2009-03-23, 23:24
Posts: 1317
Ranking
One Elder of Players
Location: Slovakia
Posted at: 2017-10-07, 22: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, 22:52

Top Quote
GunChleoc
Avatar
Joined: 2013-10-07, 15:56
Posts: 3159
Ranking
One Elder of Players
Location: RenderedRect
Posted at: 2017-10-09, 21: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
Joined: 2009-03-23, 23:24
Posts: 1317
Ranking
One Elder of Players
Location: Slovakia
Posted at: 2017-10-09, 21:41

I was thinking about this...

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


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

Thanks! Proofreading done face-smile.png


Busy indexing nil values

Top Quote
kaputtnik
Avatar
Joined: 2013-02-18, 20:48
Posts: 1802
Ranking
One Elder of Players
Location: Germany
Posted at: 2017-10-16, 23: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.


Top Quote
Tibor
Joined: 2009-03-23, 23:24
Posts: 1317
Ranking
One Elder of Players
Location: Slovakia
Posted at: 2017-10-17, 07:40

Good point. I updated the wiki accordingly.


Top Quote