Skip to content

Conversation

@henrikbrixandersen
Copy link
Member

@henrikbrixandersen henrikbrixandersen commented Aug 31, 2025

Suppress memory leaks detected by valgrind originating from nct_new_thread(), part of the native_sim CPU thread emulation.

This covers calls to posix_new_thread() as well, since this function simply calls nct_new_thread (but may be optimized out by the compiler).

Inspired to use valgrind with native_sim by @aescolar's great talk on native_sim at ZDS 2025 in Amsterdam, thanks!

@zephyrbot zephyrbot added the area: native port Host native arch port (native_sim) label Aug 31, 2025
@zephyrbot zephyrbot requested a review from aescolar August 31, 2025 14:43
Copy link
Contributor

@tpambor tpambor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. I am wondering if this could be combined with the entry for posix_new_thread which only calls nct_new_thread.

int posix_new_thread(void *payload)
{
return nct_new_thread(te_state, payload);
}

Suppress memory leaks detected by valgrind originating from
nct_new_thread(), part of the native_sim CPU thread emulation.

This covers calls to posix_new_thread() as well, since this function simply
calls nct_new_thread (but may be optimized out by the compiler).

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
@henrikbrixandersen henrikbrixandersen force-pushed the valgrind_supress_nct_new_thread_no_cleanup branch from c2ac928 to ebfe8ee Compare September 1, 2025 12:04
@sonarqubecloud
Copy link

sonarqubecloud bot commented Sep 1, 2025

@kartben kartben merged commit 36f78b5 into zephyrproject-rtos:main Sep 3, 2025
32 checks passed
@henrikbrixandersen henrikbrixandersen deleted the valgrind_supress_nct_new_thread_no_cleanup branch September 12, 2025 12:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: native port Host native arch port (native_sim)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants