-
Notifications
You must be signed in to change notification settings - Fork 10
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
Invalid memory access when running multiple Ruby script calls at once #27
Comments
The program from the linked repository runs perfectly fine on WSL on my Surface Pro X (which also has ARM64), as well as on my AMD64 on both Windows (using hey) and WSL. How often do you encounter this error? Maybe there is some problem with mruby or Crystal on Mac, which triggers this, but I don't really have any options to test this. Perhaps running the Crystal program with valgrind could provide a bit more insight on where exactly the invalid memory access happens. |
I was getting it every 2nd or 3rd run, although I did just have one where it didn't crash until the 5th run. It reads like to me that the crash itself is printing the backtrace, although I could be wrong there. If I enable Unfortunately it seems valgrind is Linux-only, at least according to the Homebrew cask. I only have arm64 on on my Mac at the moment. I'll try to come up with a more reliable repro. |
Alright, I've improved the repro so it's 100% reliable for me now, even on amd64. I've added a |
Yep, now I can reproduce it as well. The problem is apparently that two script calls interfere with each other, since they both use the same interpreter. Anyway, I could add some trivial guards to Anyolite to make it thread-safe for now. The limitation here is that mruby itself isn't thread-safe (and will probably never be). Another solution will of course be support for multiple interpreters in parallel, but I will open a separate discussion thread for that (#28). |
mrb_vm_exec
on arm64
Under high load when running a simple program on my M1X Macbook Pro, I occasionally get an
Invalid memory access (signal 11)
crash.Reproduction repo: https://github.com/chendo/crystal-anyolite-crash-repro
Tested with Crystal 1.7.2, anyolite main (efe3337).
Interestingly enough, I could not reproduce the same issue inside an amd64 docker container (Rosetta).
Full crash log:
The text was updated successfully, but these errors were encountered: