ASF Bugzilla – Attachment 35881 Details for
Bug 62308
Apache crashes after graceful restart with AH02599: slotmem (failed size check)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Relax slotmem reuse checks
slotmem_reuse.patch (text/plain), 4.36 KB, created by
Yann Ylavic
on 2018-04-18 16:21:07 UTC
(
hide
)
Description:
Relax slotmem reuse checks
Filename:
MIME Type:
Creator:
Yann Ylavic
Created:
2018-04-18 16:21:07 UTC
Size:
4.36 KB
patch
obsolete
>Index: modules/slotmem/mod_slotmem_shm.c >=================================================================== >--- modules/slotmem/mod_slotmem_shm.c (revision 1829250) >+++ modules/slotmem/mod_slotmem_shm.c (working copy) >@@ -361,32 +361,6 @@ static apr_status_t slotmem_doall(ap_slotmem_insta > return retval; > } > >-static int check_slotmem(ap_slotmem_instance_t *mem, apr_size_t size, >- apr_size_t item_size, unsigned int item_num) >-{ >- sharedslotdesc_t *desc; >- >- /* check size */ >- if (apr_shm_size_get(mem->shm) != size) { >- ap_log_error(APLOG_MARK, APLOG_ERR, 0, ap_server_conf, APLOGNO(02599) >- "existing shared memory for %s could not be used " >- "(failed size check)", >- mem->name); >- return 0; >- } >- >- desc = apr_shm_baseaddr_get(mem->shm); >- if (desc->size != item_size || desc->num != item_num) { >- ap_log_error(APLOG_MARK, APLOG_ERR, 0, ap_server_conf, APLOGNO(02600) >- "existing shared memory for %s could not be used " >- "(failed contents check)", >- mem->name); >- return 0; >- } >- >- return 1; >-} >- > static apr_status_t slotmem_create(ap_slotmem_instance_t **new, > const char *name, apr_size_t item_size, > unsigned int item_num, >@@ -412,34 +386,25 @@ static apr_status_t slotmem_create(ap_slotmem_inst > if (slotmem_filenames(pool, name, &fname, persist ? &pname : NULL)) { > /* first try to attach to existing slotmem */ > if (next) { >- ap_slotmem_instance_t *prev = NULL; > for (;;) { > if (strcmp(next->name, fname) == 0) { >- *new = next; /* either returned here or reused finally */ >- if (!check_slotmem(next, size, item_size, item_num)) { >- apr_shm_destroy(next->shm); >- next = next->next; >- if (prev) { >- prev->next = next; >- } >- else { >- globallistmem = next; >- } >- if (next) { >- continue; >- } >- next = prev; >- break; >+ desc = apr_shm_baseaddr_get(next->shm); >+ if (desc->size != item_size) { >+ ap_log_error(APLOG_MARK, APLOG_ERR, 0, ap_server_conf, APLOGNO(02599) >+ "existing shared memory for %s could not be reused " >+ "(failed size check)", >+ next->name); >+ return APR_EINVAL; > } > /* we already have it */ > ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, ap_server_conf, APLOGNO(02603) > "create found %s in global list", fname); >+ *new = next; > return APR_SUCCESS; > } > if (!next->next) { > break; > } >- prev = next; > next = next->next; > } > } >@@ -512,14 +477,10 @@ static apr_status_t slotmem_create(ap_slotmem_inst > p = fbased ? gpool : pool; > ptr = (char *)desc + AP_SLOTMEM_OFFSET; > >- /* For the chained slotmem stuff (*new may be reused from above) */ >- res = *new; >- if (res == NULL) { >- res = apr_pcalloc(p, sizeof(ap_slotmem_instance_t)); >- res->name = apr_pstrdup(p, fname); >- res->pname = apr_pstrdup(p, pname); >- *new = res; >- } >+ /* For the chained slotmem stuff */ >+ res = apr_pcalloc(p, sizeof(ap_slotmem_instance_t)); >+ res->name = apr_pstrdup(p, fname); >+ res->pname = apr_pstrdup(p, pname); > res->fbased = fbased; > res->shm = shm; > res->persist = (void *)ptr; >@@ -534,11 +495,11 @@ static apr_status_t slotmem_create(ap_slotmem_inst > res->next = NULL; > res->inuse = ptr + basesize; > if (fbased) { >- if (globallistmem == NULL) { >- globallistmem = res; >+ if (next) { >+ next->next = res; > } > else { >- next->next = res; >+ globallistmem = res; > } > } >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 62308
:
35878
|
35881
|
35882
|
35888
|
35899
|
35900
|
35902
|
35906
|
35936
|
35940
|
35942