Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

correctly free thread_data options at the topmost parent process #1603

Merged
merged 2 commits into from
Jul 28, 2023

Conversation

dpronin
Copy link
Contributor

@dpronin dpronin commented Jul 27, 2023

for non-threaded mode: since thread_data::eo is a pointer within shared memory between the topmost fio parent process and its children let the fio parent process set the pointer to NULL as just it frees its copy of 'eo' as memory previously allocated by means of 'malloc' meaning that each child and the parent process itself must free it

for threaded mode we leave it as it has always been

also we do not need to check td->io_ops for being able to free td->eo in
fio_options_free()

This PR should fix double-free problem described in this issue and also should fix issue described in this PR

@dpronin dpronin force-pushed the td-eo-double-free-fix branch 2 times, most recently from c951516 to 90a5c49 Compare July 28, 2023 08:11
some files require to have some missing headers included

Signed-off-by: Denis Pronin <dannftk@yandex.ru>
for non-threaded mode: since thread_data::eo is a pointer within shared
memory between the topmost fio parent process and its children let the
fio parent process set the pointer to NULL as just it frees its copy of
'eo' as memory previously allocated by means of 'malloc' meaning that
each child and the parent process itself must free it

for threaded mode we leave it as it has always been

also we do not need to check td->io_ops for being able to free td->eo in
 fio_options_free()

Signed-off-by: Denis Pronin <dannftk@yandex.ru>
@axboe axboe merged commit 696abd9 into axboe:master Jul 28, 2023
7 of 10 checks passed
@dpronin dpronin deleted the td-eo-double-free-fix branch July 28, 2023 15:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants