diff --git a/cpukit/include/rtems/confdefs/extensions.h b/cpukit/include/rtems/confdefs/extensions.h index c8911c9992..39e1dd5084 100644 --- a/cpukit/include/rtems/confdefs/extensions.h +++ b/cpukit/include/rtems/confdefs/extensions.h @@ -96,7 +96,7 @@ #else const Stack_checker_Reporter_handler Stack_checker_Reporter = - rtems_stack_checker_reporter_print_details; + rtems_stack_checker_reporter_quiet; #endif #endif diff --git a/spec/build/testsuites/libtests/grp.yml b/spec/build/testsuites/libtests/grp.yml index c897a5a28c..4fb581b19c 100644 --- a/spec/build/testsuites/libtests/grp.yml +++ b/spec/build/testsuites/libtests/grp.yml @@ -266,6 +266,8 @@ links: uid: stackchk02 - role: build-dependency uid: stackchk03 +- role: build-dependency + uid: stackchk04 - role: build-dependency uid: stat - role: build-dependency diff --git a/spec/build/testsuites/libtests/stackchk04.yml b/spec/build/testsuites/libtests/stackchk04.yml new file mode 100644 index 0000000000..b0f4a72a73 --- /dev/null +++ b/spec/build/testsuites/libtests/stackchk04.yml @@ -0,0 +1,22 @@ +SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause +build-type: test-program +cflags: [] +copyrights: +- Copyright (C) 2024 Mohamed Hassan +cppflags: [] +cxxflags: [] +enabled-by: true +features: c cprogram +includes: [] +ldflags: [] +links: [] +source: +- testsuites/libtests/stackchk/blow.c +- testsuites/libtests/stackchk/init.c +- testsuites/libtests/stackchk/task1.c +- testsuites/libtests/stackchk04/config.c +stlib: [] +target: testsuites/libtests/stackchk04.exe +type: build +use-after: [] +use-before: [] diff --git a/testsuites/libtests/stackchk/stackchk.scn b/testsuites/libtests/stackchk/stackchk.scn index 79b9087d92..313e73ae31 100644 --- a/testsuites/libtests/stackchk/stackchk.scn +++ b/testsuites/libtests/stackchk/stackchk.scn @@ -3,21 +3,14 @@ TA1 - rtems_clock_get_tod - 09:00:00 12/31/1988 TA2 - rtems_clock_get_tod - 09:00:00 12/31/1988 TA3 - rtems_clock_get_tod - 09:00:00 12/31/1988 TA1 - rtems_clock_get_tod - 09:00:05 12/31/1988 -TA1 - rtems_clock_get_tod - 09:00:10 12/31/1988 TA2 - rtems_clock_get_tod - 09:00:10 12/31/1988 -Stack usage by thread - ID NAME LOW HIGH CURRENT AVAILABLE USED -0x09010001 IDLE 0002022AE0 - 0002023AEF 00020238B0 4096 592 -0x0A010002 TA1 0002025630 - 000202863F 0002028420 12288 2752 -0x0A010003 TA2 0002028BD8 - 000202BBE7 000202B9C0 12288 2856 -0x0A010004 TA3 000202C180 - 000202F18F 000202EF70 12288 2752 -0xFFFFFFFF INTR 0002020200 - 00020211FF 0000000000 4080 792 -TA1 - rtems_clock_get_tod - 09:00:15 12/31/1988 -BLOWN STACK!!! -task control block: 0x???????? -task ID: 0x0A010002 -task name: 0x???????? -task name string: TA1 -task stack area (????? Bytes): 0x???????? .. 0x???????? -damaged pattern area (16 Bytes): 0x???????? .. 0x???????? +TA1 - rtems_clock_get_tod - 09:00:10 12/31/1988 +TA3 - rtems_clock_get_tod - 09:00:15 12/31/1988 + STACK USAGE BY THREAD +ID NAME LOW HIGH CURRENT AVAIL USED +0x09010001 IDLE 0x02015198 0x02016187 0x02015ee8 4080 564 +0x0a010002 TA1 0x020171f8 0x0201a1e7 0x02019f60 12272 1300 +0x0a010003 TA2 0x0201a228 0x0201d217 0x0201cf90 12272 716 +0x0a010004 TA3 0x0201d258 0x02020247 0x0201ffc0 12272 716 +0x00000000 Interrupt Stack 0x02012b10 0x02013aff 0x00000000 4080 548 *** END OF TEST STACK CHECKER *** diff --git a/testsuites/libtests/stackchk03/stackchk03.scn b/testsuites/libtests/stackchk03/stackchk03.scn index 2df5c9d628..b58985f99b 100644 --- a/testsuites/libtests/stackchk03/stackchk03.scn +++ b/testsuites/libtests/stackchk03/stackchk03.scn @@ -1,3 +1,18 @@ *** TEST STACKCHK03 *** -custom stack check report! -*** END OF TEST STACKCHK03 *** \ No newline at end of file +TA1 - rtems_clock_get_tod - 09:00:00 12/31/1988 +TA2 - rtems_clock_get_tod - 09:00:00 12/31/1988 +TA3 - rtems_clock_get_tod - 09:00:00 12/31/1988 +TA1 - rtems_clock_get_tod - 09:00:05 12/31/1988 +TA2 - rtems_clock_get_tod - 09:00:10 12/31/1988 +TA1 - rtems_clock_get_tod - 09:00:10 12/31/1988 +TA3 - rtems_clock_get_tod - 09:00:15 12/31/1988 + STACK USAGE BY THREAD +ID NAME LOW HIGH CURRENT AVAIL USED +0x09010001 IDLE 0x020151d8 0x020161c7 0x02015f28 4080 564 +0x0a010002 TA1 0x02017238 0x0201a227 0x02019fa0 12272 1300 +0x0a010003 TA2 0x0201a268 0x0201d257 0x0201cfd0 12272 716 +0x0a010004 TA3 0x0201d298 0x02020287 0x02020000 12272 716 +0x00000000 Interrupt Stack 0x02012b50 0x02013b3f 0x00000000 4080 548 +TA1 - rtems_clock_get_tod - 09:00:15 12/31/1988 +RTEMS STACKCHK03 CUSTOM REPORTER !!! +*** END OF TEST STACKCHK03 *** diff --git a/testsuites/libtests/stackchk04/config.c b/testsuites/libtests/stackchk04/config.c new file mode 100644 index 0000000000..1f02ca0cc0 --- /dev/null +++ b/testsuites/libtests/stackchk04/config.c @@ -0,0 +1,49 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + +/** + * @brief Stack Checker Reporter Configuration File + * + * This file contains the stack checker reporter function. + */ + +/* + * COPYRIGHT (c) 2024 On-Line Applications Research Corporation (OAR). + * COPYRIGHT (c) 2024 Mohamed Hassan + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include + +const char rtems_test_name[] = "STACKCHK04"; + +/* configuration information */ +#define CONFIGURE_STACK_CHECKER_ENABLED + +#define CONFIGURE_STACK_CHECKER_REPORTER rtems_stack_checker_reporter_print_details + +#define CONFIGURE_INIT +#include "../stackchk/system.h" diff --git a/testsuites/libtests/stackchk04/stackchk04.doc b/testsuites/libtests/stackchk04/stackchk04.doc new file mode 100644 index 0000000000..b2acad278d --- /dev/null +++ b/testsuites/libtests/stackchk04/stackchk04.doc @@ -0,0 +1,37 @@ +# SPDX-License-Identifier: BSD-2-Clause + +# COPYRIGHT (c) 2024 On-Line Applications Research Corporation (OAR). +# COPYRIGHT (c) 2024 Mohamed Hassan + +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. +# + +This file describes the directives and concepts tested by this test set. + +test set name: stackchk04 + +directives: + + rtems_stack_checker_switch_extension + +concepts: + + This task verifies that the stack checker will call the detailed + reporter function. diff --git a/testsuites/libtests/stackchk04/stackchk04.scn b/testsuites/libtests/stackchk04/stackchk04.scn new file mode 100644 index 0000000000..4b535fcebf --- /dev/null +++ b/testsuites/libtests/stackchk04/stackchk04.scn @@ -0,0 +1,24 @@ +*** TEST STACKCHK04 *** +TA1 - rtems_clock_get_tod - 09:00:00 12/31/1988 +TA2 - rtems_clock_get_tod - 09:00:00 12/31/1988 +TA3 - rtems_clock_get_tod - 09:00:00 12/31/1988 +TA1 - rtems_clock_get_tod - 09:00:05 12/31/1988 +TA2 - rtems_clock_get_tod - 09:00:10 12/31/1988 +TA1 - rtems_clock_get_tod - 09:00:10 12/31/1988 +TA3 - rtems_clock_get_tod - 09:00:15 12/31/1988 + STACK USAGE BY THREAD +ID NAME LOW HIGH CURRENT AVAIL USED +0x09010001 IDLE 0x02015318 0x02016307 0x02016068 4080 564 +0x0a010002 TA1 0x02017378 0x0201a367 0x0201a0e0 12272 1300 +0x0a010003 TA2 0x0201a3a8 0x0201d397 0x0201d110 12272 716 +0x0a010004 TA3 0x0201d3d8 0x020203c7 0x02020140 12272 716 +0x00000000 Interrupt Stack 0x02012c90 0x02013c7f 0x00000000 4080 548 +TA1 - rtems_clock_get_tod - 09:00:15 12/31/1988 +BLOWN STACK!!! +task control block: 0x020123e0 +task ID: 0x0a010002 +task name: 0x54413120 +task name string: TA1 +task stack area (12288 Bytes): 0x02017368 .. 0x0201a368 +damaged pattern area (16 Bytes): 0x02017368 .. 0x02017378 +*** END OF TEST STACKCHK04 ***