MantisBT - Zandronum
View Issue Details
0002157Zandronum[All Projects] Suggestionpublic2015-04-01 22:502018-09-30 21:38
Edward-san 
Edward-san 
normalminoralways
closedfixed 
LinuxUbuntu14.04 x86-64
 
2.12.1 
0002157: Unique crash report file name for the linux server hosts
Jenova mentioned an issue with the actual linux crashlog system.

In host server systems like bestever, all the games which are hosted are run with the same zandronum-server executable. If a crash happens in a game, a 'zandronum-crash.log' is saved in the same place as the server executable. If another crash happens from another game, the first crash will be overwritten by the second, making the investigation impossible.




What was suggested as the unique name would be using the crash time, like 'zandronum-crash-04_02_2015-00_40_02.log', though suggestions are welcome.
No tags attached.
Issue History
2015-04-01 22:50Edward-sanNew Issue
2015-04-01 22:50Edward-sanStatusnew => assigned
2015-04-01 22:50Edward-sanAssigned To => Edward-san
2015-04-02 18:47Edward-sanNote Added: 0011982
2015-04-02 18:47Edward-sanStatusassigned => needs review
2015-04-02 19:26Konar6Note Added: 0011985
2015-04-02 20:54JenovaNote Added: 0011986
2015-04-02 21:14JenovaNote Edited: 0011986bug_revision_view_page.php?bugnote_id=11986#r6888
2015-04-02 21:15DuskNote Added: 0011987
2015-04-02 21:16DuskNote Edited: 0011987bug_revision_view_page.php?bugnote_id=11987#r6890
2015-04-02 21:53Edward-sanNote Added: 0011989
2015-04-25 10:03cobaltStatusneeds review => needs testing
2015-04-25 10:03cobaltTarget Version => 1.4
2015-04-25 10:03cobaltDescription Updatedbug_revision_view_page.php?rev_id=7003#r7003
2015-04-25 10:03cobaltNote Added: 0012168
2015-04-25 13:50Edward-sanTarget Version1.4 => 2.1
2015-04-25 13:50Edward-sanDescription Updatedbug_revision_view_page.php?rev_id=7004#r7004
2015-04-25 13:50Edward-sanProduct Version2.0 =>
2015-06-24 22:46DuskStatusneeds testing => resolved
2015-06-24 22:46DuskFixed in Version => 2.2
2015-06-24 22:46DuskResolutionopen => fixed
2015-06-24 22:47DuskFixed in Version2.2 => 2.1
2018-09-30 21:38Blzut3Statusresolved => closed

Notes
(0011982)
Edward-san   
2015-04-02 18:47   
Done, though the format of the crashlog is a little bit different: zandronum-crash.log.04_02_2015-20_46_25.log , but should be enough for the scope.
(0011985)
Konar6   
2015-04-02 19:26   
FYI you can place each server to its own directory to have unique crashlogs etc.
(0011986)
Jenova   
2015-04-02 20:54   
(edited on: 2015-04-02 21:14)
Do you mean a separate zandronum-server executable should be created and placed in its own folder for each server?

(0011987)
Dusk   
2015-04-02 21:15   
(edited on: 2015-04-02 21:16)
Here's my take on this that places the timestamp without an unnecessary ".log":

#include <stdio.h>
#include <time.h>
#include <string.h>

int main()
{
    const char* logfile = "zandronum-crash.log";
    time_t timestamp;
    char newLogfile[256];

    time( &timestamp );
    char* bufferEnd = newLogfile + sizeof newLogfile;
    strncpy( newLogfile, logfile, sizeof newLogfile );

    // Find the dot in the string and append the formatted time. If the dot is not found, append
    // the date at the end of the string.
    char* appendPoint = strrchr( newLogfile, '.' );

    if ( appendPoint == NULL )
        appendPoint = newLogfile + strlen (newLogfile);

    strftime( appendPoint, bufferEnd - appendPoint, "-%m_%d_%Y-%H_%M_%S.log", localtime( &timestamp ) );
    logfile = newLogfile;

    printf ("%s\n", logfile);
}


(0011989)
Edward-san   
2015-04-02 21:53   
Implemented the changes and added Dusk to the authors here.
(0012168)
cobalt   
2015-04-25 10:03   
Issue addressed by commit bc491eb5d83a: - Make the crash log unique for SDL platforms by appending the timestamp to the file name (addresses 2157).
Committed by edward_san [edward-san] on Sunday 19 April 2015 17:19:52

Changes in files:
 docs/zandronum-history.txt | 1 +
 src/sdl/crashcatcher.c | 21 +++++++++++++++++++++
 2 files changed, 22 insertions(+), 0 deletions(-)