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

missing fx_media_open_notify initialization without FX_DISABLE_FORCE_MEMORY_OPERATION defined #4

Open
TheFlyvio opened this issue Nov 1, 2023 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@TheFlyvio
Copy link

when user does not need the open notification, the FX_DISABLE_FORCE_MEMORY_OPERATION is undefined and fx_media_open_notify_set(fx_media, NULL) is not called before the opening, the FX_MEDIA fx_media_open_notify attribute is never initialized, resulting in a potential hard fault.

Azure RTOS 6.3.0

Steps to reproduce the behavior:

  1. let FX_DISABLE_FORCE_MEMORY_OPERATION undefined
  2. do not call fx_media_open_notify_set
  3. create FX_MEDIA in the stack after some work was done and memory isnt only zeroes anymore
  4. open the media
  5. the "address" contained in fx_media_open_notify will be called

two ways it can be worked around
-defining FX_DISABLE_FORCE_MEMORY_OPERATION
-before the opening, calling fx_media_open_notify_set with a function pointer or null

@TheFlyvio TheFlyvio added the bug Something isn't working label Nov 1, 2023
@xiuwencai
Copy link

Yes, this is a bug. Another workaround is defining FX_MEDIA as a global variable so that it contains all zeros.

@eclipsewebmaster eclipsewebmaster transferred this issue from another repository Jan 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants