Skip to content

Fix crashes while copying files to nRF via USB #2369

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

Merged
merged 3 commits into from
Dec 11, 2019

Conversation

jepler
Copy link

@jepler jepler commented Dec 10, 2019

There are a number of tricky cases that exist when there is the possibility to enter background
tasks early in initialization. I discovered and fixed several of them, which were due to trying operations on the GC heap while it was not initialized. This closes #2338 according to my testing. An assertion which clarifies problematic calls to m_free was added, but is not strictly necessary.

It's extremely dubious that we have these handles that we think
are to GC'd memory at a time when the gc pool may not be initialized.
Hopefully, they WERE valid GC memory and are undisturbed by the teardown
of the interpreter that can lead to this state.

In this case, don't try to m_free them, the memory will become free when
the GC heap is reinitialized.

Closes: adafruit#2338 (together with previous commit)
@tannewt tannewt self-requested a review December 11, 2019 19:08
@tannewt tannewt added this to the 5.x.x - Bug Fixes milestone Dec 11, 2019
Copy link
Member

@tannewt tannewt left a comment

Choose a reason for hiding this comment

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

Nice! Thank you!

@tannewt tannewt merged commit ce8d400 into adafruit:master Dec 11, 2019
@jepler jepler deleted the nrf-usb-crash branch November 3, 2021 21:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

nrf52840 feather: crash on file write
2 participants