status-im/nim-drchaos

Tests fail with the default GC in drchaos/common.nim:304:243 and mutator.nim:464:28

planetis-m opened this issue · 4 comments

Both are caused by nil pointers. For the first one I made a bug report in nim-lang/Nim#20278

Case object transitions are actually the culprit for the second. The only way to fix this is:

  var kindTmp = tmpSym.kindSym
  mFunc(kindTmp)
  when defined(gcDestructors):
    {.cast(uncheckedAssign).}:
      tmpSym.kindSym = kindTmp
  else:
    tmpSym = (typeof tmpSym)(kindSym: kindTmp)

The test run but the default gc may report misaligned address errors, i.e:

Nim/lib/system/gc_common.nim:394:33: runtime error: load of misaligned address 0x7ffd3bd64404 for type 'void *', which requires 8 byte alignment

It's also incorrect (previous fields are ignored). -d:nimOldCaseObjects caused even more errors. The only thing that works is --mm:arc/orc.

Documented in the readme.

ba0f3 commented

I also getting this error with Nim 1.6.6: /nim-drchaos/drchaos/common.nim(88, 32) Error: expression has no address; maybe use 'unsafeAddr'

Thanks for reporting this is fixed in v0.1.4