Skip to content
Snippets Groups Projects
Commit 8ec58d50 authored by Eric Cano's avatar Eric Cano
Browse files

Helgrind errors fixes (partial)

Increased queue depth in helgrind reports.
Added locking in a constructor to make helgrind happy.
Added suppression for helgrind finding races in synchronization functions (?)
parent 2f598023
Branches
Tags
No related merge requests found
......@@ -159,10 +159,10 @@ add_custom_target(fullunittests
tests/cta-unitTests
COMMAND tests/cta-unitTests-multiProcess
COMMAND valgrind --track-fds=yes --leak-check=full --demangle=yes --gen-suppressions=all --show-reachable=yes --error-exitcode=1 --suppressions=tests/valgrind.suppr tests/cta-unitTests
COMMAND valgrind --tool=helgrind -v --demangle=yes --gen-suppressions=all --conflict-cache-size=30000000 --error-exitcode=1 --suppressions=tests/helgrind.suppr tests/cta-unitTests
COMMAND valgrind --tool=helgrind -v --demangle=yes --gen-suppressions=all --num-callers=25 --conflict-cache-size=30000000 --error-exitcode=1 --suppressions=tests/helgrind.suppr tests/cta-unitTests
COMMAND tests/cta-unitTests-multiProcess
COMMAND valgrind --track-fds=yes --child-silent-after-fork=yes --leak-check=full --demangle=yes --gen-suppressions=all --show-reachable=yes --error-exitcode=1 --suppressions=tests/valgrind.suppr tests/cta-unitTests-multiProcess
COMMAND valgrind --tool=helgrind -v --demangle=yes --gen-suppressions=all --conflict-cache-size=30000000 --error-exitcode=1 --suppressions=tests/helgrind.suppr tests/cta-unitTests-multiProcess
COMMAND valgrind --tool=helgrind -v --demangle=yes --gen-suppressions=all --num-callers=25 --conflict-cache-size=30000000 --error-exitcode=1 --suppressions=tests/helgrind.suppr tests/cta-unitTests-multiProcess
DEPENDS tests/cta-unitTests tests/cta-unitTests-multiProcess tests/valgrind.suppr tests/helgrind.suppr
COMMENT "Running unit tests with memory leak and race conditions detection" VERBATIM)
......@@ -175,8 +175,8 @@ add_custom_target(valgrind
COMMENT "Running unit tests with memory leak detection" VERBATIM)
add_custom_target(helgrind
valgrind --tool=helgrind -v --demangle=yes --gen-suppressions=all --conflict-cache-size=30000000 --error-exitcode=1 --suppressions=tests/helgrind.suppr tests/cta-unitTests
COMMAND valgrind --tool=helgrind -v --child-silent-after-fork=yes --demangle=yes --gen-suppressions=all --conflict-cache-size=30000000 --error-exitcode=1 --suppressions=tests/helgrind.suppr tests/cta-unitTests-multiProcess
valgrind --tool=helgrind -v --demangle=yes --gen-suppressions=all --num-callers=25 --conflict-cache-size=30000000 --error-exitcode=1 --suppressions=tests/helgrind.suppr tests/cta-unitTests
COMMAND valgrind --tool=helgrind -v --child-silent-after-fork=yes --demangle=yes --gen-suppressions=all --num-callers=25 --conflict-cache-size=30000000 --error-exitcode=1 --suppressions=tests/helgrind.suppr tests/cta-unitTests-multiProcess
DEPENDS tests/cta-unitTests tests/cta-unitTests-multiProcess tests/helgrind.suppr
COMMENT "Running unit tests with race conditions detection" VERBATIM)
......
......@@ -48,7 +48,9 @@ AgentReference::AgentReference(const std::string & clientType) {
<< std::setw(2) << localNow.tm_min << ":"
<< std::setw(2) << localNow.tm_sec;
m_agentAddress = aid.str();
// Initialize the serialization token for queued actions
// Initialize the serialization token for queued actions (lock will make helgrind
// happy, but not really needed
std::unique_lock<std::mutex> ulg(m_currentQueueMutex);
m_nextQueueExecutionPromise.reset(new std::promise<void>);
m_nextQueueExecutionPromise->set_value();
}
......@@ -70,7 +72,7 @@ void AgentReference::setQueueFlushTimeout(std::chrono::duration<uint64_t, std::m
void AgentReference::addToOwnership(const std::string& objectAddress, objectstore::Backend& backend) {
Action a{AgentOperation::Add, objectAddress, std::promise<void>()};
queueAndExecuteAction(a, backend);
}
}
void AgentReference::removeFromOwnership(const std::string& objectAddress, objectstore::Backend& backend) {
Action a{AgentOperation::Remove, objectAddress, std::promise<void>()};
......
......@@ -287,7 +287,25 @@
...
}
{
heap_address_collision
Helgrind:Race
...
fun:_ZNSt7promiseIvED1Ev
fun:_ZN3cta11objectstore14AgentReference6ActionD1Ev
fun:_ZN3cta11objectstore14AgentReference19removeFromOwnershipERKSsRNS0_7BackendE
...
}
{
dubious_cond_var_in_promise
Helgrind:Misc
fun:pthread_cond_broadcast_WRK
fun:pthread_cond_broadcast@*
fun:_ZNSt18condition_variable10notify_allEv
fun:_ZNSt13__future_base11_State_base13_M_set_resultESt8functionIFSt10unique_ptrINS_12_Result_baseENS3_8_DeleterEEvEEb
...
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment