aidansteele / sph

MIT License
9 stars 1 forks source link

sph crashes #2

Open genotrance opened 7 years ago

genotrance commented 7 years ago

Tried with Nim 0.17.3 (head) and 0.17.2 (stable).

import sph

echo sphHash[SHA256]("hello")
0x0048c3ce in @sphInit_YOcaykWowV7adm11AQD02Q@0 () at /.nimble/pkgs/sph-0.1.1/sph.nim:177
177       result = ctx

(gdb) bt
#0  0x0048c3ce in @sphInit_YOcaykWowV7adm11AQD02Q@0 () at /.nimble/pkgs/sph-0.1.1/sph.nim:177
#1  0x0048c446 in @sphHash_SEYwmCzjJRP9cWELpVguyxQ@4 (data=0x4a4654 <TM_earX20ePV9cxitomwdUMS7g_2>)
    at /.nimble/pkgs/sph-0.1.1/sph.nim:180
#2  0x0046fea8 in NimMainModule () at C:/Dropbox/Private/github/hash/t.nim:3
#3  0x0046fd8d in NimMainInner () at /.choosenim/toolchains/nim-#head/lib/system.nim:2829
#4  0x0046fdb2 in NimMain () at /.choosenim/toolchains/nim-#head/lib/system.nim:2837
#5  0x0046fddd in main (argc=1, args=0xde2310, env=0xde1888) at /.choosenim/toolchains/nim-#head/lib/system.nim:2844
genotrance commented 7 years ago

Another variant.

import sph

var s: SHA256

s.sphInit()
*** endb| >>run
Traceback (most recent call last)
a.nim(5)                 a
lib\core\macros.nim(371) sphInit
SIGSEGV: Illegal storage access. (Attempt to read from nil?)