Skip to content

Commit 8a60755

Browse files
committed
BF: CS-937 do full valgrind test on V90_BRANCH (9.0.2)
// fixed memory leaks in sge_qmaster and japi
1 parent 27d9103 commit 8a60755

File tree

3 files changed

+21
-23
lines changed

3 files changed

+21
-23
lines changed

source/libs/japi/japi.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4469,6 +4469,8 @@ static void *japi_implementation_thread(void * a_user_data_pointer)
44694469
/* signal all application threads waiting for a job event */
44704470
pthread_cond_broadcast (&Master_japi_job_list_finished_cv);
44714471

4472+
pthread_exit(nullptr);
4473+
44724474
DRETURN(nullptr);
44734475

44744476
SetupFailed:

source/libs/sgeobj/ocs_Version.cc

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,11 @@
4141
#define OCS_VERSION_PATCH 3
4242
#define OCS_VERSION_SUFFIX ""
4343

44-
const std::string ocs::Version::OCS_VERSION_STRING = std::to_string(OCS_VERSION_MAJOR) + "."
45-
+ std::to_string(OCS_VERSION_MINOR) + "." + std::to_string(OCS_VERSION_PATCH) + OCS_VERSION_SUFFIX;
46-
const uint32_t ocs::Version::OCS_VERSION = 0x10009000;
44+
static const std::string OCS_VERSION_STRING{std::to_string(OCS_VERSION_MAJOR) + "."
45+
+ std::to_string(OCS_VERSION_MINOR) + "." + std::to_string(OCS_VERSION_PATCH) + OCS_VERSION_SUFFIX};
46+
static const uint32_t OCS_VERSION{0x10009000};
4747

48-
const std::vector<std::tuple<uint32_t, std::string>> ocs::Version::OCS_ALL_VERSIONS_VECTOR = {
48+
static const std::vector<std::tuple<uint32_t, std::string>> OCS_ALL_VERSIONS_VECTOR{
4949
{ 0x10000000, "5.0"},
5050
{ 0x10000001, "5.1"},
5151
{ 0x10000002, "5.2"},
@@ -73,15 +73,15 @@ const std::vector<std::tuple<uint32_t, std::string>> ocs::Version::OCS_ALL_VERSI
7373
{ 0x100020F8, "6.2u5"},
7474
{ 0x10003000, "8.0.x Univa"},
7575
{ 0x10003001, "8.0.x Some Gridengine"},
76-
{ OCS_VERSION, get_version_string().c_str()},
76+
{ OCS_VERSION, OCS_VERSION_STRING},
7777
};
7878

7979
#ifdef ADD_GRIDWARE_COPYRIGHT
80-
const std::string ocs::Version::OCS_LONG_PRODUCT_NAME = "Gridware Cluster Scheduler";
81-
const std::string ocs::Version::OCS_SHORT_PRODUCT_NAME = "GCS";
80+
static const std::string OCS_LONG_PRODUCT_NAME{"Gridware Cluster Scheduler"};
81+
static const std::string OCS_SHORT_PRODUCT_NAME{"GCS"};
8282
#else
83-
const std::string ocs::Version::OCS_LONG_PRODUCT_NAME = "Open Cluster Scheduler";
84-
const std::string ocs::Version::OCS_SHORT_PRODUCT_NAME = "OCS";
83+
static const std::string OCS_LONG_PRODUCT_NAME{"Open Cluster Scheduler"};
84+
static const std::string OCS_SHORT_PRODUCT_NAME{"OCS"};
8585
#endif
8686

8787
std::string
@@ -94,11 +94,13 @@ ocs::Version::get_version() {
9494
return OCS_VERSION;
9595
}
9696

97-
std::string ocs::Version::get_short_product_name(){
97+
std::string
98+
ocs::Version::get_short_product_name() {
9899
return OCS_SHORT_PRODUCT_NAME;
99100
}
100101

101-
std::string ocs::Version::get_long_product_name(){
102+
std::string
103+
ocs::Version::get_long_product_name() {
102104
return OCS_LONG_PRODUCT_NAME;
103105
}
104106

@@ -173,21 +175,21 @@ ocs::Version::do_versions_match(lList **alpp, const uint32_t version, const char
173175

174176

175177
#if !(ADD_COPYRIGHT || ADD_HPC_GRIDWARE_COPYRIGHT)
176-
extern const char SFLN_ELN[] = "\n\
178+
extern const char SFLN_ELN[]{"\n\
177179
Cluster Scheduler is based on code donated by Sun Microsystems.\n\
178180
The copyright is owned by Sun Microsystems and other contributors.\n\
179181
It has been made available to the open source community under the SISSL license.\n\
180-
For further information and the latest news visit: @fBhttp://gridengine.sunsource.net\n\n";
182+
For further information and the latest news visit: @fBhttp://gridengine.sunsource.net\n\n"};
181183

182-
extern const char DQS_ACK[] = "\n\
184+
extern const char DQS_ACK[]{"\n\
183185
We would like to acknowledge and thank the efforts of the\n\
184-
Florida State University in creating the DQS program.\n";
186+
Florida State University in creating the DQS program.\n"};
185187

186188
#endif
187189

188190
#ifndef ADD_HPC_GRIDWARE_COPYRIGHT
189191

190-
extern const char SISSL[] = "\n\
192+
extern const char SISSL[]{"\n\
191193
The Contents of this file are made available subject to the terms of\n\
192194
the Sun Industry Standards Source License Version 1.2\n\
193195
\n\
@@ -212,6 +214,6 @@ The Initial Developer of the Original Code is: Sun Microsystems, Inc.\n\
212214
\n\
213215
Copyright: 2001 by Sun Microsystems, Inc.\n\
214216
\n\
215-
All Rights Reserved.\n";
217+
All Rights Reserved.\n"};
216218

217219
#endif

source/libs/sgeobj/ocs_Version.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,6 @@
2828

2929
namespace ocs {
3030
class Version {
31-
static const uint32_t OCS_VERSION;
32-
static const std::string OCS_VERSION_STRING;
33-
static const std::string OCS_LONG_PRODUCT_NAME;
34-
static const std::string OCS_SHORT_PRODUCT_NAME;
35-
36-
static const std::vector<std::tuple<uint32_t, std::string>> OCS_ALL_VERSIONS_VECTOR;
3731
public:
3832
static uint32_t get_version();
3933
static std::string get_version_string();

0 commit comments

Comments
 (0)