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

Loader: Fix BusFault in handling of OOM #3992

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

Willy-JL
Copy link
Contributor

@Willy-JL Willy-JL commented Nov 7, 2024

What's new

  • during OOM propagation, ELF file has small chance of trying to free relocation data that is not allocated:
  • elf_load_section_data() does not allocate fast_rel->data if not enough ram
  • but elf_preload_section() allocated fast_rel itself, so both would try to be freed when only 1 exists
  • in particular, this was observable in upython app

Verification

  • try to run upython app
  • either it opens, or it gives out of memory message, not crash

Checklist (For Reviewer)

  • PR has description of feature/bug or link to Confluence/Jira task
  • Description contains actions to verify feature/bugfix
  • I've built this code, uploaded it to the device and verified feature/bugfix

@Willy-JL
Copy link
Contributor Author

Willy-JL commented Nov 7, 2024

there is something else to consider... basically this was doing aligned_free(NULL)... maybe this situation should be checked? then rather than BusFault you will get something like free(0) message, similar to malloc(0)

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.

1 participant