comparison src/core/ngx_cycle.c @ 4933:72e11139760b

Core: don't reuse shared memory zone that changed ownership (ticket #210). nginx doesn't allow the same shared memory zone to be used for different purposes, but failed to check this on reconfiguration. If a shared memory zone was used for another purpose in the new configuration, nginx attempted to reuse it and crashed.
author Ruslan Ermilov <ru@nginx.com>
date Fri, 23 Nov 2012 12:43:58 +0000
parents 8a9b7b4e9f2d
children c821975c9068
comparison
equal deleted inserted replaced
4932:0fce5bb53b2d 4933:72e11139760b
445 != 0) 445 != 0)
446 { 446 {
447 continue; 447 continue;
448 } 448 }
449 449
450 if (shm_zone[i].shm.size == oshm_zone[n].shm.size) { 450 if (shm_zone[i].tag == oshm_zone[n].tag
451 && shm_zone[i].shm.size == oshm_zone[n].shm.size)
452 {
451 shm_zone[i].shm.addr = oshm_zone[n].shm.addr; 453 shm_zone[i].shm.addr = oshm_zone[n].shm.addr;
452 454
453 if (shm_zone[i].init(&shm_zone[i], oshm_zone[n].data) 455 if (shm_zone[i].init(&shm_zone[i], oshm_zone[n].data)
454 != NGX_OK) 456 != NGX_OK)
455 { 457 {