Skip to content

Fix SEGFAULT in nif_lists_reverse #1600

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 1 commit into from
Mar 28, 2025

Conversation

bblaszkow06
Copy link
Contributor

A hardcoded 2 as roots count is invalid when the NIF is called as lists:reverse/1, possibly resulting in a SEGFAULT or Found unknown boxed type: C error during GC


These changes are made under both the "Apache 2.0" and the "GNU Lesser General
Public License 2.1 or later" license terms (dual license).

SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later

@bblaszkow06 bblaszkow06 force-pushed the fix/lists-reverse-segfault branch from f70738d to ed6f7fc Compare March 27, 2025 11:08
Copy link
Collaborator

@bettio bettio left a comment

Choose a reason for hiding this comment

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

Thanks for fixing this.
This fix is very important, so it should be merged into release-0.6.
Would you mind rebasing it to release-0.6 branch and adding a line to the changelog under the v0.6.6 / Fixes section? It would be nice something like "Fixed segfault in lists:reverse/1" or anything like that.
Also make sure to fixup everything in just one commit when adding this entry to the changelog.

@bblaszkow06 bblaszkow06 changed the base branch from main to release-0.6 March 27, 2025 13:12
A hardcoded `2` as roots count is invalid when nif is called as
lists:reverse/1

Signed-off-by: Bartosz Błaszków <[email protected]>
@bblaszkow06 bblaszkow06 force-pushed the fix/lists-reverse-segfault branch from ed6f7fc to 2f0c35c Compare March 27, 2025 13:18
@bblaszkow06 bblaszkow06 requested a review from bettio March 27, 2025 13:19
@bettio bettio merged commit 8bc200c into atomvm:release-0.6 Mar 28, 2025
137 of 140 checks passed
bettio added a commit that referenced this pull request Mar 29, 2025
Merge fixe for resources concurrency bug (#1603) and fixes for memory
corruptions (#1600 and #1601) from release-0.6 branch.
@bblaszkow06 bblaszkow06 deleted the fix/lists-reverse-segfault branch April 1, 2025 09:35
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