src/http/ngx_http_upstream_round_robin.c:467: error: Integer Overflow L2
  ([0, +oo] - 1):unsigned64 by call to `ngx_rwlock_unlock`.

src/http/ngx_http_upstream_round_robin.c:450:16: Call
448.         /* there are several peers */
449. 
450.         peer = ngx_http_upstream_get_peer(rrp);
                    ^
451. 
452.         if (peer == NULL) {

src/http/ngx_http_upstream_round_robin.c:556:13: Assignment
  554. 
  555.         if (peer->effective_weight < peer->weight) {
  556.             peer->effective_weight++;
                   ^
  557.         }
  558. 

src/http/ngx_http_upstream_round_robin.c:465:5: Assignment
463.     pc->name = &peer->name;
464. 
465.     peer->conns++;
         ^
466. 
467.     ngx_http_upstream_rr_peers_unlock(peers);

src/http/ngx_http_upstream_round_robin.c:467:5: Call
465.     peer->conns++;
466. 
467.     ngx_http_upstream_rr_peers_unlock(peers);
         ^
468. 
469.     return NGX_OK;

src/core/ngx_rwlock.c:89:1: <LHS trace>
87. 
88. 
89. void
    ^
90. ngx_rwlock_unlock(ngx_atomic_t *lock)
91. {

src/core/ngx_rwlock.c:89:1: Parameter `*lock`
  87. 
  88. 
  89. void
      ^
  90. ngx_rwlock_unlock(ngx_atomic_t *lock)
  91. {

src/core/ngx_rwlock.c:94:5: Assignment
  92.     ngx_atomic_uint_t  readers;
  93. 
  94.     readers = *lock;
          ^
  95. 
  96.     if (readers == NGX_RWLOCK_WLOCK) {

src/core/ngx_rwlock.c:103:13: Binary operation: ([0, +oo] - 1):unsigned64 by call to `ngx_rwlock_unlock` 
  101.     for ( ;; ) {
  102. 
  103.         if (ngx_atomic_cmp_set(lock, readers, readers - 1)) {
                   ^
  104.             return;
  105.         }

void
ngx_rwlock_unlock(ngx_atomic_t *lock)
{
    ngx_atomic_uint_t  readers;
    readers = *lock;
    if (readers == NGX_RWLOCK_WLOCK) {
        *lock = 0;
        return;
    }
    for ( ;; ) {
        if (ngx_atomic_cmp_set(lock, readers, readers - 1)) {
            return;
        }
        readers = *lock;
    }
}
['ngx_int_t\nngx_http_upstream_get_round_robin_peer(ngx_peer_connection_t *pc, void *data)\n{\n    ngx_http_upstream_rr_peer_data_t  *rrp = data;\n    ngx_int_t                      rc;\n    ngx_uint_t                     i, n;\n    ngx_http_upstream_rr_peer_t   *peer;\n    ngx_http_upstream_rr_peers_t  *peers;\n    ngx_log_debug1(NGX_LOG_DEBUG_HTTP, pc->log, 0,\n                   "get rr peer, try: %ui", pc->tries);\n    pc->cached = 0;\n    pc->connection = NULL;\n    peers = rrp->peers;\n    ngx_http_upstream_rr_peers_wlock(peers);\n    if (peers->single) {\n        peer = peers->peer;\n        if (peer->down) {\n            goto failed;\n        }\n        rrp->current = peer;\n    } else {\n        peer = ngx_http_upstream_get_peer(rrp);\n        if (peer == NULL) {\n            goto failed;\n        }\n        ngx_log_debug2(NGX_LOG_DEBUG_HTTP, pc->log, 0,\n                       "get rr peer, current: %p %i",\n                       peer, peer->current_weight);\n    }\n    pc->sockaddr = peer->sockaddr;\n    pc->socklen = peer->socklen;\n    pc->name = &peer->name;\n    peer->conns++;\n    ngx_http_upstream_rr_peers_unlock(peers);\n    return NGX_OK;\nfailed:\n    if (peers->next) {\n        ngx_log_debug0(NGX_LOG_DEBUG_HTTP, pc->log, 0, "backup servers");\n        rrp->peers = peers->next;\n        n = (rrp->peers->number + (8 * sizeof(uintptr_t) - 1))\n                / (8 * sizeof(uintptr_t));\n        for (i = 0; i < n; i++) {\n             rrp->tried[i] = 0;\n        }\n        ngx_http_upstream_rr_peers_unlock(peers);\n        rc = ngx_http_upstream_get_round_robin_peer(pc, rrp);\n        if (rc != NGX_BUSY) {\n            return rc;\n        }\n        ngx_http_upstream_rr_peers_wlock(peers);\n    }\n    for (peer = peers->peer; peer; peer = peer->next) {\n        peer->fails = 0;\n    }\n    ngx_http_upstream_rr_peers_unlock(peers);\n    pc->name = peers->name;\n    return NGX_BUSY;\n}', 'static ngx_http_upstream_rr_peer_t *\nngx_http_upstream_get_peer(ngx_http_upstream_rr_peer_data_t *rrp)\n{\n    time_t                        now;\n    uintptr_t                     m;\n    ngx_int_t                     total;\n    ngx_uint_t                    i, n, p;\n    ngx_http_upstream_rr_peer_t  *peer, *best;\n    now = ngx_time();\n    best = NULL;\n    total = 0;\n#if (NGX_SUPPRESS_WARN)\n    p = 0;\n#endif\n    for (peer = rrp->peers->peer, i = 0;\n         peer;\n         peer = peer->next, i++)\n    {\n        n = i / (8 * sizeof(uintptr_t));\n        m = (uintptr_t) 1 << i % (8 * sizeof(uintptr_t));\n        if (rrp->tried[n] & m) {\n            continue;\n        }\n        if (peer->down) {\n            continue;\n        }\n        if (peer->max_fails\n            && peer->fails >= peer->max_fails\n            && now - peer->checked <= peer->fail_timeout)\n        {\n            continue;\n        }\n        peer->current_weight += peer->effective_weight;\n        total += peer->effective_weight;\n        if (peer->effective_weight < peer->weight) {\n            peer->effective_weight++;\n        }\n        if (best == NULL || peer->current_weight > best->current_weight) {\n            best = peer;\n            p = i;\n        }\n    }\n    if (best == NULL) {\n        return NULL;\n    }\n    rrp->current = best;\n    n = p / (8 * sizeof(uintptr_t));\n    m = (uintptr_t) 1 << p % (8 * sizeof(uintptr_t));\n    rrp->tried[n] |= m;\n    best->current_weight -= total;\n    if (now - best->checked > best->fail_timeout) {\n        best->checked = now;\n    }\n    return best;\n}', 'void\nngx_rwlock_unlock(ngx_atomic_t *lock)\n{\n    ngx_atomic_uint_t  readers;\n    readers = *lock;\n    if (readers == NGX_RWLOCK_WLOCK) {\n        *lock = 0;\n        return;\n    }\n    for ( ;; ) {\n        if (ngx_atomic_cmp_set(lock, readers, readers - 1)) {\n            return;\n        }\n        readers = *lock;\n    }\n}']