This module dumps the lua stack if the server segfaults.
It also allows you to define a crash handler in lua able to inspect the stack and write to the dump file.
Read lua/gcrash.lua for information on function behavior.
The dump format is a simple text file containing a stack trace and any extra data generated by the crash handler. Dump files are saved under garrysmod/gcrash/ with a name containing the date and time of the crash.
Get the released (or build from source) gmsv_gcrash_linux.dll and put it in
SERVER_ROOT/garrysmod/lua/bin/, You may have to create the bin folder.
If you want to use the default lua handler, you can put gcrash.lua in lua/autorun/server/.
If you wish to build the module yourself, the build files are included in this repo.
- Get
premake5and place it next toBuildProjects.bat - Acquire an up-to-date version of
lua_shared.soand copy it tolibs/garrysmod/bin(32 bit) orlibs/bin/linux64(64 bit) - Run
premake5 --os=linux gmake2 - CD into
projects/linux/ makeoptionally withconfig=(debug|release|debug64|release64)- Output is
build/gmsv_gcrash_linux.dllorbuild/gmsv_gcrash_linux64.dll(the makefile renames the created .so to the GMod module format)
Windows is not yet supported.
- Improve the default lua handler