ModSecurity icon indicating copy to clipboard operation
ModSecurity copied to clipboard

It often leads memory leak on nginx reload

Open Hello-Linux opened this issue 4 years ago • 7 comments

Describe the bug

We publish more frequently every day, and often reload nginx,every few days nginx has a memory leak,How to fix it?

Logs and dumps

Output of:

2021/01/21 11:04:08 [alert] 25264#25264: fork() failed while spawning "worker process" (12: Cannot allocate memory)
2021/01/21 11:04:08 [alert] 25264#25264: sendmsg() failed (9: Bad file descriptor)
2021/01/21 11:04:08 [alert] 25264#25264: sendmsg() failed (9: Bad file descriptor)
2021/01/21 11:04:08 [alert] 25264#25264: sendmsg() failed (9: Bad file descriptor)

Expected behavior

A clear and concise description of what you expected to happen.

Server (please complete the following information):

  • Modsecurity: v3.0.4-92-gd72be1c for Linux with nginx-connector v1.0.1
  • WebServer: nginx-1.17.8
  • OS: Centos7.6

Hello-Linux avatar Jan 21 '21 04:01 Hello-Linux

Duplicate of #2381

zimmerle avatar Jan 21 '21 12:01 zimmerle

@zimmerle From #2381, I don't see how to fix this problem? Now what do I need to do

Hello-Linux avatar Jan 22 '21 01:01 Hello-Linux

@zimmerle How to solve this problem? The impact of this problem is very serious. I hope that the government will pay close attention to the repair and repair version 3.0.4 as soon as possible

Hello-Linux avatar Jan 25 '21 01:01 Hello-Linux

@Hello-Linux copy in paste the same comments across multiple issues is not good for the project index. Please avoid doing it.

Typically, users search for the existing issues before opening a new topic. Sometimes they get a response by just reading a similar problem.

zimmerle avatar Jan 25 '21 11:01 zimmerle

@zimmerle Sorry, I don't know what you mean. What I want to ask is how to solve this memory leak?

Hello-Linux avatar Jan 26 '21 01:01 Hello-Linux

maybe this PR (https://github.com/SpiderLabs/ModSecurity/pull/2580) can resovle you probole @Hello-Linux

Abce avatar Jul 01 '21 10:07 Abce

I also encountered the same problem. It is the same with the latest 3.0.7. After nginx - s reload, there is a lot of memory leakage, and the memory is basically consumed after several more executions. This problem is very serious and has a great impact on the production environment

hebo209812 avatar Aug 10 '22 02:08 hebo209812

Closing in favour of #2848

martinhsv avatar Dec 21 '22 19:12 martinhsv