workaround for compile warning.

diff --git a/gzip.cc b/gzip.cc
> index 895f4e0..8289a2e 100644
> --- a/gzip.cc
> +++ b/gzip.cc
> @@ -282,7 +282,7 @@ gzip_transform_finish(GzipData * data)
>        break;
>      }
>
> -    if (data->downstream_length != (data->zstrm.total_out)) {
> +    if ((unsigned)data->downstream_length != (data->zstrm.total_out)) {
>        error("gzip-transform: ERROR: output lengths don't match (%d,
> %ld)", data->downstream_length,
>              data->zstrm.total_out);
>      }
> @@ -550,7 +551,7 @@ gzip_transform_add(TSHttpTxn txnp, int server,
> HostConfiguration * hc)
>    TSMimeHdrFieldValueStringGet(cbuf, chdr, cfield, 0, &len);
>
>    //we normalized to either deflate or gzip. only gzip has length 4
> -  if (len == strlen("gzip"))
> +  if ((unsigned)len == strlen("gzip"))
>      gzip = 1;
>
>    TSHandleMLocRelease(cbuf, chdr, cfield);
> diff --git a/misc.cc b/misc.cc
> index 8ada7b3..89a0481 100644
> --- a/misc.cc
> +++ b/misc.cc
> @@ -61,9 +61,9 @@ normalize_accept_encoding(TSHttpTxn txnp, TSMBuffer
> reqp, TSMLoc hdr_loc)
>          --value_count;
>          val = TSMimeHdrFieldValueStringGet(reqp, hdr_loc, field,
> value_count, &val_len);
>
> -        if (val_len == strlen("gzip"))
> +        if ((unsigned)val_len == strlen("gzip"))
>            gzip = !strncmp(val, "gzip", val_len);
> -        else if (val_len == strlen("deflate"))
> +        else if ((unsigned)val_len == strlen("deflate"))
>            deflate = !strncmp(val, "deflate", val_len);
>        }
>      }




On Mon, Sep 10, 2012 at 10:25 PM, [email protected] <[email protected]>wrote:

> ** gzip module compile error has been occured..
>
> ** My GCC version is gcc 4.4.6
>
>
>
>
>
>   CXX    gzip.lo
> cc1plus: warnings being treated as errors
> gzip.cc: In function 'void gzip_transform_finish(GzipData*)':
> gzip.cc:284: error: comparison between signed and unsigned integer
> expressions
> make: *** [gzip.lo] Error 1
>
>
>
>     if (data->downstream_length != (data->zstrm.total_out)) {
>       error("gzip-transform: ERROR: output lengths don't match (%d, %ld)",
> data->downstream_length,
>             data->zstrm.total_out);
>     }
>
>
>
>
> [image: [email protected]] <[email protected]>
>
>
>
> -----Original Message-----
> *From:* "[email protected]"<[email protected]>
> *To:* <[email protected]>;
> *Cc:*
> *Sent:* 2012-09-10 (월) 18:38:53
> *Subject:* Re: [Segmentation Fault] gzip plugin
>
>
> At our configuration, ETag header was not involved!!
>
> Simply the gzip module to load, and does not actually use the gzip
> module!!
> Service object is the only image file.
>
>
> -----Original Message-----
> From: "Otto van der Schaaf"<oschaaf>@gmail.com>
> To: <users>@trafficserver.apache.org>; "[email protected]"<seri0528>@
> naver.com>;
> Cc:
> Sent: 2012-09-10 (월) 18:22:00
> Subject: Re: [Segmentation Fault] gzip plugin
>
> I found a memory leak when etags where involved, and fixed it in the
> latest version. I hope that was it, as I cannot reproduce this behaviour
> anymore.
>
> Regards, Otto
>
> 2012/9/10 [email protected] <seri0528>@naver.com>
>
> Stil, as belew, Memory problem have been happened .
> Virtual Memory, swap is full.
>
> Without gzip module, This is not happend.
>
> Sep 10 10:39:32 XXXX kernel: Out of memory: Kill process 20103 ([ET_NET
> 0]) score 981 or sacrifice child
> Sep 10 10:39:32 XXXX kernel: Killed process 20103, UID 100, ([ET_NET 0])
> total-vm:52300364kB, anon-rss:48400612kB, file-rss:1852kB
>
> [Sep 10 10:39:34.030] Manager {0x7f5862e957e0} ERROR:
> [LocalManager::pollMgmtProcessServer] Server Process terminated due to Sig
> 9: Killed
>
>
>
> -----Original Message-----
> From: "[email protected]"<seri0528>@naver.com>
> To: "Conan"<conanmind>@gmail.com>; <users>@trafficserver.apache.org>;
> Cc:
> Sent: 2012-09-07 (금) 14:32:26
> Subject: Re: [Segmentation Fault] gzip plugin
>
>
> Yes, I'v tested the gzip in chrome!!
> As you said, it seems to produce duplicate crc32 trailer.
>
> I'll try your patch..
>
> Thank you!!
>
> Seri
>
>
>
>
> -----Original Message-----
> From: "Conan"<conanmind>@gmail.com>
> To: <users>@trafficserver.apache.org>; "[email protected]"<seri0528>@
> naver.com>;
> Cc:
> Sent: 2012-09-07 (금) 13:01:41
> Subject: Re: [Segmentation Fault] gzip plugin
>
> btw, can you test the gzip result in chrome? seem it produces duplicate
> crc32 trailer. you can try the patch below.
>
> diff --git a/plugins/experimental/gzip/gzip.cc
> b/plugins/experimental/gzip/gzip.cc
> index fe79740..c56911c 100644
> --- a/plugins/experimental/gzip/gzip.cc
> +++ b/plugins/experimental/gzip/gzip.cc
> @@ -287,6 +287,7 @@ gzip_transform_finish(GzipData * data)
> data->zstrm.total_out);
> }
>
> + /*
> if (data->compression_type == COMPRESSION_TYPE_GZIP) {
> info("append gzip adler");
> char *p = (char *) &(data->zstrm.adler);
> @@ -302,6 +303,7 @@ gzip_transform_finish(GzipData * data)
> }
> data->downstream_length += 8;
> }
> + */
>
> gzip_log_ratio(data->zstrm.total_in, data->downstream_length);
> }
> On Thu, Sep 6, 2012 at 10:00 PM, [email protected] <seri0528>@naver.com>
> wrote:
> Hi,
> I'll try this tomorrow..
>
> It takes a few days to get the result!!
>
> Thank you!!
>
> Seri
>
>
>
>
> -----Original Message-----
> From: "Otto van der Schaaf"<oschaaf>@gmail.com>
> To: <users>@trafficserver.apache.org>; "[email protected]"<seri0528>@
> naver.com>;
> Cc:
> Sent: 2012-09-06 (목) 19:00:58
> Subject: Re: [Segmentation Fault] gzip plugin
>
> Hi,
>
> I looked into it, the attached patch might fix your issue, could you try
> it?
> Regards, Otto van der Schaaf
>
> 2012/9/6 [email protected] <seri0528>@naver.com>
> Hi everyone!!
> In ATS 3.2.0,
>
> As below, Segemtation Fault happened!!
> It seems to be happened because of gzip plugin!!
>
> Plz!! Help me!!
>
> ===========================================================================================
>
> * OS environment
> - CentOS 6.2
> - Memory: 48GB
> - RAM Cache: 24G
> - ATS Version: 3.2.0
> - Application: only ATS
> - gzip configuration
> remove-accept-encoding false
> cache true
> compressible-content-type text/*
> compressible-content-type *javascript*
>
> ** traffic.out
> NOTE: Traffic Server received Sig 11: Segmentation fault
> /usr/local/ATS/3.2.0/bin/traffic_server - STACK TRACE:
> /lib64/libpthread.so.0[0x391360f4a0]
> /usr/local/ATS/3.2.0/libexec/trafficserver/gzip.so(_ZN4Gzip17HostConfiguration22remove_accept_encodingEv+0xc)[0x2b64b43b8906]
>
> /usr/local/ATS/3.2.0/libexec/trafficserver/gzip.so(+0xc1a8)[0x2b64b43b81a8]
>
> /usr/local/ATS/3.2.0/bin/traffic_server(_ZN15INKContInternal12handle_eventEiPv+0xaa)[0x4e7d56]
>
> /usr/local/ATS/3.2.0/bin/traffic_server(_ZN12Continuation11handleEventEiPv+0x6c)[0x4df742]
>
> /usr/local/ATS/3.2.0/bin/traffic_server(_ZN7APIHook6invokeEiPv+0x4f)[0x4e859d]
>
> /usr/local/ATS/3.2.0/bin/traffic_server(_ZN6HttpSM17state_api_calloutEiPv+0x58e)[0x560b06]
>
> /usr/local/ATS/3.2.0/bin/traffic_server(_ZN6HttpSM23do_api_callout_internalEv+0x18a)[0x56b4f4]
>
> /usr/local/ATS/3.2.0/bin/traffic_server(_ZN6HttpSM14do_api_calloutEv+0x26)[0x5761e0]
>
> /usr/local/ATS/3.2.0/bin/traffic_server(_ZN6HttpSM29setup_server_send_request_apiEv+0x26)[0x56d8d6]
>
> /usr/local/ATS/3.2.0/bin/traffic_server(_ZN6HttpSM23handle_http_server_openEv+0x1a4)[0x56c084]
>
> /usr/local/ATS/3.2.0/bin/traffic_server(_ZN6HttpSM22state_http_server_openEiPv+0x4af)[0x5615e5]
>
> /usr/local/ATS/3.2.0/bin/traffic_server(_ZN6HttpSM12main_handlerEiPv+0x236)[0x563fb0]
>
> /usr/local/ATS/3.2.0/bin/traffic_server(_ZN12Continuation11handleEventEiPv+0x6c)[0x4df742]
>
> /usr/local/ATS/3.2.0/bin/traffic_server(_ZN18UnixNetVConnection9connectUpEP7EThread+0x3a7)[0x6a8d5f]
>
> /usr/local/ATS/3.2.0/bin/traffic_server(_ZN16UnixNetProcessor19connect_re_internalEP12ContinuationPK8sockaddrP12NetVCOptions+0x4d5)[0x6a453d]
>
> /usr/local/ATS/3.2.0/bin/traffic_server(_ZN12NetProcessor10connect_reEP12ContinuationPK8sockaddrP12NetVCOptions+0x34)[0x4fb5a0]
>
> /usr/local/ATS/3.2.0/bin/traffic_server(_ZN6HttpSM19do_http_server_openEb+0xf1e)[0x56b0e2]
>
> /usr/local/ATS/3.2.0/bin/traffic_server(_ZN6HttpSM14set_next_stateEv+0x970)[0x571d0c]
>
> /usr/local/ATS/3.2.0/bin/traffic_server(_ZN6HttpSM32call_transact_and_set_next_stateEPFvPN12HttpTransact5StateEE+0x1a7)[0x571395]
>
> /usr/local/ATS/3.2.0/bin/traffic_server(_ZN6HttpSM22state_cache_open_writeEiPv+0x367)[0x5638f7]
>
> /usr/local/ATS/3.2.0/bin/traffic_server(_ZN6HttpSM12main_handlerEiPv+0x236)[0x563fb0]
>
> /usr/local/ATS/3.2.0/bin/traffic_server(_ZN12Continuation11handleEventEiPv+0x6c)[0x4df742]
>
> /usr/local/ATS/3.2.0/bin/traffic_server(_ZN11HttpCacheSM22state_cache_open_writeEiPv+0x161)[0x54cdbf]
>
> /usr/local/ATS/3.2.0/bin/traffic_server(_ZN12Continuation11handleEventEiPv+0x6c)[0x4df742]
>
> /usr/local/ATS/3.2.0/bin/traffic_server(_ZN5Cache10open_writeEP12ContinuationP7INK_MD5P8HTTPInfolS3_13CacheFragTypePci+0x76)[0x689350]
>
> /usr/local/ATS/3.2.0/bin/traffic_server(_ZN5Cache10open_writeEP12ContinuationP3URLP7HTTPHdrP8HTTPInfol13CacheFragType+0x98)[0x665c3c]
>
> /usr/local/ATS/3.2.0/bin/traffic_server(_ZN14CacheProcessor10open_writeEP12ContinuationiP3URLP7HTTPHdrP8HTTPInfol13CacheFragType+0x152)[0x663aac]
>
> /usr/local/ATS/3.2.0/bin/traffic_server(_ZN11HttpCacheSM10open_writeEP3URLP7HTTPHdrP8HTTPInfolbb+0x13c)[0x54d1ae]
>
> /usr/local/ATS/3.2.0/bin/traffic_server(_ZN6HttpSM23do_cache_prepare_actionEP11HttpCacheSMP8HTTPInfobb+0x285)[0x56a18d]
>
> /usr/local/ATS/3.2.0/bin/traffic_server(_ZN6HttpSM22do_cache_prepare_writeEv+0x4e)[0x576272]
>
> /usr/local/ATS/3.2.0/bin/traffic_server(_ZN6HttpSM14set_next_stateEv+0xc44)[0x571fe0]
>
> /usr/local/ATS/3.2.0/bin/traffic_server(_ZN6HttpSM32call_transact_and_set_next_stateEPFvPN12HttpTransact5StateEE+0x1a7)[0x571395]
>
> /usr/local/ATS/3.2.0/bin/traffic_server(_ZN6HttpSM17handle_api_returnEv+0x138)[0x560f46]
>
> /usr/local/ATS/3.2.0/bin/traffic_server(_ZN6HttpSM17state_api_calloutEiPv+0x82a)[0x560da2]
>
> /usr/local/ATS/3.2.0/bin/traffic_server(_ZN6HttpSM23do_api_callout_internalEv+0x18a)[0x56b4f4]
>
> /usr/local/ATS/3.2.0/bin/traffic_server(_ZN6HttpSM14do_api_calloutEv+0x26)[0x5761e0]
>
> /usr/local/ATS/3.2.0/bin/traffic_server(_ZN6HttpSM14set_next_stateEv+0x4c)[0x5713e8]
>
> /usr/local/ATS/3.2.0/bin/traffic_server(_ZN6HttpSM32call_transact_and_set_next_stateEPFvPN12HttpTransact5StateEE+0x1a7)[0x571395]
>
> /usr/local/ATS/3.2.0/bin/traffic_server(_ZN6HttpSM19state_hostdb_lookupEiPv+0x15a)[0x562cdc]
>
> /usr/local/ATS/3.2.0/bin/traffic_server(_ZN6HttpSM12main_handlerEiPv+0x236)[0x563fb0]
>
> /usr/local/ATS/3.2.0/bin/traffic_server(_ZN12Continuation11handleEventEiPv+0x6c)[0x4df742]
>
> /usr/local/ATS/3.2.0/bin/traffic_server[0x613c6c]
> /usr/local/ATS/3.2.0/bin/traffic_server(_ZN18HostDBContinuation10probeEventEiP5Event+0x26f)[0x6189cf]
>
> /usr/local/ATS/3.2.0/bin/traffic_server(_ZN18HostDBContinuation15dnsPendingEventEiP5Event+0x1c5)[0x6172bd]
>
> /usr/local/ATS/3.2.0/bin/traffic_server(_ZN12Continuation11handleEventEiPv+0x6c)[0x4df742]
>
> /usr/local/ATS/3.2.0/bin/traffic_server(_ZN18HostDBContinuation26remove_trigger_pending_dnsEv+0x12d)[0x618cc9]
>
> /usr/local/ATS/3.2.0/bin/traffic_server(_ZN18HostDBContinuation8dnsEventEiP7HostEnt+0xe98)[0x618270]
>
> /usr/local/ATS/3.2.0/bin/traffic_server(_ZN12Continuation11handleEventEiPv+0x6c)[0x4df742]
>
> /usr/local/ATS/3.2.0/bin/traffic_server(_ZN8DNSEntry9postEventEiP5Event+0xbc)[0x62875a]
>
> /usr/local/ATS/3.2.0/bin/traffic_server(_ZN12Continuation11handleEventEiPv+0x6c)[0x4df742]
>
> /usr/local/ATS/3.2.0/bin/traffic_server(_ZN7EThread13process_eventEP5Eventi+0xc8)[0x6c69f6]
>
> /usr/local/ATS/3.2.0/bin/traffic_server(_ZN7EThread7executeEv+0x78)[0x6c6b9c]
>
> /usr/local/ATS/3.2.0/bin/traffic_server[0x6c5ce3]
> /lib64/libpthread.so.0[0x39136077f1]
> /lib64/libc.so.6(clone+0x6d)[0x39132e5ccd]
> [Sep 5 20:35:17.626] Manager {0x7f774deac7e0} ERROR:
> [LocalManager::pollMgmtProcessServer] Server Process terminated due to Sig
> 11: Segmentation fault
>
> ** /var/log/messages
> Sep 5 20:35:13 xxxxx kernel: Out of memory: Kill process 5564 ([ET_NET 0])
> score 981 or sacrifice child
> Sep 5 20:35:13 xxxxx kernel: Killed process 5564, UID 100, ([ET_NET 0])
> total-vm:52057468kB, anon-rss:48381076kB, file-rss:2048kB
> Sep 5 20:35:14 xxxxx traffic_manager[7564]: NOTE: --- Manager Starting ---
> Sep 5 20:35:14 xxxxx traffic_manager[7564]: NOTE: Manager Version: Apache
> Traffic Server - traffic_manager - 3.2.0 - (build # 8322 on Sep 3 2012 at
> 22:29:33)
> Sep 5 20:35:14 xxxxx traffic_manager[7564]: {0x7f774deac7e0} STATUS:
> opened /usr/local/ATS/var/log/trafficserver/manager.log
> Sep 5 20:35:17 xxxxx traffic_server[7578]: NOTE: --- Server Starting ---
> Sep 5 20:35:17 xxxxx traffic_server[7578]: NOTE: Server Version: Apache
> Traffic Server - traffic_server - 3.2.0 - (build # 8322 on Sep 3 2012 at
> 22:30:23)
> Sep 5 20:35:17 xxxxx kernel: [ET_NET 1][7580]: segfault at 9 ip
> 00002b64b43b8906 sp 00002b6491bd1680 error 4 in gzip.so[2b64b43ac000+f000]
>
>
>
>
>
>

Reply via email to