You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@trafficserver.apache.org by "ywkaras (via GitHub)" <gi...@apache.org> on 2023/09/14 22:16:27 UTC

[GitHub] [trafficserver] ywkaras opened a new pull request, #10442: Fix Coverity issue in inliner plugin.

ywkaras opened a new pull request, #10442:
URL: https://github.com/apache/trafficserver/pull/10442

   CID 1508893


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@trafficserver.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [trafficserver] ywkaras commented on a diff in pull request #10442: Fix Coverity issue in inliner plugin.

Posted by "ywkaras (via GitHub)" <gi...@apache.org>.
ywkaras commented on code in PR #10442:
URL: https://github.com/apache/trafficserver/pull/10442#discussion_r1327534043


##########
plugins/experimental/inliner/cache-handler.h:
##########
@@ -326,11 +326,12 @@ namespace inliner
       request             += std::string(b1, i);
       request             += "\r\n\r\n";
 
-      ats::io::IO *const io = new io::IO();
+      std::unique_ptr<ats::io::IO> io{new io::IO()};
 
       TSDebug(PLUGIN_TAG, "request:\n%s", request.c_str());

Review Comment:
   It's not clear what exactly Coverity's gripe is.  My best guess is that it's seeing that `*io` would get leaked if TSDebug() threw an exception.  But there must be a bazillion cases of that in our code, why would it single this one out?  Are there instructions anywhere about how to run Coverity, to be sure we've appeased it?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@trafficserver.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [trafficserver] zwoop commented on pull request #10442: Fix Coverity issue in inliner plugin.

Posted by "zwoop (via GitHub)" <gi...@apache.org>.
zwoop commented on PR #10442:
URL: https://github.com/apache/trafficserver/pull/10442#issuecomment-1721527812

   I think this looks good, but I'd like @cmcfarlen  to review.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@trafficserver.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [trafficserver] cmcfarlen commented on a diff in pull request #10442: Fix Coverity issue in inliner plugin.

Posted by "cmcfarlen (via GitHub)" <gi...@apache.org>.
cmcfarlen commented on code in PR #10442:
URL: https://github.com/apache/trafficserver/pull/10442#discussion_r1329469169


##########
plugins/experimental/inliner/cache-handler.h:
##########
@@ -326,11 +326,12 @@ namespace inliner
       request             += std::string(b1, i);
       request             += "\r\n\r\n";
 
-      ats::io::IO *const io = new io::IO();
+      std::unique_ptr<ats::io::IO> io{new io::IO()};
 
       TSDebug(PLUGIN_TAG, "request:\n%s", request.c_str());
 
-      ats::get(io, io->copy(request), AnotherClass(src_));
+      auto r{io->copy(request)};

Review Comment:
   I had to check what `copy` returned.  A better name for `r` might be `size` or `sz`.



##########
plugins/experimental/inliner/cache-handler.h:
##########
@@ -326,11 +326,12 @@ namespace inliner
       request             += std::string(b1, i);
       request             += "\r\n\r\n";
 
-      ats::io::IO *const io = new io::IO();
+      std::unique_ptr<ats::io::IO> io{new io::IO()};

Review Comment:
   No strong opinions on this nitpick, but this could be `auto io = std::make_unique<io::IO>();`



##########
plugins/experimental/inliner/cache-handler.h:
##########
@@ -326,11 +326,12 @@ namespace inliner
       request             += std::string(b1, i);
       request             += "\r\n\r\n";
 
-      ats::io::IO *const io = new io::IO();
+      std::unique_ptr<ats::io::IO> io{new io::IO()};
 
       TSDebug(PLUGIN_TAG, "request:\n%s", request.c_str());

Review Comment:
   It looks like from reading the defect report, coverity doesn't trace into the second get call to see that it is indeed assigned eventually.  The std::move will hopefully realize that ownership is handed off.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@trafficserver.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [trafficserver] ywkaras commented on pull request #10442: Fix Coverity issue in inliner plugin.

Posted by "ywkaras (via GitHub)" <gi...@apache.org>.
ywkaras commented on PR #10442:
URL: https://github.com/apache/trafficserver/pull/10442#issuecomment-1726474526

   [autest ci autest]


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@trafficserver.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [trafficserver] ywkaras merged pull request #10442: Fix Coverity issue in inliner plugin.

Posted by "ywkaras (via GitHub)" <gi...@apache.org>.
ywkaras merged PR #10442:
URL: https://github.com/apache/trafficserver/pull/10442


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@trafficserver.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [trafficserver] cmcfarlen commented on a diff in pull request #10442: Fix Coverity issue in inliner plugin.

Posted by "cmcfarlen (via GitHub)" <gi...@apache.org>.
cmcfarlen commented on code in PR #10442:
URL: https://github.com/apache/trafficserver/pull/10442#discussion_r1329472282


##########
plugins/experimental/inliner/cache-handler.h:
##########
@@ -326,11 +326,12 @@ namespace inliner
       request             += std::string(b1, i);
       request             += "\r\n\r\n";
 
-      ats::io::IO *const io = new io::IO();
+      std::unique_ptr<ats::io::IO> io{new io::IO()};
 
       TSDebug(PLUGIN_TAG, "request:\n%s", request.c_str());

Review Comment:
   It looks like from reading the defect report, coverity doesn't trace into the second get call to see that it is indeed assigned eventually.  The std::move will hopefully help it realize that ownership is handed off.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@trafficserver.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [trafficserver] zwoop commented on a diff in pull request #10442: Fix Coverity issue in inliner plugin.

Posted by "zwoop (via GitHub)" <gi...@apache.org>.
zwoop commented on code in PR #10442:
URL: https://github.com/apache/trafficserver/pull/10442#discussion_r1328144254


##########
plugins/experimental/inliner/cache-handler.h:
##########
@@ -326,11 +326,12 @@ namespace inliner
       request             += std::string(b1, i);
       request             += "\r\n\r\n";
 
-      ats::io::IO *const io = new io::IO();
+      std::unique_ptr<ats::io::IO> io{new io::IO()};
 
       TSDebug(PLUGIN_TAG, "request:\n%s", request.c_str());

Review Comment:
   No unfortunately we don’t have enough karma to run PRs against coverity. So it’ll have to land on master for the next schedule run, rinse repeats…



##########
plugins/experimental/inliner/cache-handler.h:
##########
@@ -326,11 +326,12 @@ namespace inliner
       request             += std::string(b1, i);
       request             += "\r\n\r\n";
 
-      ats::io::IO *const io = new io::IO();
+      std::unique_ptr<ats::io::IO> io{new io::IO()};
 
       TSDebug(PLUGIN_TAG, "request:\n%s", request.c_str());

Review Comment:
   No unfortunately we don’t have enough karma to run PRs against coverity. So it’ll have to land on master for the next schedule run, rinse repeats…



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@trafficserver.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [trafficserver] ywkaras commented on pull request #10442: Fix Coverity issue in inliner plugin.

Posted by "ywkaras (via GitHub)" <gi...@apache.org>.
ywkaras commented on PR #10442:
URL: https://github.com/apache/trafficserver/pull/10442#issuecomment-1726475242

   [approve ci autest]


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@trafficserver.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org