Skip to content

UUID Test Failure Due to Malloc Arena Size when using arcmwdt toolchain #93564

@M-Moawad

Description

@M-Moawad

Describe the bug

The UUID v5 test fails because uuid_generate_v5() requires dynamic memory allocation for the mbedTLS cryptographic operations: uuid.c:95-106
and when using the ARCMWDT toolchain, the system falls back to MINIMAL_LIBC based on the default selection logic: Kconfig:66-73
When using MINIMAL_LIBC, the CONFIG_COMMON_LIBC_MALLOC_ARENA_SIZE defaults to 0: Kconfig:57-60
This means malloc operations will fail, causing the mbedTLS setup to return MBEDTLS_ERR_MD_ALLOC_FAILED, which gets translated to -ENOMEM in the UUID generation function.

Regression

  • This is a regression.

Steps to reproduce

Use the ARC MWDT toolchain

Build and run the test by the following command:

west twister -p nsim/nsim_em -W -T tests/lib/uuid

Relevant log output

===================================================================
START - test_uuid_v5
E: CONFIG_COMMON_LIBC_MALLOC_ARENA_SIZE is 0

    Assertion failed at WEST_TOPDIR/zephyr/tests/lib/uuid/src/main.c:40: uuid_test_uuid_v5: (result == 0 is false)
uuid_generate_v5 returned an error
 FAIL - test_uuid_v5 in 0.006 seconds
===================================================================
TESTSUITE uuid failed.

Impact

Annoyance – Minor irritation; no significant impact on usability or functionality.

Environment

OS: Linux
Toolchain (e.g Zephyr SDK, ...): arcmwdt
Commit SHA or Version used: Main 47b07e5

Additional Context

No response

Metadata

Metadata

Labels

area: TestsIssues related to a particular existing or missing testbugThe issue is a bug, or the PR is fixing a bugpriority: lowLow impact/importance bug

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions