Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upAdd: List recently executed commands in crashlog output. #7366
Conversation
This comment has been minimized.
This comment has been minimized.
I don't see any way for the CLEF_CMD_FAILED or CLEF_GENERATING_WORLD flags to become set? |
This comment has been minimized.
This comment has been minimized.
Could this leak passwords or other personal data? |
This comment has been minimized.
This comment has been minimized.
Company passwords aren't game commands, but part of the network protocol itself. Server connection passwords aren't game commands either. The command log could contain any string entered for things like vehicle names, group names, signs, etc., i.e. nothing that wouldn't also be stored in the savegame. |
This comment has been minimized.
This comment has been minimized.
CLEF_CMD_FAILED and CLEF_GENERATING_WORLD are handled at src/command.cpp:398-399. This does not store text/strings, as these are rarely of any use for debugging. It only stores a flag indicating the presence of a non-empty text parameter. Passwords and (private) personal data should not go via DoCommandP calls as these are replicated to all clients in multiplayer. |
CLEF_MY_CMD = 0x20, ///< locally generated command | ||
}; | ||
DECLARE_ENUM_AS_BIT_SET(CommandLogEntryFlagEnum) | ||
typedef SimpleTinyEnumT<CommandLogEntryFlagEnum, byte> CommandLogEntryFlag; |
This comment has been minimized.
This comment has been minimized.
nielsmh
Mar 12, 2019
Contributor
I think C++11 enum base type declarations are acceptable to use now, i.e. declaring enum: CommandLogEntryFlag : byte { CLEF_NONE ... };
so separate enum and storage types are not required.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
@JGRennison How useful is this actually in resolving issues? Any examples where this has been the primary lead? |
This comment has been minimized.
This comment has been minimized.
Removed "backport requested" as I think we should not add new code to RCs. This could potentially do more harm than good. Lets run this in 1.10, and bring it in from there. |
This comment has been minimized.
This comment has been minimized.
@nielsmh It's been quite useful in debugging desyncs and crashes/assertion failures involving map or data structure corruption. What commands were recently executed usually provides a big clue as to the cause of the issue. Generally when I receive a crash log I look at: the crash reason lines, scope logging lines, which thread it is, the decoded stack traces, which OS/compiler, AI/company config, the command log and if relevant the game date and lang, blitter, font config. The rest of it is rarely of any use. |
This comment has been minimized.
This comment has been minimized.
Is there a way to make this log AI commands as well? |
This comment has been minimized.
This comment has been minimized.
AI commands are as human commands usually, so they are probably already included in the log. |
This comment has been minimized.
This comment has been minimized.
@glx I thought so but my crashlog only contained AI startup control commands |
This comment has been minimized.
This comment has been minimized.
Ok, AI uses |
Maintain a circular buffer of info on recent commands.
1f92324
to
6925569
This comment has been minimized.
This comment has been minimized.
The flags are now all set in one place. I've moved the logging point to be within DoCommandPInternal, this does change the semantics a bit. |
No clue why GitHub didn't dismiss the review .. all is fixed as far as I can tell
CLEF_MY_CMD = 0x20, ///< locally generated command | ||
}; | ||
DECLARE_ENUM_AS_BIT_SET(CommandLogEntryFlagEnum) | ||
typedef SimpleTinyEnumT<CommandLogEntryFlagEnum, byte> CommandLogEntryFlag; |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Hi, there's been no activity on this for nearly 4 months. If this PR is not updated in the next week or so, it will be closed |
JGRennison commentedMar 11, 2019
This maintains a circular buffer of info on recent commands, and adds a section to the crash log.
This is useful for providing context and further information of what was occurring shortly prior to a crash.