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

fix: when executing a child process, do not waitpid before reading #753

Merged
merged 1 commit into from
Nov 3, 2024

Conversation

liz3
Copy link
Contributor

@liz3 liz3 commented Oct 30, 2024

Trying to waitpid before reading the piped content will lead to a blocked pipe and get the child process "stuck". So it should be read BEFORE waitpid is called. Further there was a bug within the reallocation logic leading to heap corruption because the comparison size did not include the just read chunk, leading to heap corruption, which itself led to reallocate failing.

What's Changed:

Type of Change:

  • Bug fix
  • New feature
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Housekeeping:

  • Tests have been updated to reflect the changes done within this PR (if applicable).
  • Documentation has been updated to reflect the changes done within this PR (if applicable).

Trying to waitpid before reading the piped content will lead to a blocked pipe and
get the child process "stuck". So it should be read BEFORE waitpid is called.
Further there was a bug within the reallocation logic leading to heap corruption
because the comparison size did not include the just read chunk, leading to heap corruption,
which itself led to reallocate failiing.
@Jason2605
Copy link
Member

Nice, thank you!

@Jason2605 Jason2605 merged commit 2c18902 into dictu-lang:develop Nov 3, 2024
8 of 9 checks passed
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