test for rtems_workspace_greedy_allocate

Chris Johns chrisj at rtems.org
Mon Feb 8 04:51:34 UTC 2021


On 8/2/21 2:41 pm, Chris Johns wrote:
> Hello,
> 
> I see the call `rtems_workspace_greedy_allocate` is in `src/rtems` and publicly
> available via the installed header file `rtems/support.h`.

Sorry the code is libcsupport.

> Are there tests for this and similar support calls?
> 
> I ask because tests in rtems.git and rtems-libbsd.git testsuites depend on this
> call and it appears to be broken on psim and PowerPC hardware. Recent psim test
> results from Joel show `spprivenv01.exe` failing and I think it is
> `rtems_workspace_greedy_allocate` or friends that maybe the issue ..
> 
> https://lists.rtems.org/pipermail/build/2021-February/025169.html


The in the test after calling greedy ...

https://git.rtems.org/rtems/tree/testsuites/sptests/spprivenv01/init.c#n58

... calloc ends up being called and the first alloc fails however the allocator
calls `rtems_malloc_extend_handler` and that ends up in the `sbrk` call in
bsps/powerpc/shared/start/sbrk.c.

Should the greedy call consume all memory that could be allocated and so does
the extend handler needs to be called until it has been exhausted as well?

Chris


More information about the devel mailing list