Welcome! Log In Create A New Profile

Advanced

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

Maxim Dounin
October 21, 2013 07:16AM
Hello!

On Mon, Oct 21, 2013 at 01:13:56AM -0400, andrewc wrote:

> Hi there,
>
> I have built nginx 1.5.6 from source, with a 3rd party module (xtoken -
> http://code.google.com/p/nginx-xtoken-module/).
>
> I have it working fine on a 32-bit Debian Squeeze system. An identical build
> on a 64-bit Centos 6.4 system, with an identical configuration file results
> in the error: "nginx: [crit] ngx_slab_alloc() failed: no memory" on
> startup.
>
> I have narrowed the problem to the xtoken module, in as much as removing
> references to it on the 64-bit system results in nginx starting correctly.
>
> I have had a quick look at the module source code, and can't see anything
> that is obviously 32-bit -centric, other than a couple of variables that
> have been declared as uint32_t.
>
> Is it correct to assume that a properly written module will work correctly
> on both 32 and 64-bit systems?

Yes.

> Is there any additional nginx configuration that needs to be performed on
> 64-bit systems?

In some cases, additional configuration may be required due to
different data sizes.

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.

The same code may also unexpectedly fail in the future on internal
slab allocator changes.

--
Maxim Dounin
http://nginx.org/en/donation.html

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

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

andrewc October 21, 2013 01:13AM

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

Maxim Dounin October 21, 2013 07:16AM

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

andrewc October 21, 2013 10:35PM

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

danielf May 26, 2014 03:39AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 272
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready