Skip to content

A display fix and file system flush tweak #1743

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 2 commits into from
Apr 4, 2019

Conversation

tannewt
Copy link
Member

@tannewt tannewt commented Apr 3, 2019

There are two pieces to this because I found the file system issue and thought it might be the issue.

First, a double free of the terminal's TileGrid was freeing the heap from the supervisor. The flash cache could then allocate over the heap and corrupt it.

Second, the flush is tweaked so that the cache is maintained while a VM is running. This also ensures the cache is released even when no current sector is loaded into it.

Without this, a double free can occur when a display (and terminal)
is released and then a crash occurs. Upon a second release,
different memory is released (sometimes the heap). When this is
followed by an allocation for the flash cache, the cache can
overwrite the active heap causing crashes.

Fixes micropython#1667
Copy link
Collaborator

@dhalbert dhalbert left a comment

Choose a reason for hiding this comment

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

One q on API design. But code looks good! Thanks for tracking this difficult bug down!

This should make filesystem writes quicker and cause less heap
churn.
Copy link
Collaborator

@dhalbert dhalbert left a comment

Choose a reason for hiding this comment

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

Thanks!!

@dhalbert dhalbert merged commit 5b0c1c8 into adafruit:master Apr 4, 2019
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.

2 participants