ChibiOS OS Library Test Suite

Discussions and support about ChibiOS/RT, the free embedded RTOS.
vrollei
Posts: 126
Joined: Sun Nov 13, 2016 8:44 am
Been thanked: 9 times

ChibiOS OS Library Test Suite

Postby vrollei » Wed Nov 18, 2020 9:35 pm

Hi,

ChibiOS OS Library Test Suite Test Case 9.5 (Dynamic Objects FIFOs Factory) constantly fails after about 100 iterations.
Is it possible to use oslib_test_suite inside loop?

*** ChibiOS OS Library Test Suite
***
*** Compiled: Nov 17 2020 - 15:43:13
*** Platform: STM32L4xx Ultra Low Power
*** Test Board: XBOARD
***
*** Text size: 52184 bytes
*** RO data size: 13104 bytes
*** Data size: 332 bytes
*** BSS size: 8520 bytes

----------------------------------------------------------------------------
--- Test Case 9.5 (Dynamic Objects FIFOs Factory)
--- Result: FAILURE (#2 [] "cannot create")
----------------------------------------------------------------------------
Vitaly

User avatar
Giovanni
Site Admin
Posts: 13118
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 767 times
Been thanked: 651 times
Contact:

Re: ChibiOS OS Library Test Suite

Postby Giovanni » Wed Nov 18, 2020 9:54 pm

This could be caused by memory fragmentation, the factory uses memory allocation, check the heap state using the "mem" shell command.

Giovanni

vrollei
Posts: 126
Joined: Sun Nov 13, 2016 8:44 am
Been thanked: 9 times

Re: ChibiOS OS Library Test Suite

Postby vrollei » Wed Nov 18, 2020 10:13 pm

Will check it, is there any way to clean up memory after test cases execution?
Thanks!
Vitaly

User avatar
Giovanni
Site Admin
Posts: 13118
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 767 times
Been thanked: 651 times
Contact:

Re: ChibiOS OS Library Test Suite

Postby Giovanni » Wed Nov 18, 2020 10:33 pm

vrollei wrote:Will check it, is there any way to clean up memory after test cases execution?
Thanks!


Currently not, it would require resetting the heap state which could create unintended consequences. You may try calling again the memory allocators initializers which are not an official API.

Giovanni

User avatar
FXCoder
Posts: 284
Joined: Sun Jun 12, 2016 4:10 am
Location: Sydney, Australia
Has thanked: 117 times
Been thanked: 89 times

Re: ChibiOS OS Library Test Suite

Postby FXCoder » Wed Nov 18, 2020 11:25 pm

Hi,
I just did a quick check on a L432 NUCLEO and found main memory decreased after each 'test oslib'.
Could it be that a factory object is not being released (left dangling with heap allocated)?
--
Bob

User avatar
Giovanni
Site Admin
Posts: 13118
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 767 times
Been thanked: 651 times
Contact:

Re: ChibiOS OS Library Test Suite

Postby Giovanni » Thu Nov 19, 2020 7:37 am

FXCoder wrote:Hi,
I just did a quick check on a L432 NUCLEO and found main memory decreased after each 'test oslib'.
Could it be that a factory object is not being released (left dangling with heap allocated)?
--
Bob


It is possible, do you know in which test case this happens?

Giovanni

vrollei
Posts: 126
Joined: Sun Nov 13, 2016 8:44 am
Been thanked: 9 times

Re: ChibiOS OS Library Test Suite

Postby vrollei » Thu Nov 19, 2020 6:42 pm

Hi,

Memory usage trace:

============================================================================
=== Test Sequence 9 (Objects Factory)
----------------------------------------------------------------------------
--- Test Case 9.1 (Objects Registry)
--- Result: SUCCESS
00:03:02.494 DEBUG main.c::print_mem:51 - core free memory : 50696 bytes
00:03:02.522 DEBUG main.c::print_mem:52 - heap fragments : 1
00:03:02.548 DEBUG main.c::print_mem:53 - heap free total : 552 bytes
00:03:02.576 DEBUG main.c::print_mem:54 - heap free largest: 552 bytes
----------------------------------------------------------------------------
--- Test Case 9.2 (Dynamic Buffers Factory)
--- Result: SUCCESS
00:03:02.836 DEBUG main.c::print_mem:51 - core free memory : 50696 bytes
00:03:02.864 DEBUG main.c::print_mem:52 - heap fragments : 1
00:03:02.890 DEBUG main.c::print_mem:53 - heap free total : 136 bytes
00:03:02.917 DEBUG main.c::print_mem:54 - heap free largest: 136 bytes
----------------------------------------------------------------------------
--- Test Case 9.3 (Dynamic Semaphores Factory)
--- Result: SUCCESS
00:03:03.179 DEBUG main.c::print_mem:51 - core free memory : 50696 bytes
00:03:03.207 DEBUG main.c::print_mem:52 - heap fragments : 1
00:03:03.232 DEBUG main.c::print_mem:53 - heap free total : 136 bytes
00:03:03.260 DEBUG main.c::print_mem:54 - heap free largest: 136 bytes
----------------------------------------------------------------------------
--- Test Case 9.4 (Dynamic Mailboxes Factory)
--- Result: SUCCESS
00:03:03.521 DEBUG main.c::print_mem:51 - core free memory : 50696 bytes
00:03:03.549 DEBUG main.c::print_mem:52 - heap fragments : 1
00:03:03.575 DEBUG main.c::print_mem:53 - heap free total : 136 bytes
00:03:03.603 DEBUG main.c::print_mem:54 - heap free largest: 136 bytes
----------------------------------------------------------------------------
--- Test Case 9.5 (Dynamic Objects FIFOs Factory)
--- Result: SUCCESS
00:03:03.865 DEBUG main.c::print_mem:51 - core free memory : 50280 bytes
00:03:03.893 DEBUG main.c::print_mem:52 - heap fragments : 1
00:03:03.918 DEBUG main.c::print_mem:53 - heap free total : 552 bytes
00:03:03.946 DEBUG main.c::print_mem:54 - heap free largest: 552 bytes




Core free memory decreases after each iteration:


00:08:04.790 DEBUG main.c::print_mem:51  - core free memory : 47784 bytes
00:08:04.818 DEBUG main.c::print_mem:52 - heap fragments : 1
00:08:04.844 DEBUG main.c::print_mem:53 - heap free total : 552 bytes
00:08:04.871 DEBUG main.c::print_mem:54 - heap free largest: 552 bytes
--------------------------------------------------------------------------
Vitaly


Return to “ChibiOS/RT”

Who is online

Users browsing this forum: No registered users and 2 guests