From 41029edcac9b2509414c8d2e5d51e23fe6590c8a Mon Sep 17 00:00:00 2001 From: Vedansh Bhartia Date: Mon, 9 Oct 2023 21:21:23 +0530 Subject: rgw: Add coverity annotations for uncaught exceptions in standalone binaries Signed-off-by: Vedansh Bhartia --- src/rgw/driver/dbstore/dbstore_main.cc | 3 +++ src/rgw/rgw_admin.cc | 3 +++ src/rgw/rgw_es_main.cc | 3 +++ src/rgw/rgw_jsonparser.cc | 4 +++- src/rgw/rgw_main.cc | 4 ++++ src/rgw/rgw_multiparser.cc | 4 ++++ src/rgw/rgw_object_expirer.cc | 3 +++ src/rgw/rgw_polparser.cc | 3 +++ src/rgw/rgw_token.cc | 3 +++ 9 files changed, 29 insertions(+), 1 deletion(-) diff --git a/src/rgw/driver/dbstore/dbstore_main.cc b/src/rgw/driver/dbstore/dbstore_main.cc index 4fff38ced27..46d4106ca43 100644 --- a/src/rgw/driver/dbstore/dbstore_main.cc +++ b/src/rgw/driver/dbstore/dbstore_main.cc @@ -119,6 +119,9 @@ void* process(void *arg) return 0; } +// This has an uncaught exception. Even if the exception is caught, the program +// would need to be terminated, so the warning is simply suppressed. +// coverity[root_function:SUPPRESS] int main(int argc, char *argv[]) { string tenant = "Redhat"; diff --git a/src/rgw/rgw_admin.cc b/src/rgw/rgw_admin.cc index a4e17b8895a..01a07f2c2de 100644 --- a/src/rgw/rgw_admin.cc +++ b/src/rgw/rgw_admin.cc @@ -3305,6 +3305,9 @@ void init_realm_param(CephContext *cct, string& var, std::optional& opt_ } } +// This has an uncaught exception. Even if the exception is caught, the program +// would need to be terminated, so the warning is simply suppressed. +// coverity[root_function:SUPPRESS] int main(int argc, const char **argv) { auto args = argv_to_vec(argc, argv); diff --git a/src/rgw/rgw_es_main.cc b/src/rgw/rgw_es_main.cc index 6cfbc935292..d84f9ecadd5 100644 --- a/src/rgw/rgw_es_main.cc +++ b/src/rgw/rgw_es_main.cc @@ -14,6 +14,9 @@ using namespace std; +// This has an uncaught exception. Even if the exception is caught, the program +// would need to be terminated, so the warning is simply suppressed. +// coverity[root_function:SUPPRESS] int main(int argc, char *argv[]) { auto args = argv_to_vec(argc, argv); diff --git a/src/rgw/rgw_jsonparser.cc b/src/rgw/rgw_jsonparser.cc index 6541630b286..a6c99c63989 100644 --- a/src/rgw/rgw_jsonparser.cc +++ b/src/rgw/rgw_jsonparser.cc @@ -56,7 +56,9 @@ struct UserInfo { } }; - +// This has an uncaught exception. Even if the exception is caught, the program +// would need to be terminated, so the warning is simply suppressed. +// coverity[root_function:SUPPRESS] int main(int argc, char **argv) { JSONParser parser; diff --git a/src/rgw/rgw_main.cc b/src/rgw/rgw_main.cc index 27b02f84195..4d31db8072f 100644 --- a/src/rgw/rgw_main.cc +++ b/src/rgw/rgw_main.cc @@ -57,7 +57,11 @@ static int usage() /* * start up the RADOS connection and then handle HTTP messages as they come in + * + * This has an uncaught exception. Even if the exception is caught, the program + * would need to be terminated, so the warning is simply suppressed. */ +// coverity[root_function:SUPPRESS] int main(int argc, char *argv[]) { int r{0}; diff --git a/src/rgw/rgw_multiparser.cc b/src/rgw/rgw_multiparser.cc index a8778abd9a0..c7a37213c4d 100644 --- a/src/rgw/rgw_multiparser.cc +++ b/src/rgw/rgw_multiparser.cc @@ -14,6 +14,10 @@ using namespace std; + +// This has an uncaught exception. Even if the exception is caught, the program +// would need to be terminated, so the warning is simply suppressed. +// coverity[root_function:SUPPRESS] int main(int argc, char **argv) { RGWMultiXMLParser parser; diff --git a/src/rgw/rgw_object_expirer.cc b/src/rgw/rgw_object_expirer.cc index 7a49fc8d161..0470b1a6e6f 100644 --- a/src/rgw/rgw_object_expirer.cc +++ b/src/rgw/rgw_object_expirer.cc @@ -51,6 +51,9 @@ static void usage() generic_server_usage(); } +// This has an uncaught exception. Even if the exception is caught, the program +// would need to be terminated, so the warning is simply suppressed. +// coverity[root_function:SUPPRESS] int main(const int argc, const char **argv) { auto args = argv_to_vec(argc, argv); diff --git a/src/rgw/rgw_polparser.cc b/src/rgw/rgw_polparser.cc index eca5066b3ce..3991181809e 100644 --- a/src/rgw/rgw_polparser.cc +++ b/src/rgw/rgw_polparser.cc @@ -50,6 +50,9 @@ void usage(std::string_view cmdname) << std::endl; } +// This has an uncaught exception. Even if the exception is caught, the program +// would need to be terminated, so the warning is simply suppressed. +// coverity[root_function:SUPPRESS] int main(int argc, const char** argv) { std::string_view cmdname = argv[0]; diff --git a/src/rgw/rgw_token.cc b/src/rgw/rgw_token.cc index 999d46e0e22..8ffac69c831 100644 --- a/src/rgw/rgw_token.cc +++ b/src/rgw/rgw_token.cc @@ -60,6 +60,9 @@ void usage() generic_client_usage(); } +// This has an uncaught exception. Even if the exception is caught, the program +// would need to be terminated, so the warning is simply suppressed. +// coverity[root_function:SUPPRESS] int main(int argc, char **argv) { auto args = argv_to_vec(argc, argv); -- cgit v1.2.3