zephyrproject-rtos / zephyr

Primary Git Repository for the Zephyr Project. Zephyr is a new generation, scalable, optimized, secure RTOS for multiple hardware architectures.
https://docs.zephyrproject.org
Apache License 2.0
10.01k stars 6.16k forks source link

posix: getentropy: portability.posix.getentropy.newlib, portability.posix.getentropy.picolibc and portability.posix.getentropy fail #73653

Open katgiadla opened 4 weeks ago

katgiadla commented 4 weeks ago

Describe the bug Tests:

Observed for:

To Reproduce Steps to reproduce the behavior:

  1. have nrf9160dk/nrf9160 connected
  2. go to your zephyr dir
  3. call ./scripts/twister -T tests/posix/getentropy/ -p nrf9160dk/nrf9160/ns --device-testing --device-serial /dev/ttyACM0 -v --inline-logs
  4. See console output with error

Expected behavior Valid console output

Impact Not clear

Logs and console output

*** Booting Zephyr OS build v3.6.0-5099-g127cb9edb6c6 ***
Running TESTSUITE getentropy_test_suite
===================================================================
START - test_getentropy
Assertion failed at zephyr/tests/posix/getentropy/src/main.c:47: getentropy_test_suite_test_getentropy: ret not equal to 0
FAIL - test_getentropy in 0.014 seconds
===================================================================
START - test_getentropy_max_size
Assertion failed at zephyr/tests/posix/getentropy/src/main.c:36: getentropy_test_suite_test_getentropy_max_size: ret not equal to 0
FAIL - test_getentropy_max_size in 0.014 seconds
===================================================================
START - test_getentropy_null_buffer
PASS - test_getentropy_null_buffer in 0.001 seconds
===================================================================
START - test_getentropy_too_large
PASS - test_getentropy_too_large in 0.001 seconds
===================================================================
TESTSUITE getentropy_test_suite failed.
------ TESTSUITE SUMMARY START ------
SUITE FAIL -  50.00% [getentropy_test_suite]: pass = 2, fail = 2, skip = 0, total = 4 duration = 0.030 seconds
- FAIL - [getentropy_test_suite.test_getentropy] duration = 0.014 seconds
- FAIL - [getentropy_test_suite.test_getentropy_max_size] duration = 0.014 seconds
- PASS - [getentropy_test_suite.test_getentropy_null_buffer] duration = 0.001 seconds
- PASS - [getentropy_test_suite.test_getentropy_too_large] duration = 0.001 seconds
------ TESTSUITE SUMMARY END ------
===================================================================
RunID: 390a18c3022454a1b8c52b5dedeab941
PROJECT EXECUTION FAILED

Environment (please complete the following information):

cfriedt commented 4 weeks ago

I'm unable to reproduce this actually, but I also don't have the nrf53840. @katgiadla - do you have an upstream simulation platform that you can reproduce the problem on?

Feel free to add some printf debugging for more detail (e.g. in getentropy.c)