-
Notifications
You must be signed in to change notification settings - Fork 259
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bump nim-serialization to potentially solve #435 #436
Conversation
Raised status-im/nim-serialization#11 for a loadFile smoked test in nim-serialization.
However according to Nim auto-dereferencing rule, Nim should be able to autodereference ByteStreamVar to ByteStream: type
# ...
ByteStream* = object of RootObj
head*: ptr byte
bufferSize: int
bufferStart, bufferEnd: ptr byte
cursorsList: ptr StreamCursor
reader: StreamReader
asyncReader: AsyncStreamReader
closeStream: CloseStreamProc
bufferEndPos: int
# ...
# TODO: ByteStreamVar should become a `var` short-lived pointer once this is supported
ByteStreamVar* = ref ByteStream
proc openFile*(filename: string): ByteStreamVar =
new result
var memFile = memfiles.open(filename)
result.head = cast[ptr byte](memFile.mem)
when debugHelpers:
result.bufferStart = result.head
result.bufferEnd = result.head.shift memFile.size
result.bufferEndPos = memFile.size
result.closeStream = proc = close memFile
# ...
# TODO: use a destructor once we migrate to Nim 0.20
proc close*(s: var ByteStream) =
if s.closeStream != nil:
s.closeStream() Solutions:
|
cannot solve #435 |
turns out the illegal storage access is in the Nim compiler, it probably doesn't like compiling beacon_node crashes
|
So now #435 is triggered on a month old test that never failed before: https://ci.appveyor.com/project/nimbus/nim-beacon-chain/builds/27346548/job/gki7ew7tkda8ou8w#L242
|
Apparently no rebasing required. |
status-im/nim-serialization#10 and maybe solve #435