1
0
mirror of https://github.com/deadw00d/AROS.git synced 2025-11-19 08:11:43 +00:00

add a few variations of execs crash test

This commit is contained in:
Kalamatee
2025-10-29 19:04:17 +00:00
committed by deadwood
parent ba7a1a6c50
commit 80936f2803
7 changed files with 130 additions and 2 deletions

View File

@ -0,0 +1,27 @@
/*
Copyright (C) 2025, The AROS Development Team. All rights reserved.
*/
#include <exec/types.h>
#include <proto/dos.h>
void crashfunc()
{
#if __WORDSIZE==64
volatile LONG *ptr = (LONG *)0xFFFF000000000000ULL;
#else
volatile LONG *ptr = (LONG *)0xFFFF0000UL;
#endif
PutStr("Before crash\n");
*ptr = 20;
PutStr("After crash\n");
}
int main(int argc, char **argv)
{
PutStr("main() enter\n");
crashfunc();
PutStr("main() exit\n");
return 0;
}

View File

@ -0,0 +1,22 @@
/*
Copyright (C) 2025, The AROS Development Team. All rights reserved.
*/
#include <exec/types.h>
#include <proto/dos.h>
void crashfunc()
{
void (*bad)() = (void(*)())"abcd";
PutStr("Before crash\n");
bad();
PutStr("After crash\n");
}
int main(int argc, char **argv)
{
PutStr("main() enter\n");
crashfunc();
PutStr("main() exit\n");
return 0;
}

View File

@ -1,5 +1,5 @@
/*
Copyright (C) 2013, The AROS Development Team. All rights reserved.
Copyright (C) 2013-2025, The AROS Development Team. All rights reserved.
*/
#include <exec/types.h>

View File

@ -0,0 +1,24 @@
/*
Copyright (C) 2025, The AROS Development Team. All rights reserved.
*/
#include <exec/types.h>
#include <proto/dos.h>
/* on strict-alignment architectures this should crash */
void crashfunc()
{
char buf[5];
LONG *unaligned = (LONG *)(buf + 1);
PutStr("Before crash\n");
*unaligned = 0x12345678;
PutStr("After crash\n");
}
int main(int argc, char **argv)
{
PutStr("main() enter\n");
crashfunc();
PutStr("main() exit\n");
return 0;
}

View File

@ -0,0 +1,24 @@
/*
Copyright (C) 2025, The AROS Development Team. All rights reserved.
*/
#include <exec/types.h>
#include <proto/dos.h>
void crashfunc()
{
volatile int x = 1;
volatile int y = 0;
PutStr("Before crash\n");
volatile int z = x / y;
PutStr("After crash\n");
(void)z;
}
int main(int argc, char **argv)
{
PutStr("main() enter\n");
crashfunc();
PutStr("main() exit\n");
return 0;
}

View File

@ -0,0 +1,24 @@
/*
Copyright (C) 2025, The AROS Development Team. All rights reserved.
*/
#include <exec/types.h>
#include <proto/dos.h>
void crashfunc()
{
volatile double x = 1.0;
volatile double y = 0.0;
PutStr("Before crash\n");
volatile double z = x / y;
PutStr("After crash\n");
(void)z;
}
int main(int argc, char **argv)
{
PutStr("main() enter\n");
crashfunc();
PutStr("main() exit\n");
return 0;
}

View File

@ -16,7 +16,6 @@ EXECPUBLICFILES := \
childstatus \
childwait \
copymem \
crashtest \
dumpmem \
enqueue \
exceptiontest \
@ -37,6 +36,14 @@ EXECPUBLICFILES := \
traptest \
vblank
EXECPUBLICFILES += \
crashtest_highpagefault \
crashtest_illegalins \
crashtest_pagefault \
crashtest_unaligned \
crashtest_zerodiv \
crashtest_zerodivfloat
CUNITEXECTESTFILES := \
cunit-exec-types