Modules behaving differently on 32-bit and 64-bit systems?

andrewc nginx-forum at nginx.us
Tue Oct 22 02:35:06 UTC 2013


Maxim Dounin Wrote:
-------------------------------------------------------

> Quick looks suggests that the problem in xtoken module is likely 
> here:
> 
> https://code.google.com/p/nginx-xtoken-module/source/browse/trunk/ngx_
> http_xtoken_module.c#660
> 
> It tries to estimate size of shared memory zone needed to keep 
> it's data, but the estimate likely fails on 64-bit platforms due 
> to internal structures of slab allocator being bigger on these 
> platforms.

Thanks for the tip, Maxim. On line 13 of ngx_http_token_module.c I
replaced:

#define XTOKEN_SHM_SIZE    (sizeof(ngx_http_xtoken_shctx_t))

with:

#define XTOKEN_SHM_SIZE 65536

and rebuilt. It seems to work fine now.

65536 is purely arbitrary, and obviously not the most efficient use of
memory. I'll do some reading and see if I can rework that memory allocation
line.

Thanks,

Andrew

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,243883,243943#msg-243943



More information about the nginx mailing list