Up to Main Index                              Up to Journal for July, 2017

                      JOURNAL FOR MONDAY 31ST JULY, 2017
______________________________________________________________________________

SUBJECT: Data race fixes are out…
   DATE: Mon 31 Jul 20:04:16 BST 2017

Since the last journal entry there has been interest in my debugging ‘tool’
and people asking if I will be releasing it. At the moment I’m not sure. The
main reason being that it uses goroutine IDs and gouroutine local storage to
track locking — a huge no-no. It’s also very inefficient. The argument could
be made that it’s only for debugging so that’s okay. But is it really okay?

The code is inefficient because it parses runtime.Stack data a lot to get the
goroutine ID. This in itself is a terrible idea, the format of the data could
change in future Go releases. It could be improved, I’ve seen examples written
in C and Go assembler to get the goroutine ID for example. Using the goroutine
ID for anything is generally regarded as a really bad idea in the first place.

I can see now that it might be a useful tool for other people working with
WolfMUD. Debugging data races and locking is not an easy task.

If I did release the code I would change what I currently have to use a build
tag so that it’s not compiled in by default. I’d also have to clean the code
up quite a bit as well as it was intended as a quick hack for myself only.

In the meantime I have been using my new tool to fix various data races. I
might not have found them all yet, but the code I have is greatly improved. I
have therefore pushed out some long awaited updates to the public dev branch.
I am also putting together the long awaited v0.0.7 release.

In the meantime if anyone sees any data race reports with the new code please
send them my way: diddymus@wolfmud.org

The easiest way to capture the server log is to append ‘> server.log 2>&1’ to
your usual command. For example:


  For Unix like systems:
    ./server > server.log 2>&1
    ./server ../src/code.wolfmud.org/WolfMUD.git/data > server.log 2>&1

  For Windows:
    server.exe > server.log 2>&1
    server.exe ../src/code.wolfmud.org/WolfMUD.git/data > server.log 2>&1


The first example is for running from a binary download, the second is for
running when compiling from sources. Paths may vary depending on your setup.
This also results in a simple text file for emailing. Alternatively you can
send a cut’n’paste from the terminal or a screen shot :)

Feel free to anonymise the IP addresses, account hashes and other information
in the log.

--
Diddymus


  Up to Main Index                              Up to Journal for July, 2017