Bug 213113 - www/nginx: module http_upstream_sticky crashes with SIGSEGV
Summary: www/nginx: module http_upstream_sticky crashes with SIGSEGV
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Many People
Assignee: Sergey A. Osokin
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-09-30 07:51 UTC by Frank Brendel
Modified: 2016-10-12 00:45 UTC (History)
0 users

See Also:
bugzilla: maintainer-feedback? (osa)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Frank Brendel 2016-09-30 07:51:11 UTC
Hi,

the upstream_sticky module don't work with nginx 1.10 anymore. It compiles with the warning

/usr/ports/www/nginx/work/nginx-goodies-nginx-sticky-module-ng-c825ea7c5c91//ngx_http_sticky_module.c:340:21: warning: incompatible integer to pointer conversion
      assigning to 'ngx_http_upstream_rr_peer_t *' (aka 'struct ngx_http_upstream_rr_peer_s *') from 'int' [-Wint-conversion]
                iphp->rrp.current = iphp->selected_peer;
                                  ^ ~~~~~~~~~~~~~~~~~~~
This is because the structure of ngx_http_upstream_rr_peer_data_t has changed in nginx 1.10.
See /usr/ports/www/nginx/work/nginx-1.10.1/src/http/ngx_http_upstream_round_robin.h

nginx 1.8
typedef struct {
    ngx_http_upstream_rr_peers_t   *peers;
    ngx_uint_t                      current;
    uintptr_t                      *tried;
    uintptr_t                       data;
} ngx_http_upstream_rr_peer_data_t;

nginx 1.10
typedef struct {
    ngx_http_upstream_rr_peers_t   *peers;
    ngx_http_upstream_rr_peer_t    *current;
    uintptr_t                      *tried;
    uintptr_t                       data;
} ngx_http_upstream_rr_peer_data_t;


Kind regards
Frank
Comment 1 Frank Brendel 2016-09-30 08:47:44 UTC
As far as I can see the problem is already fixed by the developer.
https://bitbucket.org/nginx-goodies/nginx-sticky-module-ng/commits/51efa124a4330e194ef651e597a6038a6f7979dc?at=master
Comment 2 Sergey A. Osokin freebsd_committer freebsd_triage 2016-10-12 00:45:25 UTC
Fixed, thanks for report!
Comment 3 commit-hook freebsd_committer freebsd_triage 2016-10-12 00:45:41 UTC
A commit references this bug:

Author: osa
Date: Wed Oct 12 00:44:52 UTC 2016
New revision: 423811
URL: https://svnweb.freebsd.org/changeset/ports/423811

Log:
  Upgrade third-party upstream_sticky module to its latest version 08a395c66e42
  to fix crashing with SIGSEGV.

  PR:	213113

Changes:
  head/www/nginx/Makefile
  head/www/nginx/distinfo
  head/www/nginx-devel/Makefile
  head/www/nginx-devel/distinfo
  head/www/nginx-devel/files/extra-patch-ngx_http_sticky_misc.c