Skip to content
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

Error while compiling with threads: 'evalMessageIter' is not GC-safe as it calls 'keys' #35

Open
samsamros opened this issue Jan 1, 2023 · 0 comments

Comments

@samsamros
Copy link

samsamros commented Jan 1, 2023

Context:
compiling with latest nim version (1.7.1) and with the following:
nim c --run -d:ssl -d:release -mm:orc --threads:on Error.nim

and initially got this error:

'evalMessageIter' is not GC-safe as it calls 'keys'

I began tracing the problem one by one until I found the culprit for my particular program.

Error: 'readArrayLinesIter' is not GC-safe as it calls 'readNext'

I went to the lines where the proc is defined in three diferent places.
lines 262, 263 and 308 and added the {.gcsafe.} pragma to all and got the following:

Error: public implementation 'redis.readNext(r: AsyncRedis)' has non-public forward declaration at /home/.../.nimble/pkgs/redis-0.3.0/redis.nim(260, 6)

I added a * to proc readNext*(r: AsyncRedis): Future[RedisList] and got the following:

Error: public implementation 'redis.readNext(r: Redis)' has non-public forward declaration at /home/.../.nimble/pkgs/redis-0.3.0/redis.nim(259, 6)

So, also added another * to this proc readNext*(r: Redis): RedisList

The program finally compiled without issues and is working really well... so far. I'm still running tests to see how the program behaves, and perhaps someone else has run into this (maybe I'm doing something wrong?). I hope it helps.

PS thank you for taking the time to write this amazing code. it's beautiful

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant