diff options
author | Dan Crowell <dcrowell@us.ibm.com> | 2017-09-23 22:24:28 -0500 |
---|---|---|
committer | William G. Hoffa <wghoffa@us.ibm.com> | 2018-06-15 13:44:39 -0400 |
commit | 7cc8294252577238eb99bad42c3bc7dd92f4794d (patch) | |
tree | 09a73519b9565693ca699a73ec1a21fd17153350 /src/usr | |
parent | 5090c197292cdd0ec4ad8e416020e5229812cb65 (diff) | |
download | talos-hostboot-7cc8294252577238eb99bad42c3bc7dd92f4794d.tar.gz talos-hostboot-7cc8294252577238eb99bad42c3bc7dd92f4794d.zip |
Debug improvements for exceptions and OOM hangs
There are two main changes in this commit:
1) Forcing an assert if we cannot allocate pages after
10,000 attempts to yield.
2) Adding a backtrace for a lot of exception paths.
Change-Id: I755ada753b78abed56e553f7c669f0f98ae68700
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/58224
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com>
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Reviewed-by: Prachi Gupta <pragupta@us.ibm.com>
Reviewed-by: Thi N. Tran <thi@us.ibm.com>
Reviewed-by: William G. Hoffa <wghoffa@us.ibm.com>
Diffstat (limited to 'src/usr')
-rw-r--r-- | src/usr/testcore/kernel/taskwaittest.H | 6 | ||||
-rw-r--r-- | src/usr/testcore/kernel/vmmbasetest.H | 35 |
2 files changed, 35 insertions, 6 deletions
diff --git a/src/usr/testcore/kernel/taskwaittest.H b/src/usr/testcore/kernel/taskwaittest.H index 2d4a39772..a929dcd9a 100644 --- a/src/usr/testcore/kernel/taskwaittest.H +++ b/src/usr/testcore/kernel/taskwaittest.H @@ -5,7 +5,9 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* COPYRIGHT International Business Machines Corp. 2011,2014 */ +/* Contributors Listed Below - COPYRIGHT 2011,2018 */ +/* [+] International Business Machines Corp. */ +/* */ /* */ /* Licensed under the Apache License, Version 2.0 (the "License"); */ /* you may not use this file except in compliance with the License. */ @@ -168,7 +170,7 @@ class TaskWaitTest : public CxxTest::TestSuite static void* TaskThatCrashes(void* unused) { - printk("Test case: Expect to see uncaught exception! "); + printk("TaskThatCrashes: Expect to see uncaught exception! "); *(int64_t*)(0) = 0xDEADC0DE; return NULL; } diff --git a/src/usr/testcore/kernel/vmmbasetest.H b/src/usr/testcore/kernel/vmmbasetest.H index 5a3c0d0f8..c4d42116e 100644 --- a/src/usr/testcore/kernel/vmmbasetest.H +++ b/src/usr/testcore/kernel/vmmbasetest.H @@ -5,7 +5,9 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* COPYRIGHT International Business Machines Corp. 2011,2014 */ +/* Contributors Listed Below - COPYRIGHT 2011,2018 */ +/* [+] International Business Machines Corp. */ +/* */ /* */ /* Licensed under the Apache License, Version 2.0 (the "License"); */ /* you may not use this file except in compliance with the License. */ @@ -44,7 +46,7 @@ class VmmBaseTest : public CxxTest::TestSuite { int status; - printk("Test case: Expect to see uncaught exception! "); + printk("testNullAccess1: Expect to see uncaught exception! "); tid_t child = task_create(readFromNULL, NULL); if ((child != task_wait_tid(child, &status, NULL)) || @@ -53,7 +55,7 @@ class VmmBaseTest : public CxxTest::TestSuite TS_FAIL("Write to NULL not caught."); } - printk("Test case: Expect to see uncaught exception! "); + printk("testNullAccess2: Expect to see uncaught exception! "); child = task_create(writeToNULL, NULL); if ((child != task_wait_tid(child, &status, NULL)) || (status != TASK_STATUS_CRASHED)) @@ -66,7 +68,7 @@ class VmmBaseTest : public CxxTest::TestSuite { int status; - printk("Test case: Expect to see uncaught exception! "); + printk("testWriteToKernelCode: Expect to see uncaught exception! "); tid_t child = task_create(writeToKernelCode, NULL); if ((child != task_wait_tid(child, &status, NULL)) || (status != TASK_STATUS_CRASHED)) @@ -134,6 +136,21 @@ class VmmBaseTest : public CxxTest::TestSuite } } + void testHugeMalloc() + { + int status; + + printk("testHugeMalloc: Expect to see uncaught exception! ");isync(); + + tid_t child = task_create(bigMalloc, NULL); + + if ((child != task_wait_tid(child, &status, NULL)) || + (status != TASK_STATUS_CRASHED)) + { + TS_FAIL("testHugeMalloc> Giant malloc didn't crash."); + } + } + private: static void* readFromNULL(void* unused) @@ -180,6 +197,16 @@ class VmmBaseTest : public CxxTest::TestSuite return NULL; } + static void* bigMalloc(void* unused) + { + uint8_t* ptr = (uint8_t*)malloc(VMM_MEMORY_SIZE); + for( size_t x=0; x<(VMM_MEMORY_SIZE); x+=MEGABYTE ) + { + ptr[x] = x; + } + return NULL; + } + }; msg_q_t VmmBaseTest::iv_mq = msg_q_create(); |