[trafficserver] branch master updated: coverity 1021762: Uninitialized scalar field
This is an automated email from the ASF dual-hosted git repository. bcall pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/trafficserver.git The following commit(s) were added to refs/heads/master by this push: new 9a95e4a coverity 1021762: Uninitialized scalar field 9a95e4a is described below commit 9a95e4a67c7f0d383884e50eb698a8947d07da7f Author: Bryan CallAuthorDate: Tue May 9 13:36:11 2017 -0400 coverity 1021762: Uninitialized scalar field --- iocore/cache/P_CacheDisk.h | 58 +++--- 1 file changed, 19 insertions(+), 39 deletions(-) diff --git a/iocore/cache/P_CacheDisk.h b/iocore/cache/P_CacheDisk.h index dd6e851..b110880 100644 --- a/iocore/cache/P_CacheDisk.h +++ b/iocore/cache/P_CacheDisk.h @@ -80,50 +80,30 @@ struct DiskHeader { }; struct CacheDisk : public Continuation { - DiskHeader *header; - char *path; - int header_len; + DiskHeader *header = nullptr; + char *path = nullptr; + int header_len = 0; AIOCallbackInternal io; - off_t len; // in blocks (STORE_BLOCK) - off_t start; - off_t skip; - off_t num_usable_blocks; - int hw_sector_size; - int fd; - off_t free_space; - off_t wasted_space; - DiskVol **disk_vols; - DiskVol *free_blocks; - int num_errors; - int cleared; - bool read_only_p; - bool online; /* flag marking cache disk online or offline (because of too many failures or by the operator). */ + off_t len = 0; // in blocks (STORE_BLOCK) + off_t start = 0; + off_t skip = 0; + off_t num_usable_blocks = 0; + int hw_sector_size = 0; + int fd = -1; + off_t free_space= 0; + off_t wasted_space = 0; + DiskVol **disk_vols = nullptr; + DiskVol *free_blocks= nullptr; + int num_errors = 0; + int cleared = 0; + bool read_only_p= false; + bool online = true; /* flag marking cache disk online or offline (because of too many failures or by the operator). */ // Extra configuration values - int forced_volume_num; ///< Volume number for this disk. + int forced_volume_num = -1; ///< Volume number for this disk. ats_scoped_str hash_base_string; ///< Base string for hash seed. - CacheDisk() -: Continuation(new_ProxyMutex()), - header(nullptr), - path(nullptr), - header_len(0), - len(0), - start(0), - skip(0), - num_usable_blocks(0), - fd(-1), - free_space(0), - wasted_space(0), - disk_vols(nullptr), - free_blocks(nullptr), - num_errors(0), - cleared(0), - read_only_p(false), - online(true), - forced_volume_num(-1) - { - } + CacheDisk() : Continuation(new_ProxyMutex()) {} ~CacheDisk(); -- To stop receiving notification emails like this one, please contact ['"commits@trafficserver.apache.org" '].
[trafficserver] branch master updated: Coverity 1021689 - Uninitialized pointer field
This is an automated email from the ASF dual-hosted git repository. sorber pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/trafficserver.git The following commit(s) were added to refs/heads/master by this push: new adaf6af Coverity 1021689 - Uninitialized pointer field adaf6af is described below commit adaf6af9dff8877dc2d464ac959b3c412458bbe9 Author: Steven FeltnerAuthorDate: Tue May 9 11:58:02 2017 -0700 Coverity 1021689 - Uninitialized pointer field --- proxy/http/remap/RemapPlugins.h | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/proxy/http/remap/RemapPlugins.h b/proxy/http/remap/RemapPlugins.h index e7c6dd9..8e133d4 100644 --- a/proxy/http/remap/RemapPlugins.h +++ b/proxy/http/remap/RemapPlugins.h @@ -75,11 +75,11 @@ struct RemapPlugins : public Continuation { Action action; private: - unsigned int _cur; - HttpTransact::State *_s; - URL *_request_url; - HTTPHdr *_request_header; - host_hdr_info *_hh_ptr; + unsigned int _cur= 0; + HttpTransact::State *_s = nullptr; + URL *_request_url= nullptr; + HTTPHdr *_request_header = nullptr; + host_hdr_info *_hh_ptr = nullptr; }; #endif -- To stop receiving notification emails like this one, please contact ['"commits@trafficserver.apache.org" '].
[trafficserver] branch master updated: coverity 1021765: Uninitialized pointer field
This is an automated email from the ASF dual-hosted git repository. bcall pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/trafficserver.git The following commit(s) were added to refs/heads/master by this push: new 2b132c2 coverity 1021765: Uninitialized pointer field 2b132c2 is described below commit 2b132c22bcc039dffb9230ea49b7a1da5a88dfbe Author: Bryan CallAuthorDate: Tue May 9 12:05:49 2017 -0400 coverity 1021765: Uninitialized pointer field --- iocore/cache/CachePagesInternal.cc | 11 --- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/iocore/cache/CachePagesInternal.cc b/iocore/cache/CachePagesInternal.cc index 7cf8de1..069baa0 100644 --- a/iocore/cache/CachePagesInternal.cc +++ b/iocore/cache/CachePagesInternal.cc @@ -27,10 +27,10 @@ #include "I_Tasks.h" struct ShowCacheInternal : public ShowCont { - int vol_index; - int seg_index; + int vol_index = 0; + int seg_index = 0; CacheKey show_cache_key; - CacheVC *cache_vc; + CacheVC *cache_vc = nullptr; int showMain(int event, Event *e); int showEvacuations(int event, Event *e); @@ -44,10 +44,7 @@ struct ShowCacheInternal : public ShowCont { int showVolConnections(int event, Event *e); #endif - ShowCacheInternal(Continuation *c, HTTPHdr *h) : ShowCont(c, h), vol_index(0), seg_index(0) - { -SET_HANDLER(::showMain); - } + ShowCacheInternal(Continuation *c, HTTPHdr *h) : ShowCont(c, h) { SET_HANDLER(::showMain); } ~ShowCacheInternal() override {} }; -- To stop receiving notification emails like this one, please contact ['"commits@trafficserver.apache.org" '].
[trafficserver] branch master updated: clang-format
This is an automated email from the ASF dual-hosted git repository. sorber pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/trafficserver.git The following commit(s) were added to refs/heads/master by this push: new cff9bcb clang-format cff9bcb is described below commit cff9bcb62efe441e39cbff4acd20379e7ef58038 Author: Phil SorberAuthorDate: Tue May 9 15:43:48 2017 -0600 clang-format --- proxy/hdrs/HdrToken.cc | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/proxy/hdrs/HdrToken.cc b/proxy/hdrs/HdrToken.cc index a1ba721..15bec01 100644 --- a/proxy/hdrs/HdrToken.cc +++ b/proxy/hdrs/HdrToken.cc @@ -104,8 +104,9 @@ static const char *_hdrtoken_strs[] = { "rtsp", "mmsu", "mmst", "mms", "wss", "ws", // HTTP methods - // replaced ICP with DNT(DO NOT TRACK is a placeholder and not a method) as it breaks cache compatibility as wksid is stored in cache. - "CONNECT", "DELETE", "GET", "POST", "HEAD", "DNT" , "OPTIONS", "PURGE", "PUT", "TRACE", "PUSH", + // replaced ICP with DNT(DO NOT TRACK is a placeholder and not a method) as it breaks cache compatibility as wksid is stored in + // cache. + "CONNECT", "DELETE", "GET", "POST", "HEAD", "DNT", "OPTIONS", "PURGE", "PUT", "TRACE", "PUSH", // Header extensions "X-ID", "X-Forwarded-For", "TE", "Strict-Transport-Security", "100-continue", @@ -350,7 +351,8 @@ static const char *_hdrtoken_commonly_tokenized_strs[] = { "rtsp", "mmsu", "mmst", "mms", "wss", "ws", // HTTP methods - // replaced ICP with DNT(DO NOT TRACK is a placeholder and not a method) as it breaks cache compatibility as wksid is stored in cache. + // replaced ICP with DNT(DO NOT TRACK is a placeholder and not a method) as it breaks cache compatibility as wksid is stored in + // cache. "CONNECT", "DELETE", "GET", "POST", "HEAD", "DNT", "OPTIONS", "PURGE", "PUT", "TRACE", "PUSH", // Header extensions -- To stop receiving notification emails like this one, please contact ['"commits@trafficserver.apache.org" '].
[trafficserver] branch master updated: coverity 1021761: Uninitialized pointer field
This is an automated email from the ASF dual-hosted git repository. zwoop pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/trafficserver.git The following commit(s) were added to refs/heads/master by this push: new 2ee432b coverity 1021761: Uninitialized pointer field 2ee432b is described below commit 2ee432b31a466c94f712e4688bede0cb7a2cc8fb Author: Bryan CallAuthorDate: Tue May 9 15:12:53 2017 -0400 coverity 1021761: Uninitialized pointer field --- iocore/cache/P_CacheVol.h | 98 ++- 1 file changed, 37 insertions(+), 61 deletions(-) diff --git a/iocore/cache/P_CacheVol.h b/iocore/cache/P_CacheVol.h index 77cf832..095f566 100644 --- a/iocore/cache/P_CacheVol.h +++ b/iocore/cache/P_CacheVol.h @@ -121,58 +121,58 @@ struct EvacuationBlock { }; struct Vol : public Continuation { - char *path; + char *path = nullptr; ats_scoped_str hash_text; CryptoHash hash_id; - int fd; - - char *raw_dir; - Dir *dir; - VolHeaderFooter *header; - VolHeaderFooter *footer; - int segments; - off_t buckets; - off_t recover_pos; - off_t prev_recover_pos; - off_t scan_pos; - off_t skip; // start of headers - off_t start; // start of data - off_t len; - off_t data_blocks; - int hit_evacuate_window; + int fd = -1; + + char *raw_dir = nullptr; + Dir *dir= nullptr; + VolHeaderFooter *header = nullptr; + VolHeaderFooter *footer = nullptr; + int segments= 0; + off_t buckets = 0; + off_t recover_pos = 0; + off_t prev_recover_pos = 0; + off_t scan_pos = 0; + off_t skip = 0; // start of headers + off_t start = 0; // start of data + off_t len = 0; + off_t data_blocks = 0; + int hit_evacuate_window = 0; AIOCallbackInternal io; Queue agg; Queue stat_cache_vcs; Queue sync; - char *agg_buffer; - int agg_todo_size; - int agg_buf_pos; + char *agg_buffer = nullptr; + int agg_todo_size = 0; + int agg_buf_pos = 0; - Event *trigger; + Event *trigger = nullptr; OpenDir open_dir; - RamCache *ram_cache; - int evacuate_size; + RamCache *ram_cache = nullptr; + int evacuate_size = 0; DLL *evacuate; DLL lookaside[LOOKASIDE_SIZE]; - CacheVC *doc_evacuator; + CacheVC *doc_evacuator = nullptr; - VolInitInfo *init_info; + VolInitInfo *init_info = nullptr; - CacheDisk *disk; - Cache *cache; - CacheVol *cache_vol; - uint32_t last_sync_serial; - uint32_t last_write_serial; - uint32_t sector_size; - bool recover_wrapped; - bool dir_sync_waiting; - bool dir_sync_in_progress; - bool writing_end_marker; + CacheDisk *disk= nullptr; + Cache *cache = nullptr; + CacheVol *cache_vol= nullptr; + uint32_t last_sync_serial = 0; + uint32_t last_write_serial = 0; + uint32_t sector_size = 0; + bool recover_wrapped = false; + bool dir_sync_waiting = false; + bool dir_sync_in_progress = false; + bool writing_end_marker= false; CacheKey first_fragment_key; - int64_t first_fragment_offset; + int64_t first_fragment_offset = 0; Ptr first_fragment_data; void cancel_trigger(); @@ -245,31 +245,7 @@ struct Vol : public Continuation { int within_hit_evacuate_window(Dir *dir); uint32_t round_to_approx_size(uint32_t l); - Vol() -: Continuation(new_ProxyMutex()), - path(nullptr), - fd(-1), - dir(0), - buckets(0), - recover_pos(0), - prev_recover_pos(0), - scan_pos(0), - skip(0), - start(0), - len(0), - data_blocks(0), - hit_evacuate_window(0), - agg_todo_size(0), - agg_buf_pos(0), - trigger(0), - evacuate_size(0), - disk(nullptr), - last_sync_serial(0), - last_write_serial(0), - recover_wrapped(false), - dir_sync_waiting(0), - dir_sync_in_progress(0), - writing_end_marker(0) + Vol() : Continuation(new_ProxyMutex()) { open_dir.mutex = mutex; agg_buffer = (char *)ats_memalign(ats_pagesize(), AGG_SIZE); -- To stop receiving notification emails like this one, please contact ['"commits@trafficserver.apache.org" '].
[trafficserver] branch master updated: Coverity 1021705: Uninitialized pointer field
This is an automated email from the ASF dual-hosted git repository. zwoop pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/trafficserver.git The following commit(s) were added to refs/heads/master by this push: new 2601e0e Coverity 1021705: Uninitialized pointer field 2601e0e is described below commit 2601e0e202dff8dd9b7f1cf641b75514453ff820 Author: Leif HedstromAuthorDate: Tue May 9 14:16:53 2017 -0400 Coverity 1021705: Uninitialized pointer field This also cleans up the Matcher class layout, such that we cleanly initialize everything in one place. --- iocore/cache/CacheHosting.cc | 9 +-- iocore/cache/P_CacheHosting.h | 12 ++-- proxy/ControlMatcher.cc | 35 ++ proxy/ControlMatcher.h| 154 +- 4 files changed, 91 insertions(+), 119 deletions(-) diff --git a/iocore/cache/CacheHosting.cc b/iocore/cache/CacheHosting.cc index 5eb45b0..6952205 100644 --- a/iocore/cache/CacheHosting.cc +++ b/iocore/cache/CacheHosting.cc @@ -29,8 +29,6 @@ extern int gndisks; -matcher_tags CacheHosting_tags = {"hostname", "domain", nullptr, nullptr, nullptr, nullptr, false}; - /* * Begin class HostMatcher */ @@ -184,14 +182,9 @@ CacheHostTable::CacheHostTable(Cache *c, CacheType typ) { ats_scoped_str config_path; - config_tags = _tags; - ink_assert(config_tags != nullptr); - type = typ; cache= c; matcher_name = "[CacheHosting]"; - ; - hostMatch = nullptr; config_path = RecConfigReadConfigPath("proxy.config.cache.hosting_filename"); ink_release_assert(config_path); @@ -284,7 +277,7 @@ CacheHostTable::BuildTableFromString(const char *config_file_path, char *file_bu if (*tmp != '#' && *tmp != '\0') { current = (matcher_line *)ats_malloc(sizeof(matcher_line)); - errPtr = parseConfigLine((char *)tmp, current, config_tags); + errPtr = parseConfigLine((char *)tmp, current, _tags); if (errPtr != nullptr) { RecSignalWarning(REC_SIGNAL_CONFIG_ERROR, "%s discarding %s entry at line %d : %s", matcher_name, config_file_path, diff --git a/iocore/cache/P_CacheHosting.h b/iocore/cache/P_CacheHosting.h index 7902682..cd85f6b 100644 --- a/iocore/cache/P_CacheHosting.h +++ b/iocore/cache/P_CacheHosting.h @@ -144,15 +144,15 @@ public: REC_RegisterConfigUpdateFunc("proxy.config.cache.hosting_filename", CacheHostTable::config_callback, (void *)p); } - CacheType type; - Cache *cache; - int m_numEntries; + CacheType type = CACHE_HTTP_TYPE; + Cache *cache = nullptr; + int m_numEntries = 0; CacheHostRecord gen_host_rec; private: - CacheHostMatcher *hostMatch; - const matcher_tags *config_tags; - const char *matcher_name; // Used for Debug/Warning/Error messages + CacheHostMatcher *hostMatch= nullptr; + const matcher_tags config_tags = {"hostname", "domain", nullptr, nullptr, nullptr, nullptr, false}; + const char *matcher_name = "unknown"; // Used for Debug/Warning/Error messages }; struct CacheHostTableConfig; diff --git a/proxy/ControlMatcher.cc b/proxy/ControlMatcher.cc index 7981bf0..5f290d6 100644 --- a/proxy/ControlMatcher.cc +++ b/proxy/ControlMatcher.cc @@ -88,8 +88,7 @@ HttpRequestData::get_client_ip() */ template -HostMatcher::HostMatcher(const char *name, const char *filename) - : data_array(nullptr), array_len(-1), num_el(-1), matcher_name(name), file_name(filename) +HostMatcher::HostMatcher(const char *name, const char *filename) : BaseMatcher(name, filename) { host_lookup = new HostLookup(name); } @@ -97,7 +96,6 @@ HostMatcher::HostMatcher(const char *name, const char *filena template HostMatcher::~HostMatcher() { delete host_lookup; - delete[] data_array; } // @@ -142,9 +140,8 @@ HostMatcher::AllocateSpace(int num_entries) host_lookup->AllocateSpace(num_entries); data_array = new Data[num_entries]; - - array_len = num_entries; - num_el= 0; + array_len = num_entries; + num_el = 0; } // void HostMatcher::Match(RequestData* rdata, MatchResult* result) @@ -237,15 +234,7 @@ HostMatcher::NewEntry(matcher_line *line_info) // UrlMatcher::UrlMatcher() // template -UrlMatcher::UrlMatcher(const char *name, const char *filename) - : url_ht(nullptr), -url_str(nullptr), -url_value(nullptr), -data_array(nullptr), -array_len(0), -num_el(-1), -matcher_name(name), -file_name(filename) +UrlMatcher::UrlMatcher(const char *name, const char *filename) : BaseMatcher(name, filename) { url_ht =
[trafficserver] branch 7.1.x updated: h2spec: handling PRIORITY frame that depend on itself
This is an automated email from the ASF dual-hosted git repository. zwoop pushed a commit to branch 7.1.x in repository https://gitbox.apache.org/repos/asf/trafficserver.git The following commit(s) were added to refs/heads/7.1.x by this push: new 625cc1b h2spec: handling PRIORITY frame that depend on itself 625cc1b is described below commit 625cc1bb495985825e1e1952cdc10a6ed3b81678 Author: Zizhong ZhangAuthorDate: Tue May 2 15:45:30 2017 -0700 h2spec: handling PRIORITY frame that depend on itself (cherry picked from commit 0098932a0094c28034bf0743825491d141ee0b99) --- proxy/http2/Http2ConnectionState.cc | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/proxy/http2/Http2ConnectionState.cc b/proxy/http2/Http2ConnectionState.cc index 93d5ed7..8b26b12 100644 --- a/proxy/http2/Http2ConnectionState.cc +++ b/proxy/http2/Http2ConnectionState.cc @@ -270,7 +270,7 @@ rcv_headers_frame(Http2ConnectionState , const Http2Frame ) } // Protocol error if the stream depends on itself if (stream_id == params.priority.stream_dependency) { - return Http2Error(Http2ErrorClass::HTTP2_ERROR_CLASS_CONNECTION, Http2ErrorCode::HTTP2_ERROR_PROTOCOL_ERROR, + return Http2Error(Http2ErrorClass::HTTP2_ERROR_CLASS_STREAM, Http2ErrorCode::HTTP2_ERROR_PROTOCOL_ERROR, "recv headers self dependency"); } @@ -387,6 +387,12 @@ rcv_priority_frame(Http2ConnectionState , const Http2Frame ) "priority parse error"); } + // A stream cannot depend on itself. An endpoint MUST treat this as a stream error of type PROTOCOL_ERROR. + if (stream_id == priority.stream_dependency) { +return Http2Error(Http2ErrorClass::HTTP2_ERROR_CLASS_STREAM, Http2ErrorCode::HTTP2_ERROR_PROTOCOL_ERROR, + "PRIORITY frame depends on itself"); + } + DebugHttp2Stream(cstate.ua_session, stream_id, "PRIORITY - dep: %d, weight: %d, excl: %d, tree size: %d", priority.stream_dependency, priority.weight, priority.exclusive_flag, cstate.dependency_tree->size()); -- To stop receiving notification emails like this one, please contact ['"commits@trafficserver.apache.org" '].
[trafficserver] branch master updated: coverity 1021731 : clean up typedef
This is an automated email from the ASF dual-hosted git repository. sorber pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/trafficserver.git The following commit(s) were added to refs/heads/master by this push: new 8346d6f coverity 1021731 : clean up typedef 8346d6f is described below commit 8346d6f8aab6848c952ac84f4759ce6d4e8dac2c Author: Jason KennyAuthorDate: Mon May 8 15:40:22 2017 -0400 coverity 1021731 : clean up typedef --- lib/ts/IpMap.cc | 56 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/lib/ts/IpMap.cc b/lib/ts/IpMap.cc index 81e71a9..95ee7ca 100644 --- a/lib/ts/IpMap.cc +++ b/lib/ts/IpMap.cc @@ -134,7 +134,7 @@ namespace detail struct IpMapBase { friend class ::IpMap; -typedef IpMapBase self; ///< Self reference type. +typedef IpMapBase self_type; ///< Self reference type. typedef typename N::ArgType ArgType; ///< Import type. typedef typename N::Metric Metric; ///< Import type.g482 @@ -144,10 +144,10 @@ namespace detail All addresses in the range [ @a min , @a max ] are marked with @a data. @return This object. */ -self (ArgType min, ///< Minimum value in range. - ArgType max, ///< Maximum value in range. - void *data = nullptr ///< Client data payload. - ); +self_type (ArgType min, ///< Minimum value in range. +ArgType max, ///< Maximum value in range. +void *data = nullptr ///< Client data payload. +); /** Unmark addresses. All addresses in the range [ @a min , @a max ] are cleared @@ -155,7 +155,7 @@ namespace detail @return This object. */ -self (ArgType min, ArgType max); +self_type (ArgType min, ArgType max); /** Fill addresses. @@ -167,7 +167,7 @@ namespace detail @return This object. */ -self (ArgType min, ArgType max, void *data = nullptr); +self_type (ArgType min, ArgType max, void *data = nullptr); /** Test for membership. @@ -186,7 +186,7 @@ namespace detail @return This object. */ -self (); +self_type (); /** Lower bound for @a target. @return The node whose minimum value is the largest that is not greater than @a target, or @c nullptr if @@ -226,7 +226,7 @@ namespace detail /// Print all spans. /// @return This map. -self (); +self_type (); // Helper methods. N * @@ -735,14 +735,14 @@ namespace detail friend struct IpMapBase; public: -typedef Ip4Node self; ///< Self reference type. +typedef Ip4Node self_type; ///< Self reference type. /// Construct with values. Ip4Node(ArgType min, ///< Minimum address (host order). ArgType max, ///< Maximum address (host order). void *data ///< Client data. ) - : Node(data), Ip4Span(min, max) + : Node(data), Ip4Span(min, max), _sa() { ats_ip4_set(ats_ip_sa_cast(&_sa._min), htonl(min)); ats_ip4_set(ats_ip_sa_cast(&_sa._max), htonl(max)); @@ -760,7 +760,7 @@ namespace detail return ats_ip_sa_cast(&_sa._max); } /// Set the client data. -self & +self_type & setData(void *data ///< Client data. ) override { @@ -771,7 +771,7 @@ namespace detail protected: /// Set the minimum value of the interval. /// @return This interval. -self & +self_type & setMin(ArgType min ///< Minimum value (host order). ) { @@ -782,7 +782,7 @@ namespace detail /// Set the maximum value of the interval. /// @return This interval. -self & +self_type & setMax(ArgType max ///< Maximum value (host order). ) { @@ -794,7 +794,7 @@ namespace detail /** Set the maximum value to one less than @a max. @return This object. */ -self & +self_type & setMaxMinusOne(ArgType max ///< One more than maximum value. ) { @@ -803,7 +803,7 @@ namespace detail /** Set the minimum value to one more than @a min. @return This object. */ -self & +self_type & setMinPlusOne(ArgType min ///< One less than minimum value. ) { @@ -812,7 +812,7 @@ namespace detail /** Decremement the maximum value in place. @return This object. */ -self & +self_type & decrementMax() { this->setMax(_max - 1); @@ -821,7 +821,7 @@ namespace detail /** Increment the minimum value in place. @return This object. */ -self & +self_type & incrementMin() { this->setMin(_min + 1); @@ -880,7 +880,7 @@ namespace detail friend struct IpMapBase; public: -typedef Ip6Node self; ///< Self
[trafficserver] branch master updated: Converity 1373288: Dereference after null check
This is an automated email from the ASF dual-hosted git repository. gancho pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/trafficserver.git The following commit(s) were added to refs/heads/master by this push: new 440d290 Converity 1373288: Dereference after null check 440d290 is described below commit 440d290c53a74d517f3b3d73548fd0e6967336a3 Author: Gancho TenevAuthorDate: Tue May 9 08:44:27 2017 -0700 Converity 1373288: Dereference after null check Problem: CID 1373288 (#1 of 1): Dereference after null check (FORWARD_NULL) 20. var_deref_model: Passing null pointer expire to strtol, which dereferences it. Fix: Missing expiration query parameter and missing expiration query parameter value should be treated the same (expire=0). --- example/secure-link/secure-link.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/example/secure-link/secure-link.c b/example/secure-link/secure-link.c index d2b691a..b38d9d6 100644 --- a/example/secure-link/secure-link.c +++ b/example/secure-link/secure-link.c @@ -116,7 +116,7 @@ TSRemapDoRemap(void *ih, TSHttpTxn rh, TSRemapRequestInfo *rri) sprintf([i * 2], "%02x", md[i]); } time(); - e = strtol(expire, NULL, 16); + e = (NULL == expire ? 0 : strtol(expire, NULL, 16)); i = TSREMAP_DID_REMAP; if (e < t || strcmp(hash, token) != 0) { if (e < t) { -- To stop receiving notification emails like this one, please contact ['"commits@trafficserver.apache.org" '].
[trafficserver] branch 1021763 deleted (was 70b277f)
This is an automated email from the ASF dual-hosted git repository. bcall pushed a change to branch 1021763 in repository https://gitbox.apache.org/repos/asf/trafficserver.git. was 70b277f coverity 1021763: Uninitialized pointer field The revisions that were on this branch are still contained in other references; therefore, this change does not discard any commits from the repository. -- To stop receiving notification emails like this one, please contact ['"commits@trafficserver.apache.org"'].
[trafficserver] branch master updated: Remove even more clustering bits
This is an automated email from the ASF dual-hosted git repository. sorber pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/trafficserver.git The following commit(s) were added to refs/heads/master by this push: new 17ea1d0 Remove even more clustering bits 17ea1d0 is described below commit 17ea1d09049d56765cff2d39e2e17a5da92b78a1 Author: Phil SorberAuthorDate: Tue May 9 11:45:15 2017 -0600 Remove even more clustering bits --- INSTALL| 12 - cmd/traffic_manager/AddConfigFilesHere.cc | 1 - contrib/python/compare_RecordsConfigcc.py | 1 - iocore/cache/P_CacheInternal.h | 1 - iocore/eventsystem/I_Event.h | 1 - iocore/hostdb/HostDB.cc| 2 +- iocore/hostdb/P_HostDBProcessor.h | 12 - iocore/hostdb/include/Machine.h| 115 -- iocore/net/P_UnixNetState.h| 3 - lib/perl/lib/Apache/TS/AdminClient.pm | 34 -- lib/records/I_RecDefs.h| 2 +- lib/records/I_RecEvents.h | 1 - lib/records/P_RecDefs.h| 6 - lib/ts/I_Version.h | 2 - lib/ts/InkErrno.cc | 18 - lib/ts/InkErrno.h | 10 - lib/ts/apidefs.h.in| 4 +- mgmt/RecordsConfig.cc | 12 - mgmt/api/APITestCliRemote.cc | 141 --- mgmt/api/CfgContextImpl.cc | 114 -- mgmt/api/CfgContextImpl.h | 26 -- mgmt/api/CfgContextUtils.cc| 41 +- mgmt/api/CfgContextUtils.h | 1 - mgmt/api/EventControlMain.cc | 1 - mgmt/api/GenericParser.cc | 29 -- mgmt/api/GenericParser.h | 1 - mgmt/api/INKMgmtAPI.cc | 33 +- mgmt/api/NetworkMessage.cc | 3 - mgmt/api/NetworkMessage.h | 1 - mgmt/api/TSControlMain.cc | 1 - mgmt/api/include/mgmtapi.h | 18 +- proxy/Main.h | 3 - proxy/README-stats.otl | 15 +- proxy/TestProxy.cc | 427 - proxy/TimeTrace.h | 3 - proxy/api/ts/experimental.h| 143 --- proxy/config/Makefile.am | 2 - proxy/config/cluster.config.default| 26 -- proxy/config/metrics.config.default| 326 proxy/config/vaddrs.config.default | 22 -- proxy/http/HttpTransact.h | 1 - proxy/http/README.via | 1 - proxy/http/TestHttpTransact.cc | 95 - proxy/logging/Log.cc | 2 +- proxy/logging/LogSock.cc | 6 +- proxy/logging/LogSock.h| 4 +- tests/getting_started.md | 1 - .../gold_tests/autest-site/trafficserver.test.ext | 4 - tools/traffic_shell.pl | 17 - 49 files changed, 19 insertions(+), 1726 deletions(-) diff --git a/INSTALL b/INSTALL index 597bb56..2105ea6 100644 --- a/INSTALL +++ b/INSTALL @@ -56,18 +56,6 @@ To compile with an alternate set of compilers, e.g. LLVM/Clang $ ./configure CC=clang CXX=clang++ -INITIAL CONFIGURATION -- - -Next set the cluster interface in 'records.config'. The network -interface name will vary depending on the host operating system. - -For example: -Linux: CONFIG proxy.config.cluster.ethernet_interface STRING eth0 -OS X: CONFIG proxy.config.cluster.ethernet_interface STRING en0 -FreeBSD: CONFIG proxy.config.cluster.ethernet_interface STRING em0 -OpenSolaris: CONFIG proxy.config.cluster.ethernet_interface STRING e1000g0 - To start the Traffic Server process stack (TC, TM, TS): $ sudo PREFIX/bin/trafficserver start diff --git a/cmd/traffic_manager/AddConfigFilesHere.cc b/cmd/traffic_manager/AddConfigFilesHere.cc index 35fddb0..0bc2bd0 100644 --- a/cmd/traffic_manager/AddConfigFilesHere.cc +++ b/cmd/traffic_manager/AddConfigFilesHere.cc @@ -66,7 +66,6 @@ initializeRegistry() configFiles->addFile("storage.config", false); configFiles->addFile("socks.config", false); configFiles->addFile("records.config", false); - configFiles->addFile("vaddrs.config", false); configFiles->addFile("cache.config", false); configFiles->addFile("icp.config", false); configFiles->addFile("ip_allow.config", false); diff
[trafficserver] branch 1021763 created (now 70b277f)
This is an automated email from the ASF dual-hosted git repository. bcall pushed a change to branch 1021763 in repository https://gitbox.apache.org/repos/asf/trafficserver.git. at 70b277f coverity 1021763: Uninitialized pointer field This branch includes the following new commits: new 70b277f coverity 1021763: Uninitialized pointer field The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "adds" were already present in the repository and have only been added to this reference. -- To stop receiving notification emails like this one, please contact ['"commits@trafficserver.apache.org"'].
[trafficserver] 01/01: coverity 1021763: Uninitialized pointer field
This is an automated email from the ASF dual-hosted git repository. bcall pushed a commit to branch 1021763 in repository https://gitbox.apache.org/repos/asf/trafficserver.git commit 70b277f7658b9da9fb2169c0d7ac8f2142d0cd47 Author: Bryan CallAuthorDate: Tue May 9 12:18:24 2017 -0400 coverity 1021763: Uninitialized pointer field --- iocore/cache/CacheTest.cc | 20 +--- iocore/cache/P_CacheTest.h | 36 ++-- 2 files changed, 19 insertions(+), 37 deletions(-) diff --git a/iocore/cache/CacheTest.cc b/iocore/cache/CacheTest.cc index a0e5073..52d3b30 100644 --- a/iocore/cache/CacheTest.cc +++ b/iocore/cache/CacheTest.cc @@ -30,25 +30,7 @@ using namespace std; -CacheTestSM::CacheTestSM(RegressionTest *t, const char *name) - : RegressionSM(t), -start_memcpy_on_clone(0), -cache_test_name(name), -timeout(nullptr), -cache_action(nullptr), -start_time(0), -cache_vc(nullptr), -cvio(nullptr), -buffer(nullptr), -buffer_reader(nullptr), -total_size(0), -nbytes(-1), -repeat_count(0), -expect_event(EVENT_NONE), -expect_initial_event(EVENT_NONE), -initial_event(EVENT_NONE), -content_salt(0), -end_memcpy_on_clone(0) +CacheTestSM::CacheTestSM(RegressionTest *t, const char *name) : RegressionSM(t), cache_test_name(name) { SET_HANDLER(::event_handler); } diff --git a/iocore/cache/P_CacheTest.h b/iocore/cache/P_CacheTest.h index 336c533..de2b1e8 100644 --- a/iocore/cache/P_CacheTest.h +++ b/iocore/cache/P_CacheTest.h @@ -63,30 +63,30 @@ struct CacheTestHeader { }; struct CacheTestSM : public RegressionSM { - int start_memcpy_on_clone; // place all variables to be copied between these markers + int start_memcpy_on_clone = 0; // place all variables to be copied between these markers // Cache test instance name. This is a pointer to a string literal, so copying is safe. - const char *cache_test_name; - - Action *timeout; - Action *cache_action; - ink_hrtime start_time; - CacheVConnection *cache_vc; - VIO *cvio; - MIOBuffer *buffer; - IOBufferReader *buffer_reader; + const char *cache_test_name = nullptr; + + Action *timeout = nullptr; + Action *cache_action = nullptr; + ink_hrtime start_time = 0; + CacheVConnection *cache_vc= nullptr; + VIO *cvio = nullptr; + MIOBuffer *buffer = nullptr; + IOBufferReader *buffer_reader = nullptr; CacheHTTPInfo info; char urlstr[1024]; - int64_t total_size; - int64_t nbytes; + int64_t total_size = 0; + int64_t nbytes = -1; CacheKey key; - int repeat_count; - int expect_event; - int expect_initial_event; - int initial_event; - uint64_t content_salt; + int repeat_count = 0; + int expect_event = EVENT_NONE; + int expect_initial_event = EVENT_NONE; + int initial_event= EVENT_NONE; + uint64_t content_salt= 0; CacheTestHeader header; - int end_memcpy_on_clone; // place all variables to be copied between these markers + int end_memcpy_on_clone = 0; // place all variables to be copied between these markers void fill_buffer(); int check_buffer(); -- To stop receiving notification emails like this one, please contact "commits@trafficserver.apache.org" .
[trafficserver] branch master updated: Coverity - 1021688 Uninitialized scalar field.
This is an automated email from the ASF dual-hosted git repository. bcall pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/trafficserver.git The following commit(s) were added to refs/heads/master by this push: new cec4801 Coverity - 1021688 Uninitialized scalar field. cec4801 is described below commit cec48015cd389513a5282b2d6833f1b0f35df47b Author: Steven FeltnerAuthorDate: Tue May 9 08:09:34 2017 -0700 Coverity - 1021688 Uninitialized scalar field. --- proxy/http/remap/UrlMapping.cc | 16 proxy/http/remap/UrlMapping.h | 30 +++--- 2 files changed, 15 insertions(+), 31 deletions(-) diff --git a/proxy/http/remap/UrlMapping.cc b/proxy/http/remap/UrlMapping.cc index 08c335b..e324c1c 100644 --- a/proxy/http/remap/UrlMapping.cc +++ b/proxy/http/remap/UrlMapping.cc @@ -29,22 +29,6 @@ * **/ url_mapping::url_mapping(int rank /* = 0 */) - : from_path_len(0), -fromURL(), -toUrl(), -homePageRedirect(false), -unique(false), -default_redirect_url(false), -optional_referer(false), -negative_referer(false), -wildcard_from_scheme(false), -tag(nullptr), -filter_redirect_url(nullptr), -referer_list(nullptr), -redir_chunk_list(nullptr), -filter(nullptr), -_plugin_count(0), -_rank(rank) { memset(_plugin_list, 0, sizeof(_plugin_list)); memset(_instance_data, 0, sizeof(_instance_data)); diff --git a/proxy/http/remap/UrlMapping.h b/proxy/http/remap/UrlMapping.h index 73f87c7..f8c18c8 100644 --- a/proxy/http/remap/UrlMapping.h +++ b/proxy/http/remap/UrlMapping.h @@ -93,23 +93,23 @@ public: void delete_instance(unsigned int index); void Print(); - int from_path_len; + int from_path_len = 0; URL fromURL; URL toUrl; // Default TO-URL (from remap.config) - bool homePageRedirect; - bool unique; // INKqa11970 - unique mapping - bool default_redirect_url; - bool optional_referer; - bool negative_referer; - bool wildcard_from_scheme; // from url is '/foo', only http or https for now - char *tag; // tag - char *filter_redirect_url; // redirect url when referer filtering enabled - unsigned int map_id; - referer_info *referer_list; - redirect_tag_str *redir_chunk_list; - bool ip_allow_check_enabled_p; - acl_filter_rule *filter; // acl filtering (list of rules) - unsigned int _plugin_count; + bool homePageRedirect = false; + bool unique= false; // INKqa11970 - unique mapping + bool default_redirect_url = false; + bool optional_referer = false; + bool negative_referer = false; + bool wildcard_from_scheme = false; // from url is '/foo', only http or https for now + char *tag = nullptr; // tag + char *filter_redirect_url = nullptr; // redirect url when referer filtering enabled + unsigned int map_id= 0; + referer_info *referer_list = nullptr; + redirect_tag_str *redir_chunk_list = nullptr; + bool ip_allow_check_enabled_p = false; + acl_filter_rule *filter= nullptr; // acl filtering (list of rules) + unsigned int _plugin_count = 0; LINK(url_mapping, link); // For use with the main Queue linked list holding all the mapping int -- To stop receiving notification emails like this one, please contact ['"commits@trafficserver.apache.org" '].
[trafficserver] branch master updated: Coverity 1200018 & 1200017
This is an automated email from the ASF dual-hosted git repository. gancho pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/trafficserver.git The following commit(s) were added to refs/heads/master by this push: new da94824 Coverity 1200018 & 1200017 da94824 is described below commit da948249f541812a5d6fea6cd93fed45ea1ad52f Author: Gancho TenevAuthorDate: Tue May 9 11:26:46 2017 -0700 Coverity 1200018 & 1200017 Problem: CID 1200018 (#1 of 1): Resource leak (RESOURCE_LEAK) 13. overwrite_var: Overwriting token in token = _TSstrdup(val, -1L, "memory/secure-link/secure-link.c:70") leaks the storage that token points to. CID 1200017 (#1 of 1): Resource leak (RESOURCE_LEAK) 19. overwrite_var: Overwriting expire in expire = _TSstrdup(val, -1L, "memory/secure-link/secure-link.c:72") leaks the storage that expire points to Fix: Took the TSstrdup() for expire and token outside the loop to avoid the leak. --- example/secure-link/secure-link.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/example/secure-link/secure-link.c b/example/secure-link/secure-link.c index 7837bf1..d2b691a 100644 --- a/example/secure-link/secure-link.c +++ b/example/secure-link/secure-link.c @@ -50,7 +50,7 @@ TSRemapDoRemap(void *ih, TSHttpTxn rh, TSRemapRequestInfo *rri) const char *qh, *ph, *ip; unsigned char md[MD5_DIGEST_LENGTH]; secure_link_info *sli = (secure_link_info *)ih; - char *token = NULL, *expire = NULL, *path = NULL; + char *token = NULL, *tokenptr = NULL, *expire = NULL, *expireptr = NULL, *path = NULL; char *s, *ptr, *saveptr = NULL, *val, hash[32] = ""; in = (struct sockaddr_in *)TSHttpTxnClientAddrGet(rh); @@ -67,15 +67,17 @@ TSRemapDoRemap(void *ih, TSHttpTxn rh, TSRemapRequestInfo *rri) if ((val = strchr(ptr, '=')) != NULL) { *val++ = '\0'; if (strcmp(ptr, "st") == 0) { -token = TSstrdup(val); +tokenptr = val; } else if (strcmp(ptr, "ex") == 0) { -expire = TSstrdup(val); +expireptr = val; } } else { TSError("[secure_link] Invalid parameter [%s]", ptr); break; } } while ((ptr = strtok_r(NULL, "&", )) != NULL); + token = (NULL == tokenptr ? NULL : TSstrdup(tokenptr)); + expire = (NULL == expireptr ? NULL : TSstrdup(expireptr)); } else { TSError("[secure_link] strtok didn't find a & in the query string"); /* this is just example, so set fake params to prevent plugin crash */ -- To stop receiving notification emails like this one, please contact ['"commits@trafficserver.apache.org" '].
[trafficserver] branch master updated: clang-format
This is an automated email from the ASF dual-hosted git repository. bcall pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/trafficserver.git The following commit(s) were added to refs/heads/master by this push: new 8b02906 clang-format 8b02906 is described below commit 8b0290619d08dabbe2201f63ff97474764e3743e Author: Bryan CallAuthorDate: Tue May 9 14:31:35 2017 -0400 clang-format --- lib/ts/I_Layout.h | 30 ++ 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/lib/ts/I_Layout.h b/lib/ts/I_Layout.h index 1221c6d..dd6d47f 100644 --- a/lib/ts/I_Layout.h +++ b/lib/ts/I_Layout.h @@ -36,7 +36,6 @@ */ struct Layout { - Layout(const char *prefix = 0); ~Layout(); @@ -91,22 +90,21 @@ struct Layout { */ static Layout *get(); - char *prefix = nullptr; - char *exec_prefix = nullptr; - char *bindir = nullptr; - char *sbindir = nullptr; - char *sysconfdir = nullptr; - char *datadir = nullptr; - char *includedir = nullptr; - char *libdir = nullptr; - char *libexecdir = nullptr; + char *prefix= nullptr; + char *exec_prefix = nullptr; + char *bindir= nullptr; + char *sbindir = nullptr; + char *sysconfdir= nullptr; + char *datadir = nullptr; + char *includedir= nullptr; + char *libdir= nullptr; + char *libexecdir= nullptr; char *localstatedir = nullptr; - char *runtimedir = nullptr; - char *logdir = nullptr; - char *mandir = nullptr; - char *infodir = nullptr; - char *cachedir = nullptr; - + char *runtimedir= nullptr; + char *logdir= nullptr; + char *mandir= nullptr; + char *infodir = nullptr; + char *cachedir = nullptr; }; #endif -- To stop receiving notification emails like this one, please contact ['"commits@trafficserver.apache.org" '].
[trafficserver] branch master updated: coverity 1021730 : fix issue with return before varables are initalized
This is an automated email from the ASF dual-hosted git repository. bcall pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/trafficserver.git The following commit(s) were added to refs/heads/master by this push: new dedd72e coverity 1021730 : fix issue with return before varables are initalized dedd72e is described below commit dedd72ecb7625e0895e6308e53a4c0711833a578 Author: Jason KennyAuthorDate: Tue May 9 11:28:54 2017 -0400 coverity 1021730 : fix issue with return before varables are initalized --- lib/ts/I_Layout.h | 32 +--- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/lib/ts/I_Layout.h b/lib/ts/I_Layout.h index 8f960f9..1221c6d 100644 --- a/lib/ts/I_Layout.h +++ b/lib/ts/I_Layout.h @@ -36,21 +36,6 @@ */ struct Layout { - char *prefix; - char *exec_prefix; - char *bindir; - char *sbindir; - char *sysconfdir; - char *datadir; - char *includedir; - char *libdir; - char *libexecdir; - char *localstatedir; - char *runtimedir; - char *logdir; - char *mandir; - char *infodir; - char *cachedir; Layout(const char *prefix = 0); ~Layout(); @@ -105,6 +90,23 @@ struct Layout { */ static Layout *get(); + + char *prefix = nullptr; + char *exec_prefix = nullptr; + char *bindir = nullptr; + char *sbindir = nullptr; + char *sysconfdir = nullptr; + char *datadir = nullptr; + char *includedir = nullptr; + char *libdir = nullptr; + char *libexecdir = nullptr; + char *localstatedir = nullptr; + char *runtimedir = nullptr; + char *logdir = nullptr; + char *mandir = nullptr; + char *infodir = nullptr; + char *cachedir = nullptr; + }; #endif -- To stop receiving notification emails like this one, please contact ['"commits@trafficserver.apache.org" '].
[trafficserver] branch master updated: coverity 1021768: Uninitialized pointer field
This is an automated email from the ASF dual-hosted git repository. bcall pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/trafficserver.git The following commit(s) were added to refs/heads/master by this push: new 6dfb0cb coverity 1021768: Uninitialized pointer field 6dfb0cb is described below commit 6dfb0cb304ff0f0f15f464ab7206bd312be30b15 Author: Bryan CallAuthorDate: Tue May 9 11:40:53 2017 -0400 coverity 1021768: Uninitialized pointer field --- iocore/aio/AIO.cc | 2 +- iocore/aio/I_AIO.h | 30 +++--- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/iocore/aio/AIO.cc b/iocore/aio/AIO.cc index b5a8239..e3cf06d 100644 --- a/iocore/aio/AIO.cc +++ b/iocore/aio/AIO.cc @@ -401,7 +401,7 @@ cache_op(AIOCallbackInternal *op) { bool read = (op->aiocb.aio_lio_opcode == LIO_READ); for (; op; op = (AIOCallbackInternal *)op->then) { -ink_aiocb_t *a = >aiocb; +ink_aiocb *a = >aiocb; ssize_t err, res = 0; while (a->aio_nbytes - res > 0) { diff --git a/iocore/aio/I_AIO.h b/iocore/aio/I_AIO.h index c685d3c..e1a87e1 100644 --- a/iocore/aio/I_AIO.h +++ b/iocore/aio/I_AIO.h @@ -59,7 +59,7 @@ #define MAX_AIO_EVENTS 1024 -typedef struct iocb ink_aiocb_t; +typedef struct iocb ink_aiocb; typedef struct io_event ink_io_event_t; // XXX hokey old-school compatibility with ink_aiocb.h ... @@ -69,17 +69,17 @@ typedef struct io_event ink_io_event_t; #else -typedef struct ink_aiocb { - int aio_fildes; - volatile void *aio_buf; /* buffer location */ - size_t aio_nbytes; /* length of transfer */ - off_t aio_offset; /* file offset */ +struct ink_aiocb { + int aio_fildes = 0; + volatile void *aio_buf = nullptr; /* buffer location */ + size_t aio_nbytes = 0; /* length of transfer */ + off_t aio_offset = 0; /* file offset */ - int aio_reqprio;/* request priority offset */ - int aio_lio_opcode; /* listio operation */ - int aio_state; /* state flag for List I/O */ - int aio__pad[1];/* extension padding */ -} ink_aiocb_t; + int aio_reqprio= 0; /* request priority offset */ + int aio_lio_opcode = 0; /* listio operation */ + int aio_state = 0; /* state flag for List I/O */ + int aio__pad[1];/* extension padding */ +}; bool ink_aio_thread_num_set(int thread_num); @@ -94,12 +94,12 @@ bool ink_aio_thread_num_set(int thread_num); struct AIOCallback : public Continuation { // set before calling aio_read/aio_write - ink_aiocb_t aiocb; + ink_aiocb aiocb; Action action; - EThread *thread; - AIOCallback *then; + EThread *thread = nullptr; + AIOCallback *then = nullptr; // set on return from aio_read/aio_write - int64_t aio_result; + int64_t aio_result = 0; int ok(); AIOCallback() : thread(AIO_CALLBACK_THREAD_ANY), then(0) { aiocb.aio_reqprio = AIO_DEFAULT_PRIORITY; } -- To stop receiving notification emails like this one, please contact ['"commits@trafficserver.apache.org" '].
[trafficserver] 01/02: TS-4952: Improve abort messages for mutex failures.
This is an automated email from the ASF dual-hosted git repository. jpeach pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/trafficserver.git commit 472ec283ebd8366f6bd98f3154f524ccb8e12f7b Author: James PeachAuthorDate: Mon Oct 10 19:57:31 2016 -0700 TS-4952: Improve abort messages for mutex failures. Although the ink_mutex APIs claimed to return error values, they actually abort on failure. Improve the abort to format a message that includes the error, and don't bother to return error values any more since these can't fail. Since we now check for mutex manipulation errors, error checking mutexes (the default type on FreeBSD) will fail when we unlock a Thread mutex from a different thread than the one that created it. To solve this, we introduce TSThreadWait so that the creating thread can safely spawn a thread, wait for it and then destroy it. --- configure.ac | 1 + iocore/eventsystem/P_Thread.h | 4 --- iocore/eventsystem/Thread.cc | 9 +- lib/records/I_RecMutex.h | 8 ++--- lib/records/RecMutex.cc | 14 - lib/ts/ink_mutex.cc | 20 +++-- lib/ts/ink_mutex.h| 63 +++--- lib/ts/ink_rwlock.cc | 32 ++-- lib/ts/ink_thread.h | 1 + mgmt/api/EventControlMain.cc | 8 + proxy/InkAPITest.cc | 5 proxy/InkIOCoreAPI.cc | 70 ++- proxy/api/ts/ts.h | 1 + 13 files changed, 145 insertions(+), 91 deletions(-) diff --git a/configure.ac b/configure.ac index 1d22bdb..7401e1e 100644 --- a/configure.ac +++ b/configure.ac @@ -1091,6 +1091,7 @@ dnl Linux has pthread symbol stubss in both libc and libpthread, so it's importa dnl specifically for pthread_yield() here. In addition, ASAN hijacks pthread_create() so dnl we can't use that anymore. AC_SEARCH_LIBS([pthread_yield], [pthread], [], []) +AC_CHECK_FUNCS([pthread_mutexattr_settype]) dnl XXX The following check incorrectly causes the build to succeed dnl on Darwin. We should be using AC_SEARCH_LIBS, but rest_init is diff --git a/iocore/eventsystem/P_Thread.h b/iocore/eventsystem/P_Thread.h index c7cce80..259f1ad 100644 --- a/iocore/eventsystem/P_Thread.h +++ b/iocore/eventsystem/P_Thread.h @@ -36,10 +36,6 @@ /// // Common Interface impl // /// -TS_INLINE -Thread::~Thread() -{ -} TS_INLINE void Thread::set_specific() diff --git a/iocore/eventsystem/Thread.cc b/iocore/eventsystem/Thread.cc index d0c3712..af04099 100644 --- a/iocore/eventsystem/Thread.cc +++ b/iocore/eventsystem/Thread.cc @@ -44,7 +44,14 @@ Thread::Thread() { mutex = new_ProxyMutex(); MUTEX_TAKE_LOCK(mutex, (EThread *)this); - mutex->nthread_holding = THREAD_MUTEX_THREAD_HOLDING; + mutex->nthread_holding += THREAD_MUTEX_THREAD_HOLDING; +} + +Thread::~Thread() +{ + ink_release_assert(mutex->thread_holding == (EThread *)this); + mutex->nthread_holding -= THREAD_MUTEX_THREAD_HOLDING; + MUTEX_UNTAKE_LOCK(mutex, (EThread *)this); } static void diff --git a/lib/records/I_RecMutex.h b/lib/records/I_RecMutex.h index d175a06..fcf37ac 100644 --- a/lib/records/I_RecMutex.h +++ b/lib/records/I_RecMutex.h @@ -38,9 +38,9 @@ struct RecMutex { ink_mutex the_mutex; }; -int rec_mutex_init(RecMutex *m, const char *name = nullptr); -int rec_mutex_destroy(RecMutex *m); -int rec_mutex_acquire(RecMutex *m); -int rec_mutex_release(RecMutex *m); +void rec_mutex_init(RecMutex *m, const char *name = nullptr); +void rec_mutex_destroy(RecMutex *m); +void rec_mutex_acquire(RecMutex *m); +void rec_mutex_release(RecMutex *m); #endif diff --git a/lib/records/RecMutex.cc b/lib/records/RecMutex.cc index a03a8e6..f56fc42 100644 --- a/lib/records/RecMutex.cc +++ b/lib/records/RecMutex.cc @@ -24,23 +24,23 @@ #include "ts/ink_config.h" #include "I_RecMutex.h" -int +void rec_mutex_init(RecMutex *m, const char *name) { m->nthread_holding = 0; m->thread_holding = ink_thread_null(); - return ink_mutex_init(&(m->the_mutex), name); + ink_mutex_init(&(m->the_mutex), name); } -int +void rec_mutex_destroy(RecMutex *m) { ink_assert(m->nthread_holding == 0); ink_assert(m->thread_holding == ink_thread_null()); - return ink_mutex_destroy(&(m->the_mutex)); + ink_mutex_destroy(&(m->the_mutex)); } -int +void rec_mutex_acquire(RecMutex *m) { ink_thread this_thread = ink_thread_self(); @@ -51,10 +51,9 @@ rec_mutex_acquire(RecMutex *m) } m->nthread_holding++; - return 0; } -int +void rec_mutex_release(RecMutex *m) { if (m->nthread_holding != 0) { @@ -64,5 +63,4 @@ rec_mutex_release(RecMutex *m) ink_mutex_release(&(m->the_mutex)); } } - return 0; } diff --git a/lib/ts/ink_mutex.cc b/lib/ts/ink_mutex.cc index
[trafficserver] 02/02: Move mutex creation out of line.
This is an automated email from the ASF dual-hosted git repository. jpeach pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/trafficserver.git commit 2394fa8a56883d17dbba3cbf48fef545869ccfb4 Author: James PeachAuthorDate: Mon May 8 21:28:55 2017 -0700 Move mutex creation out of line. Move the mutex create and destroy out of the header file so that we can use static mutex attributes without exposing another global variable. --- lib/ts/ink_mutex.cc | 39 +-- lib/ts/ink_mutex.h | 46 -- 2 files changed, 37 insertions(+), 48 deletions(-) diff --git a/lib/ts/ink_mutex.cc b/lib/ts/ink_mutex.cc index 4d45f09..57a1a7f 100644 --- a/lib/ts/ink_mutex.cc +++ b/lib/ts/ink_mutex.cc @@ -29,19 +29,46 @@ ink_mutex __global_death = PTHREAD_MUTEX_INITIALIZER; -x_pthread_mutexattr_t::x_pthread_mutexattr_t() +class x_pthread_mutexattr_t { - pthread_mutexattr_init(); +public: + x_pthread_mutexattr_t() + { +pthread_mutexattr_init(); #ifndef POSIX_THREAD_10031c - pthread_mutexattr_setpshared(, PTHREAD_PROCESS_SHARED); +pthread_mutexattr_setpshared(, PTHREAD_PROCESS_SHARED); #endif #if DEBUG && HAVE_PTHREAD_MUTEXATTR_SETTYPE - pthread_mutexattr_settype(, PTHREAD_MUTEX_ERRORCHECK); +pthread_mutexattr_settype(, PTHREAD_MUTEX_ERRORCHECK); #endif + } + + ~x_pthread_mutexattr_t() { pthread_mutexattr_destroy(); } + + pthread_mutexattr_t attr; +}; + +static x_pthread_mutexattr_t attr; + +void +ink_mutex_init(ink_mutex *m, const char * /* name */) +{ + int error; + + error = pthread_mutex_init(m, ); + if (unlikely(error != 0)) { +ink_abort("pthread_mutex_init(%p) failed: %s (%d)", m, strerror(error), error); + } } -x_pthread_mutexattr_t::~x_pthread_mutexattr_t() +void +ink_mutex_destroy(ink_mutex *m) { - pthread_mutexattr_destroy(); + int error; + + error = pthread_mutex_destroy(m); + if (unlikely(error != 0)) { +ink_abort("pthread_mutex_destroy(%p) failed: %s (%d)", m, strerror(error), error); + } } diff --git a/lib/ts/ink_mutex.h b/lib/ts/ink_mutex.h index c25b7ae..5309676 100644 --- a/lib/ts/ink_mutex.h +++ b/lib/ts/ink_mutex.h @@ -32,57 +32,22 @@ ***/ -#include #include "ts/ink_defs.h" #include "ts/ink_error.h" -#if defined(POSIX_THREAD) #include #include typedef pthread_mutex_t ink_mutex; -// just a wrapper so that the constructor gets executed -// before the first call to ink_mutex_init(); -class x_pthread_mutexattr_t -{ -public: - pthread_mutexattr_t attr; - - x_pthread_mutexattr_t(); - ~x_pthread_mutexattr_t(); -}; - -static inline void -ink_mutex_init(ink_mutex *m, const char * /* name */) -{ - int error; - x_pthread_mutexattr_t attr; - - error = pthread_mutex_init(m, ); - if (unlikely(error != 0)) { -ink_abort("pthread_mutex_init(%p) failed: %s (%d)", m, strerror(error), error); - } -} - -static inline void -ink_mutex_destroy(ink_mutex *m) -{ - int error; - - error = pthread_mutex_destroy(m); - if (unlikely(error != 0)) { -ink_abort("pthread_mutex_destroy(%p) failed: %s (%d)", m, strerror(error), error); - } -} +void ink_mutex_init(ink_mutex *m, const char * /* name */); +void ink_mutex_destroy(ink_mutex *m); static inline void ink_mutex_acquire(ink_mutex *m) { - int error; - - error = pthread_mutex_lock(m); + int error = pthread_mutex_lock(m); if (unlikely(error != 0)) { ink_abort("pthread_mutex_lock(%p) failed: %s (%d)", m, strerror(error), error); } @@ -91,9 +56,7 @@ ink_mutex_acquire(ink_mutex *m) static inline void ink_mutex_release(ink_mutex *m) { - int error; - - error = pthread_mutex_unlock(m); + int error = pthread_mutex_unlock(m); if (unlikely(error != 0)) { ink_abort("pthread_mutex_unlock(%p) failed: %s (%d)", m, strerror(error), error); } @@ -105,5 +68,4 @@ ink_mutex_try_acquire(ink_mutex *m) return pthread_mutex_trylock(m) == 0; } -#endif /* #if defined(POSIX_THREAD) */ #endif /* _ink_mutex_h_ */ -- To stop receiving notification emails like this one, please contact "commits@trafficserver.apache.org" .
[trafficserver] branch master updated (18e847d -> 2394fa8)
This is an automated email from the ASF dual-hosted git repository. jpeach pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/trafficserver.git. from 18e847d Remove more clustering bits new 472ec28 TS-4952: Improve abort messages for mutex failures. new 2394fa8 Move mutex creation out of line. The 2 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "adds" were already present in the repository and have only been added to this reference. Summary of changes: configure.ac | 1 + iocore/eventsystem/P_Thread.h | 4 --- iocore/eventsystem/Thread.cc | 9 +- lib/records/I_RecMutex.h | 8 ++--- lib/records/RecMutex.cc | 14 - lib/ts/ink_mutex.cc | 47 +++-- lib/ts/ink_mutex.h| 65 lib/ts/ink_rwlock.cc | 32 ++-- lib/ts/ink_thread.h | 1 + mgmt/api/EventControlMain.cc | 8 + proxy/InkAPITest.cc | 5 proxy/InkIOCoreAPI.cc | 70 ++- proxy/api/ts/ts.h | 1 + 13 files changed, 154 insertions(+), 111 deletions(-) -- To stop receiving notification emails like this one, please contact ['"commits@trafficserver.apache.org"'].
[trafficserver] branch master updated: Remove more clustering bits
This is an automated email from the ASF dual-hosted git repository. sorber pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/trafficserver.git The following commit(s) were added to refs/heads/master by this push: new 18e847d Remove more clustering bits 18e847d is described below commit 18e847d1408cb0a9bc9dff80d83266c7930f289b Author: Phil SorberAuthorDate: Mon May 8 14:30:38 2017 -0600 Remove more clustering bits --- cmd/traffic_cop/Makefile.am | 1 - cmd/traffic_ctl/server.cc | 26 ++- cmd/traffic_ctl/traffic_ctl.cc | 1 - cmd/traffic_ctl/traffic_ctl.h | 1 - cmd/traffic_manager/AddConfigFilesHere.cc | 3 - cmd/traffic_manager/Makefile.am | 1 - cmd/traffic_manager/traffic_manager.cc | 41 ++ cmd/traffic_via/traffic_via.cc | 1 - configure.ac| 1 - iocore/cache/Cache.cc | 29 +++ iocore/cache/CachePages.cc | 5 +- iocore/cache/CacheTest.cc | 64 --- iocore/cache/CacheVol.cc| 2 +- iocore/cache/I_Cache.h | 41 +- mgmt/BaseManager.h | 1 - mgmt/LocalManager.cc| 1 - mgmt/ProcessManager.cc | 3 - mgmt/RecordsConfig.cc | 87 - mgmt/api/APITestCliRemote.cc| 63 ++- mgmt/api/Makefile.am| 1 - plugins/experimental/epic/epic.cc | 16 plugins/experimental/memcache/tsmemcache.cc | 4 +- proxy/CacheControl.cc | 36 + proxy/CacheControl.h| 6 -- proxy/ICP.cc| 4 +- proxy/InkAPI.cc | 8 +- proxy/TestClusterHash.cc| 117 proxy/http/HttpCacheSM.cc | 5 +- proxy/http/HttpConfig.cc| 27 --- proxy/http/HttpConfig.h | 8 -- proxy/http/HttpSM.cc| 8 +- proxy/http/HttpTransact.cc | 34 ++-- proxy/http/HttpTransact.h | 3 +- proxy/http/HttpTransactCache.cc | 2 +- 34 files changed, 106 insertions(+), 545 deletions(-) diff --git a/cmd/traffic_cop/Makefile.am b/cmd/traffic_cop/Makefile.am index 4a56a31..e1f4c89 100644 --- a/cmd/traffic_cop/Makefile.am +++ b/cmd/traffic_cop/Makefile.am @@ -21,7 +21,6 @@ AM_CPPFLAGS += $(iocore_include_dirs) \ -I$(abs_top_srcdir)/lib \ -I$(abs_top_srcdir)/lib/records \ -I$(abs_top_srcdir)/mgmt \ - -I$(abs_top_srcdir)/mgmt/cluster \ -I$(abs_top_srcdir)/mgmt/api/include AM_LDFLAGS += \ diff --git a/cmd/traffic_ctl/server.cc b/cmd/traffic_ctl/server.cc index 33f82ce..356af7f 100644 --- a/cmd/traffic_ctl/server.cc +++ b/cmd/traffic_ctl/server.cc @@ -27,10 +27,11 @@ static int drain = 0; static int manager = 0; static int -restart(unsigned argc, const char **argv, unsigned flags) +restart(unsigned argc, const char **argv) { TSMgmtError error; - const char *usage = (flags & TS_RESTART_OPT_CLUSTER) ? "cluster restart [OPTIONS]" : "server restart [OPTIONS]"; + const char *usage = "server restart [OPTIONS]"; + unsigned flags= TS_RESTART_OPT_NONE; const ArgumentDescription opts[] = { {"drain", '-', "Wait for client connections to drain before restarting", "F", , nullptr, nullptr}, @@ -52,7 +53,7 @@ restart(unsigned argc, const char **argv, unsigned flags) } if (error != TS_ERR_OKAY) { -CtrlMgmtError(error, "%s restart failed", (flags & TS_RESTART_OPT_CLUSTER) ? "cluster" : "server"); +CtrlMgmtError(error, "server restart failed"); return CTRL_EX_ERROR; } @@ -60,15 +61,9 @@ restart(unsigned argc, const char **argv, unsigned flags) } static int -cluster_restart(unsigned argc, const char **argv) -{ - return restart(argc, argv, TS_RESTART_OPT_CLUSTER); -} - -static int server_restart(unsigned argc, const char **argv) { - return restart(argc, argv, TS_RESTART_OPT_NONE); + return restart(argc, argv); } static int @@ -168,17 +163,6 @@ server_start(unsigned argc, const char **argv) } int -subcommand_cluster(unsigned argc, const char **argv) -{ - const subcommand commands[] = { -{cluster_restart, "restart", "Restart the Traffic Server cluster"}, -{CtrlUnimplementedCommand, "status", "Show the cluster status"}, - }; - - return CtrlGenericSubcommand("cluster", commands, countof(commands), argc, argv); -} - -int subcommand_server(unsigned argc, const char **argv) { const subcommand commands[] = { diff --git a/cmd/traffic_ctl/traffic_ctl.cc b/cmd/traffic_ctl/traffic_ctl.cc index c67c0f8..8cdadab 100644 --- a/cmd/traffic_ctl/traffic_ctl.cc +++
[trafficserver] branch master updated: coverity 1268008: Uninitialized scalar field
This is an automated email from the ASF dual-hosted git repository. bcall pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/trafficserver.git The following commit(s) were added to refs/heads/master by this push: new 1965cfc coverity 1268008: Uninitialized scalar field 1965cfc is described below commit 1965cfc84a8afbb6f91acb9f9b71706a87fbd904 Author: Bryan CallAuthorDate: Mon May 8 15:50:59 2017 -0400 coverity 1268008: Uninitialized scalar field --- lib/wccp/WccpLocal.h | 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/lib/wccp/WccpLocal.h b/lib/wccp/WccpLocal.h index 9ac3a94..2f71779 100644 --- a/lib/wccp/WccpLocal.h +++ b/lib/wccp/WccpLocal.h @@ -1594,18 +1594,18 @@ protected: /// Fill the cached values. void cache() const; - int m_count; ///< # of elements. - /** Whether the style values are valid. - We load all the values on the first request because we have to walk - all the capabilities anyway, and cache them. - */ - mutable bool m_cached; + int m_count = 0; ///< # of elements. + /** Whether the style values are valid. + We load all the values on the first request because we have to walk + all the capabilities anyway, and cache them. + */ + mutable bool m_cached = false; /// Style used to forward packets to cache. - mutable ServiceGroup::PacketStyle m_packet_forward; + mutable ServiceGroup::PacketStyle m_packet_forward = ServiceGroup::PacketStyle::NO_PACKET_STYLE; /// Style used to return packets to the router. - mutable ServiceGroup::PacketStyle m_packet_return; + mutable ServiceGroup::PacketStyle m_packet_return = ServiceGroup::PacketStyle::NO_PACKET_STYLE; /// Style used to make cache assignments. - mutable ServiceGroup::CacheAssignmentStyle m_cache_assign; + mutable ServiceGroup::CacheAssignmentStyle m_cache_assign = ServiceGroup::CacheAssignmentStyle::NO_CACHE_ASSIGN_STYLE; }; /** Sect 5.6.10: Alternate Assignment Component @@ -3576,7 +3576,7 @@ inline RouterViewComp::RouterViewComp() : m_cache_count(0) memset(m_cache_ids, 0, sizeof(m_cache_ids)); } -inline CapComp::CapComp() : m_count(0), m_cached(false) +inline CapComp::CapComp() { } inline CapComp & -- To stop receiving notification emails like this one, please contact ['"commits@trafficserver.apache.org" '].