-
Notifications
You must be signed in to change notification settings - Fork 4
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
SIGSEGV: Illegal storage access. (Attempt to read from nil?) #31
Comments
Which compiler? Which compilation options? In particular, make sure you're using |
Using Nim devel. With 14 threads the whole cycle but fails with 15 or more. Code:
Output:
|
If you want to debug this stuff, my advice is to drop the Next, install https://github.com/disruptek/balls-5.1.3 and run Next, consider switching to Nimskull, which uses atomic reference counting by default. It won't fix your problem, but it will give you a chance to debug a program with fewer bugs. Finally, use a The specific problem you're running into isn't jumping out at me, but I might be running into the same bug myself. We're adjusting the memory ordering in loony to see if it helps. I do successfully use loony to produce some pretty insane concurrency numbers, but I've also had my share of bloodletting to get to this point. |
I have made the changes (except compiling with Nimskull) without success. Here the last code. With 4 producers and 13 consumers goes well, but fails with 5 producers in my machine. Thank you for your work. It is an exciting project, but its use is beyond my abilities. I am just landing on Nim from Python and still have a lot to learn. I'll stick with locking for now.
|
Running your previous example with modified constants (on nimskull with arc and danger) const PRODUCER_THREADS: int = 100
const CONSUMER_THREADS: int = 100
const MESSAGE_COUNT: int = 9000000
const PRODUCER_PAUSE: int = 100
const CONSUMER_PAUSE: int = 100 Nil issues Difficult to determine what the issue is for yourself. If you decide to test it again, please let me know if you continue to have the issue. |
"(except compiling with Nimskull)" |
Using a slightly modified example code for more consumer threads my system throws SIGSEGV error.
The text was updated successfully, but these errors were encountered: