Opened 3 years ago
Closed 3 years ago
#2288 closed defect (invalid)
log safely while configuration reloading
Reported by: | Owned by: | ||
---|---|---|---|
Priority: | minor | Milestone: | |
Component: | nginx-core | Version: | 1.19.x |
Keywords: | Cc: | al.drozdov@… | |
uname -a: | Linux sw 5.4.0-90-generic #101-Ubuntu SMP Fri Oct 15 20:00:55 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux | ||
nginx -V: |
nginx version: nginx/1.21.1
configure arguments: --with-debug --add-module=../lua-nginx-module |
Description
We implemented a custom feature that uses shared memory by ngx_log_t objects (we haven't published it yet).
The feature doesn't work correctly as nginx may use partially freed log objects while reloading: ngx_init_cycle() frees shared memory of the old cycle but ngx_log_t objects of the old cycle still may be used.
I'll attach a patch fixes that.
Attachments (1)
Change History (2)
by , 3 years ago
Attachment: | fix-core-on-reloading.patch added |
---|
comment:1 by , 3 years ago
Resolution: | → invalid |
---|---|
Status: | new → closed |
This looks a problem in your custom code rather than in nginx.
Further, the patch looks wrong to me, as it tries to overwrite some known log objects with unrelated log objects from the new cycle: this is both wrong (as cleanup is expected to use log objects from the old cycle) and insufficient (as there might be other references to old cycle log objects, such as in resolver or at different configuration levels).
If you think the problem in your code cannot be resolved without changing nginx code, you may want to discuss this and suggest improvements in the nginx-devel@ mailing list, as recommended here.
A patch fixes the bug