-
Notifications
You must be signed in to change notification settings - Fork 23.5k
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
[CRASH] Redis 6.2.5 calling script - Apple M1 docker - ReJSON #10162
Comments
@MeirShpilraien can you please take a look? |
@codekrafter any chance you can share the script with this sha: 8f55ae4a3be429c6d38c5d5db3e80edf89197b64? Can help reproduce the issue. |
Also notice that RediSearch and RedisJson is also loaded, we need to also considered that, might be a module that causes memory corruption ... |
@MeirShpilraien it should be this script: https://github.com/OptimalBits/bull/blob/v4.2.1/lib/commands/addJob-6.lua |
Well the crash log you posted is about a Redis server running on x64 Linux. Based on the instruction where this crash occurred, the invalid memory pointer belongs to a key string that is already in the database. Assuming the physical memory module in your system is not flaky, this sounds like a use-after-free issue to me. If it reproduces relatively consistently on your local dev env, maybe try a few more repros with Valgrind? 0: 48 89 f7 mov rdi,rsi %rsi = 0x4000166b static int dictSdsKeyCompare(void *privdata, const void *key1, const void *key2) which is invoked by static long _dictKeyIndex(dict *d, const void *key, uint64_t hash, dictEntry **existing) { |
@codekrafter I do not see anything suspicious in the Lua script. I suspects its the modules fault. Is it possible to run without the module (just to try to prove/disprove this theory)? |
@MeirShpilraien most of my app's interaction with redis is through module commands, which makes it hard to test the application without the module. |
@codekrafter any chance you have a deterministic reproduction steps? |
@codekrafter It looks like this crash is similar to #10341. |
@sundb How would I confirm I am using qemu? I believe so as my laptop is m1 but it is running as x86. It is using the |
@codekrafter You can tell by the warning shown in the docker. |
@sundb can confirm it is running via qemu |
@codekrafter It seems to be necessary to make an issue with https://github.com/RedisJSON/RedisJSON and ask them to build an image that supports arm, otherwise it will definitely have problems running on m1 docker. |
i'm closing all of these reports, should be tracked in the ReJson repo. |
@oranagra Here are the available ARM docker image: plain redis: hub.docker.com/_/redis The above version may not be the latest, someon can find it on the docker hub if needed. |
I see you mentioned that ReJson doesn't have an ARM image, does redis have one? I think we should find a way to detect this issue, and abort redis on startup with a clear message. like we did in #8224. |
@oranagra I modified the above comment to add the available images. |
@sundb i don't think it's wise to add code to memset on calloc, if that's what you meant. Another alternative is to just enable the feature added in the jemalloc PR you mentioned (which causes jemalloc to never dismiss pages when running on an affected platform), that would fix the problem on qemu, by adding a sub-optimal effect on the runtime. what i suggest is to copy that detection code from jemalloc into redis, and use it in a similar manner as we did in #8224. |
@oranagra I found some problems when I did with the way you said.
|
@sundb i don't want to invest too much effort (and code) in this, if it's too late to tweak jemalloc config, let's drop this idea. i think the most important requirements here are:
from that perspective, i think it's fine to do that check after init, and forget about the idea of setting in theory, people can provide jemalloc with a config from outside (there's a mechanism for that), and set |
@sundb i understand some progress have been made, and since we posted quite a few links to this comment from other pages and people are likely to hit it, i'd like to ask you to edit / update it. it currently refers to
|
@oranagra Already updated. |
Crash report
Paste the complete crash log between the quotes below. Please include a few lines from the log preceding the crash report to provide some context.
Additional information
This from running a stock ReJSON docker container, with no other modules. Most of the redis interaction is from the Bull queuing library
The text was updated successfully, but these errors were encountered: