Complete.Org: Mailing Lists: Archives: freeciv-dev: September 2002:
[Freeciv-Dev] Re: concerning the use of assert
Home

[Freeciv-Dev] Re: concerning the use of assert

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: "Per I. Mathisen" <per@xxxxxxxxxxx>
Cc: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: concerning the use of assert
From: "Per I. Mathisen" <per@xxxxxxxxxxx>
Date: Sun, 1 Sep 2002 16:45:21 +0000 (GMT)

On Sun, 1 Sep 2002, Per I. Mathisen wrote:
> How about a function which can be called instead of assert, and which
> writes a bug report to file then creates a savegame to match, and finally
> notifies the player that a bug was detected and that he/she should send
> the bug report in to us.

And here is a proof of concept patch. It does not implement any fancy
"let's try call gdb" stuff but it works, and it should be possible to use
on civserver.freeciv.org. error(FALSE) will send us a text saying

        Server error detected: FALSE
        srv_main in srv_main.c line 1835

and a corresponding savegame which will hopefully be helpful in
reproducing the error. The server use will see this:

"
    *** Server error detected! ***
  Error in srv_main in srv_main.c line 1835
  The check was: FALSE
  The error has been dodged and a savegame will be created.
  Please send it along with this message to bugs@xxxxxxxxxxxxxxxxxxx!

Game saved as error.sav.gz
"

I've not made use of __DATE__ or made a client version of this function
yet, and I intend to see if there is a way to get a backtrace still.

Please read and comment.

Yours
Per

"I don't see why people are so upset about cloning sheep. American
television networks have been doing that to their audiences for years."
-- Jello Biafra

Attachment: error1.diff
Description: Text document


[Prev in Thread] Current Thread [Next in Thread]