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

getS16NoEx() returns true unless syntactical error in conf. #8304

Merged
merged 1 commit into from Mar 5, 2019

Conversation

sofar
Copy link
Contributor

@sofar sofar commented Mar 2, 2019

The getS16NoEx() handler will return true unless there is a
[num_emerge_threads] line in the minetest.conf at which
point the excption handler part is reached. Due to the fact that
defaultsettings.cpp has a default value set for this setting,
that never will happen.

Because of this, the code will never check the number of threads on
the system, and keep nthreads = 0. If that happens, the value is
changed to 1 and only 1 emerge thread will be used.

The default should be set to 1 instead, due to the potential unsafe
consequences for the standard sqlite map files, but that should be a
separate commit that also adds documentation for that setting. This
commit focuses on removing this hiding bug instead.

The getS16NoEx() handler will return true unless there is a
`[num_emerge_threads]` line in the `minetest.conf` at which
point the excption handler part is reached. Due to the fact that
`defaultsettings.cpp` has a default value set for this setting,
that never will happen.

Because of this, the code will never check the number of threads on
the system, and keep `nthreads = 0`. If that happens, the value is
changed to `1` and only 1 emerge thread will be used.

The default should be set to `1` instead, due to the potential unsafe
consequences for the standard sqlite map files, but that should be a
separate commit that also adds documentation for that setting. This
commit focuses on removing this `hiding` bug instead.
@sofar
Copy link
Contributor Author

sofar commented Mar 2, 2019

BTW, I suspect that many settings bugs like this exist. The entire class of getXXNoEx() settings getters are all affected, I think.

@sofar sofar added Bugfix 🐛 PRs that fix a bug @ Mapgen labels Mar 2, 2019
@sofar sofar added this to the 5.1.0 milestone Mar 2, 2019
@SmallJoker
Copy link
Member

get*NoEx() is most likely though for

  1. Legacy settings (removed defaults)
  2. Settings without defaults (mapgen)
  3. Incomplete group settings (noise params)

For regular minetest.conf settings, get*() can be used without any problems as there's always a fallback.

@nerzhul nerzhul merged commit 61e5fba into minetest:master Mar 5, 2019
rubenwardy pushed a commit that referenced this pull request Mar 11, 2019
The getS16NoEx() handler will return true unless there is a
`[num_emerge_threads]` line in the `minetest.conf` at which
point the excption handler part is reached. Due to the fact that
`defaultsettings.cpp` has a default value set for this setting,
that never will happen.

Because of this, the code will never check the number of threads on
the system, and keep `nthreads = 0`. If that happens, the value is
changed to `1` and only 1 emerge thread will be used.

The default should be set to `1` instead, due to the potential unsafe
consequences for the standard sqlite map files, but that should be a
separate commit that also adds documentation for that setting. This
commit focuses on removing this `hiding` bug instead.
rubenwardy pushed a commit that referenced this pull request Mar 11, 2019
The getS16NoEx() handler will return true unless there is a
`[num_emerge_threads]` line in the `minetest.conf` at which
point the excption handler part is reached. Due to the fact that
`defaultsettings.cpp` has a default value set for this setting,
that never will happen.

Because of this, the code will never check the number of threads on
the system, and keep `nthreads = 0`. If that happens, the value is
changed to `1` and only 1 emerge thread will be used.

The default should be set to `1` instead, due to the potential unsafe
consequences for the standard sqlite map files, but that should be a
separate commit that also adds documentation for that setting. This
commit focuses on removing this `hiding` bug instead.
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.

None yet

3 participants