mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-23 18:16:01 +03:00
gpu: nvgpu: posix: Change BUG() to raise signal
BUG() was causing a hang which would cause issues in automated tests. Instead now BUG() will raise a signal and kill the thread that called BUG(). JIRA NVGPU-1254 Change-Id: I74a7c74ee3c392a330fdaf49f3e1447f53c2b688 Signed-off-by: Nicolas Benech <nbenech@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1920220 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: Alex Waterman <alexw@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
committed by
Abdul Salam
parent
739b5d1506
commit
9934cfdd72
@@ -21,17 +21,9 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <nvgpu/log.h>
|
#include <nvgpu/log.h>
|
||||||
|
|
||||||
#include <nvgpu/posix/bug.h>
|
#include <nvgpu/posix/bug.h>
|
||||||
|
#include <signal.h>
|
||||||
__attribute__ ((noreturn))
|
#include <pthread.h>
|
||||||
static void __hang(void)
|
|
||||||
{
|
|
||||||
nvgpu_err(NULL, "Hanging!");
|
|
||||||
|
|
||||||
while (1)
|
|
||||||
;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void __dump_stack(unsigned int skip_frames)
|
static void __dump_stack(unsigned int skip_frames)
|
||||||
{
|
{
|
||||||
@@ -50,7 +42,9 @@ void __bug(const char *fmt, ...)
|
|||||||
{
|
{
|
||||||
nvgpu_err(NULL, "BUG detected!");
|
nvgpu_err(NULL, "BUG detected!");
|
||||||
|
|
||||||
__hang();
|
/* Raise a bad system call signal and kill the thread */
|
||||||
|
(void) raise(SIGSEGV);
|
||||||
|
pthread_exit(NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool __warn(bool cond, const char *fmt, ...)
|
bool __warn(bool cond, const char *fmt, ...)
|
||||||
|
|||||||
Reference in New Issue
Block a user