rocrtst: Disable RLIMIT for negative queue tests
The negative queue tests generate an exception which triggers a coredump
generation. Disable RLIMIT so that the coredumps are not generated for
these tests.
[ROCm/ROCR-Runtime commit: 4cb6a6d45d]
This commit is contained in:
committed by
Yat Sin, David
parent
35faa9783a
commit
732c3cfa8f
@@ -123,6 +123,20 @@ void QueueValidation::SetUp(void) {
|
||||
|
||||
TestBase::SetUp();
|
||||
|
||||
/* The queue exceptions will trigger a coredump. Set the limit to 0 to disable */
|
||||
if (getrlimit(RLIMIT_CORE, &rlimit_)) {
|
||||
perror("Could not get system rlimit\n");
|
||||
} else {
|
||||
struct rlimit rlimit_set;
|
||||
|
||||
rlimit_set.rlim_cur = 0;
|
||||
rlimit_set.rlim_max = 0;
|
||||
|
||||
/* Do not error if system does not allow disabling limit */
|
||||
if (setrlimit(RLIMIT_CORE, &rlimit_set))
|
||||
perror("Could not set core file size\n");
|
||||
}
|
||||
|
||||
err = rocrtst::SetDefaultAgents(this);
|
||||
ASSERT_EQ(HSA_STATUS_SUCCESS, err);
|
||||
|
||||
@@ -159,6 +173,10 @@ void QueueValidation::DisplayResults(void) const {
|
||||
}
|
||||
|
||||
void QueueValidation::Close() {
|
||||
/* Restore rlimit to initial value before test - do not error if fails */
|
||||
if (setrlimit(RLIMIT_CORE, &rlimit_))
|
||||
perror("Could not set core file size\n");
|
||||
|
||||
// This will close handles opened within rocrtst utility calls and call
|
||||
// hsa_shut_down(), so it should be done after other hsa cleanup
|
||||
TestBase::Close();
|
||||
|
||||
@@ -48,6 +48,8 @@
|
||||
#include "common/base_rocr.h"
|
||||
#include "hsa/hsa.h"
|
||||
#include "suites/test_common/test_base.h"
|
||||
#include <sys/resource.h>
|
||||
|
||||
|
||||
class QueueValidation : public TestBase {
|
||||
public:
|
||||
@@ -93,6 +95,8 @@ class QueueValidation : public TestBase {
|
||||
|
||||
|
||||
private:
|
||||
struct rlimit rlimit_; //value of rlimit before test starts
|
||||
|
||||
void QueueValidationForInvalidDimension(hsa_agent_t cpuAgent, hsa_agent_t gpuAgent);
|
||||
void QueueValidationInvalidGroupMemory(hsa_agent_t cpuAgent, hsa_agent_t gpuAgent);
|
||||
void QueueValidationForInvalidKernelObject(hsa_agent_t cpuAgent, hsa_agent_t gpuAgent);
|
||||
|
||||
Reference in New Issue
Block a user