-
Notifications
You must be signed in to change notification settings - Fork 292
modsecurity_rules_file directive failed to attach shared memory #127
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
Comments
Hi @Roger-Man , We had many improvements and fixes (including memory leaks) since 3.0.2 came out. The CHANGES file summarizes them. Can you maybe try with the latest libModSecurity code from master and let us know if the issue still happens: https://github.com/SpiderLabs/ModSecurity/commits/v3/master? |
Hi @victorhora
|
I'm not sure as I've never stumbled in this error before. By glancing at the code related with this error message, it seems related with a failure to perform an shmat() while handling debug logs. By any chance you have SecDebugLog enabled for your production server? We don't recommend enabling debug logs for production as it incurs a performance penalty. I'm wondering if the "heavy load" that you mention (along with debug_logs) could be leading to this error. If debug_log is indeed disabled, you can consider "removing" debugging functionality altogether to make sure that the issue is not related with that and also for increased performance. This can be accomplished by appending the --disable-debug-logs option to the ./configure script/step. Regardless, I still recommend updating to the latest libModSecurity code from master until the next release. As for pcre-JIT, there's a history of some small memory leaks from that functionality in v2 but I think it's not the case for libModSecurity (v3) today. But I think that the Are you running with SELinux? PCRE-JIT was optional on v2 but it is enabled by default on libModSecurity (v3). Currently there's no flag to disable it cleanly, but if you still would like to disable it you could do it through a minor modification of the pcre.m4 file or by manually setting the PCRE_CFLAGS (env) variable. |
@victorhora Thanks a lot. |
Hi @Roger-Man, Did you had the chance to test it? By any chance, did you had gdbm enabled? |
@Roger-Man please be careful with your mentions thanks Sent with GitHawk |
@victorhora
Now it works smoothly as expected. |
@zimmerle I have tested and reported back. P.S. Modsecurity configure script shows Thanks |
Fixed it. |
Based on that comment I am closing the issue. |
@zimmerle |
Yes, I ran into the problem as I mentioned in #1141 |
Hi @Roger-Man, If you want to use shared memory you need to change your SELinux profile to allow it. If SELinux is explicit set to not allow shared memory, the process won't be able to use it. |
Hi @zimmerle |
Hi @Roger-Man, You said that you are getting "modsecurity_rules_file directive failed to attach shared memory" is that right? |
@zimmerle |
Plase run |
In owasp-modsecurity/ModSecurity#1141 you said that you have a double free corruption, how you managed to get it, if your nignx refuses to start? |
I had reported the issue about 50 days ago. The system condition has changed since then.
P.S. No changes on SElinux since am not using it. |
It starts and works, but as I said in SpiderLabs/ModSecurity#1141 arbitrary worker processes (not the whole process tree) crash and exit. And if it is worth, my current issue is the memory leaks while issuing |
Hi @Roger-Man, So, after the upgrade this particular issue is no longer a problem? |
As I mentioned in last comment both updating and removing |
I'm now having the same issue whenever trying to load any rules file. Nginx 1.14.2, libmodsecurity v3.0.3, FreeBSD 10.3. The problem presents itself whenever trying to set anything for
Environment:
|
@Kage, I would suggest creating a new issue since it could be something specific with the FreeBSD build that needs to be investigated. Thanks. |
Duly noted, will do. Thanks! |
Hi
using v3.0.2 with nginx-1.14.0 we are getting "modsecurity_rules_file directive failed to attach shared memory" after tolerating heavy traffic for some hours.
Is there any workaround?
P.S. Is there any relation with #38?
P.S. We are collecting nginx access logs every minute by cutting the access log file to a different location and issuing USR1 signal as documented in Rotating Log-files. This causes the mentioned error to be issued. Then nginx goes away which results in refusing connections.
The text was updated successfully, but these errors were encountered: