Skip to content

Don't panic on memory commit failure. #154

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
Oct 5, 2024
Merged

Don't panic on memory commit failure. #154

merged 2 commits into from
Oct 5, 2024

Conversation

ncruces
Copy link
Owner

@ncruces ncruces commented Sep 16, 2024

@ncruces ncruces force-pushed the main branch 5 times, most recently from a76a73f to 6101deb Compare September 18, 2024 10:24
@ncruces ncruces changed the title Don't panic on commit failure. Don't panic on memory commit failure. Sep 22, 2024
@ncruces ncruces marked this pull request as ready for review October 5, 2024 23:02
@ncruces ncruces merged commit b5adcac into main Oct 5, 2024
5 checks passed
@ncruces ncruces deleted the growfail branch October 5, 2024 23:06
@ncruces
Copy link
Owner Author

ncruces commented Oct 6, 2024

For clarity, the idea here is that since tetratelabs/wazero#2315 if the allocator returns nil, the Wasm module is informed that growing memory failed.

Then for a C module, sbrk fails, malloc returns NULL, and if we compile with SQLITE_DEFAULT_MEMSTATUS then sqlite3_malloc tries to free some memory (caches, etc) before trying a second time.

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