It's this module in particular. I looked it over in particular but Nim gives no hint what chokes the compiler:
const
LookupTable: array[512, int] = [
0x37, 0xC5, 0x60, 0x72, 0xCD, 0xA5, 0xB, 0x6, 0xD1, 0xF9, 0xCB, 0x3C, 0x57,
0xC, 0xD, 0x1B, 0x79, 0x1E, 0x2D, 0x72, 0xB4, 4, 0xB3, 0x60, 0xB2, 0x80, 0xDD,
0x89, 0xA0, 0xED, 0xF2, 0x84, 0x7C, 0xFA, 0xC4, 0x99, 0x9F, 0x27, 0xED, 0xDE, 0x6C,
0xDE, 0x1E, 0xB8, 0x48, 0x34, 0x64, 0x29, 0x76, 0xA5, 1, 0x86, 0x21, 0xB, 0xBF,
0xB0, 0x99, 0xED, 0x20, 0x2D, 0x75, 0x42, 0x4C, 0x6A, 0xC0, 0x75, 0x7E, 0x89, 0x33,
0, 0x65, 0x82, 3, 4, 0x93, 0x3D, 0x57, 0x4A, 0xAA, 0x2F, 0xA5, 0xD5, 0x74, 0xBD,
0xD7, 0x31, 0xDA, 0x83, 0x96, 0xE2, 0x18, 0x59, 0xEE, 0x20, 0x53, 0x24, 0x3D, 0x88,
0xAB, 0x77, 0x4A, 0x99, 0xB9, 4, 0xE1, 0xD3, 0x9D, 0xD0, 0x89, 0xBF, 0x89, 0x44,
0x32, 0x64, 0xC7, 0x2E, 0x93, 0x33, 0xD5, 0x6B, 0x29, 0x95, 0xBB, 0x3B, 0x82, 0x96,
0x3D, 0x60, 0x26, 0xD0, 0x84, 0x5B, 0x45, 0x5A, 0x8B, 0x4C, 0x5A, 0x3C, 0x5B, 0x8A,
0x58, 0x94, 0xB8, 0x9B, 0x13, 0xDB, 0x6B, 0xBE, 0x1A, 0xA, 0x60, 0x73, 0x74, 0x55,
0xE7, 0x59, 0xB0, 0xBA, 0x44, 0x76, 0xAC, 0xE2, 0x85, 0x16, 0xC4, 0x10, 0x53, 0x97,
0x38, 0xC0, 0xEE, 0xA8, 6, 0x42, 0xA9, 0x1B, 0xBD, 0xD2, 0x97, 0xE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
0xF8, 0x3D, 0x78, 0x81, 0x8C, 0xEC, 0x8B, 0xE7, 0xF1, 0x4B, 0xE8, 0x4A, 0xC9, 0xA,
0xF9, 0x1A, 0x6C, 0x56, 0x37, 0xB9, 0xBC, 0xEF, 0x45, 0xCC, 0xE3, 0xE3, 0xD7, 0x26,
0x67, 0xD6, 0x3A, 0xEE, 0x27, 0x5D, 0x7D, 0x89, 0xBF, 0x30, 0x11, 0x74, 0xF9, 0xAC,
0x80, 0xA, 0x73, 0xF2, 0x8C, 0x22, 0x55, 0x35, 0x9D, 0x80, 0x73, 0x84, 0x1B, 0xF3,
0xA1, 0xF2, 8, 0x59, 0x2C, 0x1E, 5, 0x75, 0x5B, 0xB0, 0xF, 0xE9, 0x94, 0xEB, 0x75,
0xD4, 0xE7, 0xEB, 0x4F, 0x6C, 0x36, 0xE5, 4, 0x31, 0x50, 0x6E, 0x1D, 0xB0, 0xC6,
0xC3, 0xE8, 0x31, 0x8E, 0xBD, 0x31, 0x31, 0xA2, 0x85, 0x97, 0x1E, 0xDF, 0xC1, 0xA7,
0x49, 0x35, 0xD4, 0xA0, 0x49, 0x8A, 0x40, 0x83, 4, 0xBD, 0x89, 0x34, 9, 0x6E,
0x8B, 0xB, 0x8A, 0xB, 0x9A, 1, 0xA9, 0x88, 0xEB, 0xB8, 0xC3, 0x23, 0x9E, 0x69, 0x63,
0xBE, 0x7C, 7, 0xE3, 0x11, 0x84, 0x17, 0xC7, 0xDA, 0x27, 0x51, 0x66, 0x85, 4,
0x62, 0x91, 0xDF, 0x13, 0x22, 0xB9
]
type
Point* = tuple
x: int16
y: int16
proc encode*(data: var string) =
var
rc: int16 = 0
b, last: char = '\0'
for i in countdown(data.len()-1, 0):
b = data[i]
data[i] = char(int(b) xor LookupTable[rc] xor int(last))
rc.inc()
last = char(int(data[i]) xor LookupTable[rc])
rc.inc()
proc decode*(data: var string) =
var
rc: int16 = 0
b, last: char = '\0'
for i in countdown(data.len()-1, 0):
b = data[i]
data[i] = char(int(b) xor LookupTable[rc] xor int(last))
rc.inc()
last = char(int(b) xor LookupTable[rc])
rc.inc()
when isMainModule:
var
s: string
s = "hello"
encode(s)
echo(s)
decode(s)
echo(s)
Alright, well I've uploaded a zip file of the entire code to my dropbox account
https://www.dropbox.com/s/a3atumgbhxukm3i/pserver-nim.zip?dl=0
Be sure to compile main.nim, as that's where the program is meant to be initialised.
I looked briefly at the project you posted, and I don't think the error is caused by the code you posted (in utils.nim) above.
I suspect the error is generated in rooms.nim. The last line in the const section includes:
RoomDescEndMsg* = newMessage(MessageId.RoomDescEnd)
Since it is in the const section, this is code executed at compile time. I didn't investigate it very well, but I suspect that there is a nil pointer exception in this part.
I guess that you need something like:
let
RoomDescEndMsg* = newMessage(MessageId.RoomDescEnd)
Yes, it would be handy to have some better error reporting. But it does give a hint:
Attempt to read from nil?
With the verbosity level set to 3, it also gives a rough idea on where to look:
nim c --verbosity:3 main.nim
...
rooms.nim(3, 1) Hint: 1149 [Processing]
SIGSEGV: Illegal storage access. (Attempt to read from nil?)
To have something initialized that never changes, is what let provides. const is similar, but for things that can already be calculated at compile time. I think that in this case, that calculation at compile time does a nil pointer access.
Mail a friend send me when I got this issue again Stam2192, the driver that is causing the issue is the teefer2.sys which is a Symantec Endpoint Protection drive.
Make sure you are using the latest Windows 7 certified version of Symantec Endpoint Protection but if you continue to have problems consider an alternative software.
Also, since you have ZoneAlarm installed consider that ZoneAlarm has also been known to cause other issues in some 64-bit Windows 7 installations: