Skip to content

Conversation

@cfriedt
Copy link
Member

@cfriedt cfriedt commented Apr 5, 2025

  • posix: timers: correct pointer passed to k_mem_slab_free()
  • tests: posix: timers: provide at least 1 dynamic thread
  • tests: posix: timer: do not skip tests

Fixes #88192
Fixes #88194

INFO: Error found: portability.posix.c_lib_ext on qemu_cortex_m0/nrf51822 (Not enough RAM but is one of the integration platforms)
INFO: Error found: portability.posix.c_lib_ext.minimal on qemu_cortex_m0/nrf51822 (Not enough RAM but is one of the integration platforms)
INFO: Error found: portability.posix.c_lib_ext.newlib on qemu_cortex_m0/nrf51822 (Not enough RAM but is one of the integration platforms)
INFO: Error found: portability.posix.c_lib_ext.picolibc on qemu_cortex_m0/nrf51822 (Not enough RAM but is one of the integration platforms)

If it is not possible to create a timer in timer_create(),
then the timer_obj associated with the timer must be freed.

However, the address of the pointer was mistakenly being
passed to k_mem_slab_free() rather than simply the
the pointer.

This caused a crash in tests which can easily be avoided
by passing the pointer rather than the address of the
pointer.

Signed-off-by: Chris Friedt <[email protected]>
@cfriedt cfriedt force-pushed the time-tests-not-run-for-qemu-riscv64 branch 2 times, most recently from 6a42b8d to 60c9a25 Compare April 12, 2025 13:42
cfriedt added 2 commits April 12, 2025 10:00
timer_create() will error if there are no dynamic threads to
run the SIGEV_THREAD handler, causing the test to fail (where
it was previously expected to pass).

Ensure that there is at least 1 dynamic thread available to
the POSIX API.

Signed-off-by: Chris Friedt <[email protected]>
I just happened to try to run this testsuite manually today and
noticed that it was being skipped due to a copy-paste error.

This test was migrated from tests/posix/common, where tests
were skipped for non-dynamic threads, since it would mostly
duplicate tests that had already been run.

However, while migrating, the condition to skip tests was
mistakenly left in when it should not have been.

Signed-off-by: Chris Friedt <[email protected]>
@cfriedt cfriedt force-pushed the time-tests-not-run-for-qemu-riscv64 branch from 60c9a25 to 059087c Compare April 12, 2025 14:00
@cfriedt cfriedt marked this pull request as ready for review April 12, 2025 15:39
@github-actions github-actions bot added the area: POSIX POSIX API Library label Apr 12, 2025
@github-actions github-actions bot requested a review from ycsin April 12, 2025 15:39
@cfriedt cfriedt added the area: Tests Issues related to a particular existing or missing test label Apr 12, 2025
@cfriedt
Copy link
Member Author

cfriedt commented Apr 14, 2025

Just adding other reviewers to get a second approval.

@cfriedt cfriedt requested a review from jukkar April 14, 2025 15:05
@kartben kartben merged commit 7883694 into zephyrproject-rtos:main Apr 16, 2025
28 checks passed
@cfriedt cfriedt deleted the time-tests-not-run-for-qemu-riscv64 branch July 7, 2025 00:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: POSIX POSIX API Library area: Tests Issues related to a particular existing or missing test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

posix: timers: incorrect pointer passed to k_mem_slab_free() posix: timers: tests skipped when migrating testsuite

5 participants