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

[no sq] Safety and other fixes #15251

Merged
merged 8 commits into from
Oct 12, 2024
Merged

[no sq] Safety and other fixes #15251

merged 8 commits into from
Oct 12, 2024

Conversation

sfan5
Copy link
Collaborator

@sfan5 sfan5 commented Oct 7, 2024

fixes #14435
fixes https://github.com/orgs/minetest/discussions/111 (internal)
fixes https://github.com/orgs/minetest/discussions/108 (internal)
fixes https://github.com/orgs/minetest/discussions/89 (internal)

To do

This PR is Ready for Review.

How to test

see linked discussions

@sfan5 sfan5 added @ Script API Bugfix 🐛 PRs that fix a bug Security Client/server, mod, network, authentication etc. Action / change needed Code still needs changes (PR) / more information requested (Issues) labels Oct 7, 2024
@sfan5 sfan5 force-pushed the sec1234 branch 2 times, most recently from 6eaf0f7 to d019d69 Compare October 8, 2024 12:35
@sfan5 sfan5 removed the Action / change needed Code still needs changes (PR) / more information requested (Issues) label Oct 8, 2024
@sfan5 sfan5 changed the title [no sq] (Mostly) safety fixes [no sq] Safety and other fixes Oct 8, 2024
@@ -231,143 +249,143 @@ void TestVoxelArea::test_index_xyz_all_pos()
VoxelArea v1;
UASSERTEQ(s32, v1.index(156, 25, 236), 155);

VoxelArea v2(v3s16(756, 8854, -875), v3s16(-147, -9547, 669));
UASSERTEQ(s32, v2.index(156, 25, 236), 1267138774);
VoxelArea v2(v3s16(-147, -9547, -875), v3s16(756, 8854, 669));
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

note: all of these positions were not sorted, causing garbage results

Copy link
Member

@SmallJoker SmallJoker left a comment

Choose a reason for hiding this comment

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

Looks good, works. Will approve after the few comments were addressed.

@sfan5 sfan5 added the Action / change needed Code still needs changes (PR) / more information requested (Issues) label Oct 9, 2024
@sfan5 sfan5 force-pushed the sec1234 branch 2 times, most recently from 7ca1551 to bc3a5fc Compare October 10, 2024 08:32
@sfan5 sfan5 removed the Action / change needed Code still needs changes (PR) / more information requested (Issues) label Oct 10, 2024
Copy link
Member

@Desour Desour left a comment

Choose a reason for hiding this comment

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

(Comments for 1st commit.)

Copy link
Member

@Desour Desour left a comment

Choose a reason for hiding this comment

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

(2nd commit.)

Copy link
Member

@Desour Desour left a comment

Choose a reason for hiding this comment

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

3rd

static void set_null(lua_State *L);
// Clear the pointer in the ObjectRef (at -1).
// Throws an fatal error if the object pointer wasn't `expect`.
static void set_null(lua_State *L, void *expect);
Copy link
Member

Choose a reason for hiding this comment

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

Why void ptr?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

🤷

Copy link
Member

@Desour Desour left a comment

Choose a reason for hiding this comment

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

Looks good. 👍

(Didn't test.)

In particular this validates the edges of VoxelArea and fixes
all the nonsense tests uncovered by it.
Copy link
Member

@Desour Desour left a comment

Choose a reason for hiding this comment

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

(Haven't tested much.)

sfan5 added 2 commits October 11, 2024 11:39
concrete problem: the getEmergeThread safety check was missing there
Copy link
Member

@SmallJoker SmallJoker left a comment

Choose a reason for hiding this comment

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

Re-read the code and checked a few singleplayer worlds with Lua mapgens. No issue found. No new valgrind error appears.

@sfan5 sfan5 merged commit d95e916 into luanti-org:master Oct 12, 2024
15 checks passed
@sfan5 sfan5 deleted the sec1234 branch October 12, 2024 20:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bugfix 🐛 PRs that fix a bug @ Script API Security Client/server, mod, network, authentication etc. >= Two approvals ✅ ✅
Projects
None yet
Development

Successfully merging this pull request may close these issues.

VoxelManip:was_modified() doesn't do what it says
3 participants