Hi Madhu,
Thanks for the report.
> With Session Cache size = 7864432 bytes, here's a log that I'm
> seeing :
[snip]
> the INDEX_NUM value is 0 !!!!!
Yeah this is a bug - each sub-cache uses an indexing structure that
(correctly) uses index values (and ranges) as "unsigned int", but the
meta-structure in the header had these poor things ranged as "unsigned
char". Your example cleverly showed why this was bogus (and helped me to
quickly reproduce the bug and also to verify that a simple patch fixes it).
I've attached a patch to fix this. But as it's really small, I'll also
inline a copy of it to this mail in case any mailers or gateways crop out
attachments. Note however that the "inline" version may have extra
line-feeds and so wouldn't apply verbatim - but you can pretty much
hand-fix the source by reading the diff - it's 37 lines all-up.
Thanks again, and please let me know if you observe any other problems.
FWIW: I'm currently looking to those SIGBUS problems.
Cheers,
Geoff
PS: Here's the "inlined" patch;
--- mod_ssl-2.8.5-1.3.22/pkg.sslmod/ssl_scache_shmcb.c Fri Mar 30 22:00:34
2001
+++ apache_1.3.22/src/modules/ssl/ssl_scache_shmcb.c Thu Dec 13 16:45:51
2001
@@ -183,9 +183,9 @@
unsigned int division_offset;
unsigned int division_size;
unsigned int queue_size;
- unsigned char index_num;
- unsigned char index_offset;
- unsigned char index_size;
+ unsigned int index_num;
+ unsigned int index_offset;
+ unsigned int index_size;
unsigned int cache_data_offset;
unsigned int cache_data_size;
unsigned long num_stores;
@@ -209,9 +209,9 @@
unsigned int cache_data_offset;
unsigned int cache_data_size;
unsigned char division_mask;
- unsigned char index_num;
- unsigned char index_offset;
- unsigned char index_size;
+ unsigned int index_num;
+ unsigned int index_offset;
+ unsigned int index_size;
#endif
} SHMCBHeader;
@@ -992,7 +992,7 @@
const SHMCBQueue *queue, unsigned int idx)
{
/* bounds check */
- if (idx > (unsigned int) queue->header->index_num)
+ if (idx > queue->header->index_num)
return NULL;
/* Return a pointer to the index. NB: I am being horribly pendantic
--- mod_ssl-2.8.5-1.3.22/pkg.sslmod/ssl_scache_shmcb.c Fri Mar 30 22:00:34 2001
+++ apache_1.3.22/src/modules/ssl/ssl_scache_shmcb.c Thu Dec 13 16:45:51 2001
@@ -183,9 +183,9 @@
unsigned int division_offset;
unsigned int division_size;
unsigned int queue_size;
- unsigned char index_num;
- unsigned char index_offset;
- unsigned char index_size;
+ unsigned int index_num;
+ unsigned int index_offset;
+ unsigned int index_size;
unsigned int cache_data_offset;
unsigned int cache_data_size;
unsigned long num_stores;
@@ -209,9 +209,9 @@
unsigned int cache_data_offset;
unsigned int cache_data_size;
unsigned char division_mask;
- unsigned char index_num;
- unsigned char index_offset;
- unsigned char index_size;
+ unsigned int index_num;
+ unsigned int index_offset;
+ unsigned int index_size;
#endif
} SHMCBHeader;
@@ -992,7 +992,7 @@
const SHMCBQueue *queue, unsigned int idx)
{
/* bounds check */
- if (idx > (unsigned int) queue->header->index_num)
+ if (idx > queue->header->index_num)
return NULL;
/* Return a pointer to the index. NB: I am being horribly pendantic