Skip to content

TS-4050 - Trafficserver is crashing when buckets=0 is configured in cache_promote plugin#361

Closed
meeramn wants to merge 3 commits intoapache:masterfrom
meeramn:TS-4050
Closed

TS-4050 - Trafficserver is crashing when buckets=0 is configured in cache_promote plugin#361
meeramn wants to merge 3 commits intoapache:masterfrom
meeramn:TS-4050

Conversation

@meeramn
Copy link
Copy Markdown
Contributor

@meeramn meeramn commented Dec 3, 2015

Fix trafficserver crash when buckets=0 is configured in cache_promote plugin and Set buckets default value to be 10

cache_promote plugin and Set buckets default value to be 10
@zwoop
Copy link
Copy Markdown
Contributor

zwoop commented Dec 3, 2015

Much better!

I'll have to check / read the code more thoroughly, but are you sure this isn't now leaking the object when the freelist is empty?

     _freelist.splice(_freelist.begin(), _list, map_it->second);
+        // Check if list is not empty
+        if (!_list.empty()) {
+          _freelist.splice(_freelist.begin(), _list, map_it->second);
+        }

@zwoop
Copy link
Copy Markdown
Contributor

zwoop commented Dec 4, 2015

Yeah, so there's no leak here (sorry, my bad), but I feel these checks are unnecessary. I'd rather change this to have a release assert above this, e.g.

--- a/plugins/experimental/cache_promote/cache_promote.cc
+++ b/plugins/experimental/cache_promote/cache_promote.cc
@@ -249,6 +249,7 @@ public:
     map_it = _map.find(&hash);
     if (_map.end() != map_it) {
       // We have an entry in the LRU
+      TSReleaseAssert(_list.size() > 0); // mismatch in the LRUs hash and list
       if (++(map_it->second->second) >= _hits) {
         // Promoted! Cleanup the LRU, and signal success. Save the promoted entry on the freelist.
        TSDebug(PLUGIN_NAME, "saving the LRUEntry to the freelist");

@meeramn
Copy link
Copy Markdown
Contributor Author

meeramn commented Dec 4, 2015

Thanks Leif for reviewing. Please take a look at changes and approve.

@asfgit asfgit closed this in e37d0b0 Dec 5, 2015
SolidWallOfCode pushed a commit to SolidWallOfCode/trafficserver that referenced this pull request Feb 13, 2017
YTSATS-1116: tls_proto problems when ATS compiled with openssl 1.0.2
moonchen pushed a commit to moonchen/trafficserver that referenced this pull request Jul 26, 2022
* Check for leaf node after resetting byte counter

* Improve invalid decoding length

* Move error tests to test_Huffmancode

* Reject EOS symbol

(cherry picked from commit d362729)

Co-authored-by: Menno de Gier <mrdegier@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants