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

   ### The reports
   
   Coverity flags "Uncaught exception" against every `main()` in the tree, 23
   instances across these nine binaries. An exception that escapes `main` 
reaches
   `std::terminate`, so the analyzer is right that nothing handles it.
   
   ### The change
   
   Each body is wrapped in a function-try-block. That keeps the diff to the 
braces
   and leaves the body at its original indentation, which makes this reviewable 
as
   nine near-identical ten-line hunks rather than nine whole-file reindents.
   `TSError()` in `src/api/InkAPI.cc` is already written this way.
   
   [PR #13688](https://github.com/apache/trafficserver/pull/13688) handled the 
same
   checker in test code by extracting the body into a helper and wrapping the 
new
   `main`. That works too; the function-try-block just costs less diff here.
   
   ### traffic_server keeps the abort, on purpose
   
   The eight command line tools print the failure and return 1, which is more 
use
   to somebody running them than a core file.
   
   `traffic_server` is different. It is a long running daemon, and today an
   escaping exception reaches `std::terminate`, which aborts and leaves a core.
   Returning 1 there would report the failure and throw the evidence away, so 
that
   one calls `ink_abort()`: same message, core still dumped.
   
   ### Testing
   
   Built clean on Fedora, all 1766 targets. Smoke tested that normal operation 
is
   unaffected: `traffic_layout`, `traffic_logcat` and `traffic_ctl` all return 0
   and print their version banner.
   
   `<cstdio>` and `<exception>` are now included explicitly in all nine. They 
were
   arriving transitively, which works until someone reorders a header.


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to