Crash observed while using nginx-upstream-carp along with zone directive

rnmx18 nginx-forum at forum.nginx.org
Tue Oct 24 09:38:12 UTC 2017


Hi,

I am trying to use the following "NGINX upstream carp" module to realize
upstream load balancing with a certain server affinity for requests.

https://github.com/olegloa/nginx-upstream-carp

The following basic configuration works fine.

    upstream mybackends {
        server 192.168.1.3:8720;
        server 192.168.1.3:8721;
        server 192.168.1.3:8722;

        carp;
    }

However, if I add a "zone" directive within the upstream block (which
contains the carp directive also), the verification test for the
configuration (using -t option) crashes.

    upstream mybackends {
 
        zone zone_for_mybackends 1m;  
 
       server 192.168.1.37:8720;
        server 192.168.1.37:8721;
        server 192.168.1.37:8722;

        carp;  
    }

The presence of "carp" directive seems to be causing the issue here. From my
analysis, the crash seems to be due to the "setting" of peer.data field by
carp module, which leads to an invalid memory access in the upstream zone
code.

The carp-module code seems to be developed 6-7 years ago, and I guess it is
probably not fully compatible with the latest NGINX upstream constructs like
zone.

If someone else is using carp module and has faced this problem, could you
please explain how it can be resolved?

Thanks
Rajesh

Posted at Nginx Forum: https://forum.nginx.org/read.php?2,277045,277045#msg-277045



More information about the nginx mailing list