Code Monkey home page Code Monkey logo

irrlicht's Introduction

IrrlichtMt version 1.9

Notice

IrrlichtMt has been moved into the main Minetest repository during Minetest 5.9 development. This repository is an archive useful for building older versions of Minetest.

About

IrrlichtMt is the 3D engine of Minetest. It is based on the Irrlicht Engine but is now developed independently. It is intentionally not compatible to upstream and is planned to be eventually absorbed into Minetest.

Build

The build system is CMake.

The following libraries are required to be installed:

  • zlib, libPNG, libJPEG
  • OpenGL
    • or on mobile: OpenGL ES (can be optionally enabled on desktop too)
  • on Unix: X11
  • SDL2 (see below)

Aside from standard search options (ZLIB_INCLUDE_DIR, ZLIB_LIBRARY, ...) the following options are available:

  • BUILD_SHARED_LIBS (default: ON) - Build IrrlichtMt as a shared library
  • BUILD_EXAMPLES (default: OFF) - Build example applications
  • ENABLE_OPENGL - Enable OpenGL driver
  • ENABLE_OPENGL3 (default: OFF) - Enable OpenGL 3+ driver
  • ENABLE_GLES1 - Enable OpenGL ES driver, legacy
  • ENABLE_GLES2 - Enable OpenGL ES 2+ driver
  • USE_SDL2 (default: platform-dependent, usually ON) - Use SDL2 instead of older native device code

e.g. on a Linux system you might want to build for local use like this:

git clone https://github.com/minetest/irrlicht
cd irrlicht
cmake . -DBUILD_SHARED_LIBS=OFF
make -j$(nproc)

This will put an IrrlichtMtTargets.cmake file into the cmake directory in the current build directory, and it can then be imported from another project by pointing find_package() to the build directory, or by setting the CMAKE_PREFIX_PATH variable to that same path.

on Windows system:

It is highly recommended to use vcpkg as package manager.

After you successfully built vcpkg you can easily install the required libraries:

vcpkg install zlib libjpeg-turbo libpng sdl2 --triplet x64-windows

Run the following script in PowerShell:

git clone https://github.com/minetest/irrlicht
cd irrlicht
cmake -B build -G "Visual Studio 17 2022" -A "Win64" -DCMAKE_TOOLCHAIN_FILE=[vcpkg-root]/scripts/buildsystems/vcpkg.cmake -DBUILD_SHARED_LIBS=OFF
cmake --build build --config Release

Platforms

We aim to support these platforms:

  • Windows via MinGW
  • Linux (GL or GLES)
  • macOS
  • Android

This doesn't mean other platforms don't work or won't be supported, if you find something that doesn't work contributions are welcome.

License

The license of the Irrlicht Engine is based on the zlib/libpng license and applies to this fork, too.

The Irrlicht Engine License
===========================

Copyright (C) 2002-2012 Nikolaus Gebhardt

This software is provided 'as-is', without any express or implied
warranty.  In no event will the authors be held liable for any damages
arising from the use of this software.

Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:

1. The origin of this software must not be misrepresented; you must not
 claim that you wrote the original software. If you use this software
 in a product, an acknowledgement in the product documentation would be
 appreciated but is not required.
2. Altered source versions must be clearly marked as such, and must not be
 misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.

irrlicht's People

Contributors

appgurueu avatar calebabutler avatar celeron55 avatar desour avatar fncontroloption avatar fuzun avatar germanaizek avatar grorp avatar hecktest avatar hybriddog avatar jordan4ibanez avatar josiahwi avatar lhofhansl avatar ndren avatar neoh4x0r avatar nephele-gh avatar nerzhul avatar numberzero avatar okias avatar paradust7 avatar rollerozxa avatar rubenwardy avatar savilli avatar sfan5 avatar smalljoker avatar srifqi avatar v-rob avatar wsor4035 avatar x2048 avatar y5nw avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

irrlicht's Issues

[Suggestion] Enable XInput2 By Default

Continuation Of minetest/minetest#10729 (comment)

Currently if you want to compile Minetest with X11 touchscreen support, you also need to do a custom compile of IrrlichtMt with XInput2 support manually enabled (_IRR_LINUX_X11_XINPUT2_). In my opinion, this should be enabled by default.

While this is an extra dependency, XInput2 is available in almost every single major Linux distribution: Debian, Arch, Alpine, and others.

OpenGL limited to 3.0 while Minecraft works with 4.5

My iGPU is shown below, running on Linux Mint 20.2 Cinnamon. Would I get any extra performance with 4.5 support? Is there a way to enable it with a precompiled client?

nicu@nas:~$ glxinfo -B
name of display: :0
display: :0  screen: 0
direct rendering: Yes
Extended renderer info (GLX_MESA_query_renderer):
    Vendor: Intel Open Source Technology Center (0x8086)
    Device: Mesa DRI Intel(R) HD Graphics 4600 (HSW GT2) (0x412)
    Version: 21.0.3
    Accelerated: yes
    Video memory: 1536MB
    Unified memory: yes
    Preferred profile: core (0x1)
    Max core profile version: 4.5
    Max compat profile version: 3.0
    Max GLES1 profile version: 1.1
    Max GLES[23] profile version: 3.1
OpenGL vendor string: Intel Open Source Technology Center
OpenGL renderer string: Mesa DRI Intel(R) HD Graphics 4600 (HSW GT2)
OpenGL core profile version string: 4.5 (Core Profile) Mesa 21.0.3
OpenGL core profile shading language version string: 4.50
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile

OpenGL version string: 3.0 Mesa 21.0.3
OpenGL shading language version string: 1.30
OpenGL context flags: (none)

OpenGL ES profile version string: OpenGL ES 3.1 Mesa 21.0.3
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.10

Unable to install irrlicht with cmake

Hi,

Trying to install irrlichtmt,
I installed all the necessary libraries and exported the environmental variables in .bashrc. Still I'm end up in cmake error.

export PNG_LIBRARY=/home/sun/data/softwares/libpng-1.6.37/lib
export PNG_INCLUDE_DIR=/home/sun/data/softwares/libpng-1.6.37/include

export JPEG_INCLUDE_DIR=/home/sun/data/softwares/jpeg-9e/include
export JPEG_LIBRARY=/home/sun/data/softwares/jpeg-9e/lib

export ZLIB_INCLUDE_DIR=/home//sun/data/softwares/zlib-1.2.12/include
export ZLIB_LIBRARY=/home/sun/data/softwares/zlib-1.2.12/lib


X11_Xxf86vm_LIB # (which path is correct ? 1 or 2)
#1#
https://github.com/Almamu/linux-wallpaperengine/issues/1
#export X11_INCLUDE_DIR=/home/sun/data/softwares/libXxf86vm-1.1.4/lit/include
export X11_Xxf86vm_LIB=/home/sun/data/softwares/libXxf86vm-1.1.4/lit/lib

#2#
export LD_LIBRARY_PATH=/home/sun/data/softwares/libXxf86vm-1.1.4/lit/lib
export LD_RUN_PATH=/home/sun/data/softwares/libXxf86vm-1.1.4/lit/lib

I tried to build using the cmake . -DBUILD_SHARED_LIBS=OFF or cmake . && make
ending up same error. Need help!

-- *** Building IrrlichtMt 1.9.0 ***
-- Looking for IRR_COMPILE_WITH_OGLES1
-- Looking for IRR_COMPILE_WITH_OGLES1 - not found
-- Looking for IRR_COMPILE_WITH_OGLES2
-- Looking for IRR_COMPILE_WITH_OGLES2 - not found
-- Looking for IRR_COMPILE_WITH_OPENGL
-- Looking for IRR_COMPILE_WITH_OPENGL - found
-- Looking for IRR_LINUX_X11_XINPUT2
-- Looking for IRR_LINUX_X11_XINPUT2 - not found
-- Looking for IRR_COMPILE_WITH_SDL_DEVICE
-- Looking for IRR_COMPILE_WITH_SDL_DEVICE - not found
-- Configuring done
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
X11_Xxf86vm_LIB (ADVANCED)
linked by target "IrrlichtMt" in directory /home/sun/data/softwares/reconcilation/minetest/lib/irrlichtmt/source/Irrlicht

-- Generating done
CMake Generate step failed. Build files cannot be regenerated correctly.

XInput2 causes erratic mouse behavior with two XScreens

Following commit 91edd21, the in-game mouse behavior became erratic where the mouse would
attempt to control the move the view within the game on one screen but keep the cursor on a different screen. However, this only happens on :0.0.

My system has two XScreens (:0.0 and :0.1). At any menu inside Minetest, there is no issue. If I run the game on :0.1, there is also no issue. The mouse stays with the game on the same screen and all is good.

If it is played on :0.0, then it is erratic. The mouse is mostly seen on :0.1. While dragging the mouse, the game flickers (painfully) a lot as it spins the view looking straight up. It is as if something is confused about where the mouse should be in relation to the game window. Could it be only considering the display and ignoring the screen (:<display>[.screen]) in making a decision about the mouse cursor?

I have tested Minetest 5.6.0 with IrrlichtMt 1.9.0mt7 with and without this commit so can confirm the issue is related to XInput2.

Add verbose flag in CI build

This is a feature request to improve the process of debugging the build system. It's a very easy change, but I'm opening an issue because I can see the counterargument that the build will seem cluttered. Would this be an acceptable change to PR?

Readd Directx render.

Readd DirectX render. Readding the DirectX renderer could improve the rendering on some devices. Also DirectX is faster on some devices.

Hidden virtual function in CIrrNullDevice

CIrrNullDevice.h declares draw2DImage on line 144. A number of other subclasses (see CIrrGLDevice.h line 151) override this function with a different method signature, resulting in a warning from g++. To my understanding this basically clobbers the one defined in CIrrNullDevice.h, which is probably not intentional behavior, and could theoretically cause unexpected errors.

Edit: Clarification. I've researched this and reproduced a minimal example to prove the concept to myself. What's going on here is that you can't overload across scopes, so trying to call the signatures defined in CNullDevice from a CGLDevice scope will fail, because it resolves to the signature in CGLDevice which "hides" all the signatures you might expect to inherit. One can do using CNullDevice::draw2DImage; to bring those signatures into the scope (this will fix the warning). Maybe we don't want to inherit those signatures, but I'm double checking in case this was an oversight.

Testing / cleanup efforts

Make sure that it builds for and works on all platforms supported by Minetest:

  • Linux
  • Linux/GLES
  • Windows
  • Android
  • macOS (tested by @Jordach)

Cleanup efforts not done so far:

  • Replace build system with CMake?
  • Fix Clang "inconsistent-missing-override" warnings

XInput not found on RPI4

CMake Error at source/Irrlicht/CMakeLists.txt:117 (message):
XInput not found

Trying to use C-make to install on a raspberry pi 4 with 4gb ram on rasbian and this error pops up. I cant find anything about it on stack overflow or other search engines.

Any idea on how to proceed?

Unit test restoration

I've started adding unit tests back to IrrlichtMt, leaving out all the stuff that tests code we removed. The tests are integrated with CMake and ctest. There was a request to enable test coverage metrics, but I'm not sure that's useful for our purposes, can be discussed. More importantly, how many tests do we want to restore, and if not all of them which parts of the code do we want to keep tests for?

animation_blend is broken.

This issue was caused by Irrlicht 1.8 which broke animation_blend. See github.com/minetest_game/mods/player_api/api or github.com/minetest_game/mods/player_api/init for an example.

s32_min and s32_max give the wrong result for absolutely big values

I compiled Minetest with ubsan and see this message when I start Minetest (and enter the main menu):
irrMath.h:323:23: runtime error: signed integer overflow: -2147483648 - 215 cannot be represented in type 'int'

The s32_min and s32_max functions only work for small (absolute) values. I think this isn't documented, so it's a bug. Here's a small C program to test these functions:

#include <stdio.h>
#include <stdint.h>

// s32 as defined in irrTypes.h
typedef int32_t	s32;

// s32_min coped from irrMath.h
s32 s32_min(s32 a, s32 b)
{
	const s32 mask = (a - b) >> 31;
	return (a & mask) | (b & ~mask);
}

// s32_max coped from irrMath.h
s32 s32_max(s32 a, s32 b)
{
	const s32 mask = (a - b) >> 31;
	return (b & mask) | (a & ~mask);
}

void do_minmax(s32 a, s32 b)
{
	printf("a: %d, b: %d, min: %d, max: %d\n", a, b, s32_min(a, b),
		s32_max(a, b));
}

void main()
{
	do_minmax(-2147483634, 14);
		// shows a: -2147483634, b: 14, min: -2147483634, max: 14
	do_minmax(-2147483648, 14);
		// shows a: -2147483648, b: 14, min: 14, max: -2147483648
}

These two functions are defined in include/irrMath.h:321.

  • Stacktrace from ubsan: minetest_errors.txt
  • My minetest.conf: 7400559/minetest.conf.txt
  • My cmake gcc flags including ubsan:
    -DCMAKE_CXX_FLAGS="-fdiagnostics-color=always -march=native -Os -pipe -fsanitize=undefined -fno-sanitize=vptr")
    Environment variable for ubsan stacktrace: export UBSAN_OPTIONS='print_stacktrace=1'

OpenGL preference policy; prefer GLVND at or above CMake 3.11

My proposed change is to remove the Legacy OpenGL preference in the CMake build, and set policy CMP0072. The simplest way to do it would be to increase the version range to include 3.11, so that the policy will be chosen automatically as described by https://cmake.org/cmake/help/latest/policy/CMP0072.html. None of the policies introduced by CMake 3.10 (CMP0070, CMP0071) affect us, and CMP0072 was the only policy introduced in CMake 3.11, so there will be no unexpected side effects of increasing the version range.

Relevant Minetest issue: minetest/minetest#12041

Edit: Won't cause a regression of minetest/minetest#7665; could cause a regression of minetest/minetest#7655 (comment) depending on the CMake version on that system. This is not a trivial configuration change.

Build fails with GCC 11.2.0 for Mac OS X 10.4 PowerPC

I built GCC 11.2.0 for Mac OS X 10.4 Tiger PowerPC following this guide. After building the necessary dependencies (zlib, libpng, libjpeg), I configured the build using this command:

cmake .. -DCMAKE_TOOLCHAIN_FILE=/Users/thomas/Documents/minetest/ppctoolchain.cmake -DCMAKE_INSTALL_PREFIX=/opt/irrlichtmt/ppc

ppctoolchain.cmake contains the following:

set(CMAKE_SYSTEM_NAME Darwin)
set(CMAKE_SYSTEM_PROCESSOR powerpc)

set(CMAKE_SYSROOT /Developer/SDKs/MacOSX10.4u.sdk)

set(tools /opt/gcc/ppc/11/bin)
set(CMAKE_C_COMPILER ${tools}/powerpc-apple-darwin8-gcc)
set(CMAKE_CXX_COMPILER ${tools}/powerpc-apple-darwin8-g++)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

set(CMAKE_C_FLAGS "-fPIC -Os -mmacosx-version-min=10.4 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -static-libgcc -static-libstdc++")
set(CMAKE_CXX_FLAGS "-fPIC -Os -mmacosx-version-min=10.4 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -static-libgcc -static-libstdc++")
set(CMAKE_LINK_OPTIONS "-mmacosx-version-min=10.4 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -static-libgcc -static-libstdc++")

set(CMAKE_FIND_ROOT_PATH "/opt/zlib/ppc;/opt/libpng/ppc;/opt/libjpeg/ppc;/opt/zstd/ppc;/opt/jsoncpp/ppc;/opt/lua/ppc")

CMake configured perfectly fine...

-- The CXX compiler identification is GNU 11.2.0
-- Checking whether CXX compiler has -isysroot
-- Checking whether CXX compiler has -isysroot - yes
-- Checking whether CXX compiler supports OSX deployment target flag
-- Checking whether CXX compiler supports OSX deployment target flag - yes
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /opt/gcc/ppc/11/bin/powerpc-apple-darwin8-g++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- *** Building IrrlichtMt 1.9.0 ***
-- Found ZLIB: /opt/zlib/ppc/lib/libz.dylib (found version "1.2.11") 
-- Found JPEG: /opt/libjpeg/ppc/lib/libjpeg.dylib (found version "90") 
-- Found PNG: /opt/libpng/ppc/lib/libpng.dylib (found version "1.6.37") 
-- Looking for _IRR_COMPILE_WITH_OGLES1_
-- Looking for _IRR_COMPILE_WITH_OGLES1_ - not found
-- Looking for _IRR_COMPILE_WITH_OGLES2_
-- Looking for _IRR_COMPILE_WITH_OGLES2_ - not found
-- Looking for _IRR_COMPILE_WITH_OPENGL_
-- Looking for _IRR_COMPILE_WITH_OPENGL_ - found
-- Found OpenGL: /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/OpenGL.framework   
-- Looking for _IRR_LINUX_X11_XINPUT2_
-- Looking for _IRR_LINUX_X11_XINPUT2_ - not found
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/thomas/Documents/minetest/game/irrlicht/build

...however, actually building immediately failed.

Thomass-iMac:build thomas$ make
[  0%] Building CXX object source/Irrlicht/CMakeFiles/IRRGUIOBJ.dir/CGUIButton.cpp.o
In file included from /opt/gcc/ppc/11/lib/gcc/powerpc-apple-darwin8/11.2.0/../../../../powerpc-apple-darwin8/include/_wctype.h:78,
                 from /opt/gcc/ppc/11/lib/gcc/powerpc-apple-darwin8/11.2.0/../../../../powerpc-apple-darwin8/include/wchar.h:115,
                 from /Users/thomas/Documents/minetest/game/irrlicht/include/irrTypes.h:63,
                 from /Users/thomas/Documents/minetest/game/irrlicht/include/IReferenceCounted.h:8,
                 from /Users/thomas/Documents/minetest/game/irrlicht/include/IAttributeExchangingObject.h:8,
                 from /Users/thomas/Documents/minetest/game/irrlicht/include/IGUIElement.h:8,
                 from /Users/thomas/Documents/minetest/game/irrlicht/include/IGUIButton.h:8,
                 from /Users/thomas/Documents/minetest/game/irrlicht/source/Irrlicht/CGUIButton.h:11,
                 from /Users/thomas/Documents/minetest/game/irrlicht/source/Irrlicht/CGUIButton.cpp:5:
/Users/thomas/Documents/minetest/game/irrlicht/include/irrString.h:43:25: error: expected primary-expression before 'c'
   43 | inline bool isdigit(s32 c);
      |                         ^
/Users/thomas/Documents/minetest/game/irrlicht/include/irrString.h:43:25: error: expected ')' before 'c'
/Users/thomas/Documents/minetest/game/irrlicht/include/irrString.h:43:13: note: to match this '('
   43 | inline bool isdigit(s32 c);
      |             ^~~~~~~
make[2]: *** [source/Irrlicht/CMakeFiles/IRRGUIOBJ.dir/CGUIButton.cpp.o] Error 1
make[1]: *** [source/Irrlicht/CMakeFiles/IRRGUIOBJ.dir/all] Error 2
make: *** [all] Error 2

After asking some more knowledgeable people, it was suggested to make sure s32 was defined. (see this issue)
However, it was already defined within include/irrTypes.h, and deleting s32 from the inline function made no difference.

I'm at a loss here as to what to do. Any sort of help would be greatly appreciated.

Update to latest Irrlicht 1.8 branch

This repository does not contain all changes from the 1.8 branch.
https://sourceforge.net/p/irrlicht/code/6134/log/?path=/branches/releases/1.8
Although in fact it was supposed to be release 1.8.5 (which was never released), but there are no critical changes other than bug fixes.

While working on the macOS fix, I found that this thread also contains many valuable fixes. I might recommend updating this repository.

Then I will also do a PR with other fixes to support the latest macOS, including support for Retina screen and UI scaling (Irrlicht is now broken on MacBook with retina screen, Tabs not clicking in main menu, etc.)
https://github.com/minetest/minetest/issues?q=is%3Aopen+is%3Aissue+label%3A%22Mac+OS%22

Roadmap

IrrlichtMt is meant to be copied into Minetest some day, ideally at a point where we can throw away much of the code because we would use SDL2 + our own OpenGL(ES) renderer by then.
This issue collects things that should be done.

Cleanup (to be done in any case):

  • Unbundle libraries
  • Replace build system with CMake
  • Drop DirectX, software drivers and unused file formats
  • Drop other features we don't use
  • Try to identify long outdated code and fix it (ancient Windows/OSX, other API/compiler support or workarounds and similar things)
  • Get rid of non-STL containers: (get rid of implementation and ideally also the type)
  • + core::map (removed)
  • + core::array (wrapped)
  • + core::list (wrapped)
  • + core::string (wrapped)
  • + core::unicode::ustring (removed)
  • Remove unused GUI classes
  • Remove compressed color formats
  • Remove any use of irrAllocator
  • Get rid of IrrCompileConfig (#158)
  • sort out the remaining _IRR_COMPILE_WITH_FOOBAR_ defines
  • drop methods and things marked as deprecated
  • ...
  • At the very end: Do a cleanup pass over all of the code: make code style consistent, remove IClass / CClass split where feasible, modernize with C++/STL, use MT's way of logging

Features:

  • Implement borderless fullscreen
  • Fix clipboard Unicode
  • OpenGL bindings (#52)
  • Make driver implementations use the bindings (remove direct libGL linkage), see #276 for partial work
  • Port SDL driver to SDL2
  • Feature parity for SDL2 driver:
  • + working input, IME
  • + OpenGL ES
  • + window icon
  • + other issues (see #137)
  • Use SOVERSION to indicate lack of backwards compat
  • Drop anything but SDL2 (#157)

Invalid load of boolean value in lib/irrlichtmt/include/irrAllocator.h

Compiling recent Minetest with UBsan (executing cmake with the argument -DCMAKE_CXX_FLAGS='-fsanitize-undefined -fno-sanitize=vptr' in addition to its other arguments) & starting Minetest with the environment variable setting UBSAN_OPTIONS='print_stacktrace=1' produced the following stack trace:

lib/irrlichtmt/include/irrAllocator.h:47:3: runtime error: load of value 192, which is not a valid value for type 'bool'
    #0 0x55f21a77cf16 in irr::core::irrAllocator<bool>::construct(bool*, bool const&) (bin/minetest+0x43c1f16)
    minetest/minetest#1 0x55f21aadd3e8 in irr::core::array<bool, irr::core::irrAllocator<bool> >::operator=(irr::core::array<bool, irr::core::irrAllocator<bool> > const&) (bin/minetest+0x47223e8)
    minetest/minetest#2 0x55f21aadc571 in irr::core::array<bool, irr::core::irrAllocator<bool> >::array(irr::core::array<bool, irr::core::irrAllocator<bool> > const&) (bin/minetest+0x4721571)
    minetest/minetest#3 0x55f21aadcd03 in irr::core::irrAllocator<irr::core::array<bool, irr::core::irrAllocator<bool> > >::construct(irr::core::array<bool, irr::core::irrAllocator<bool> >*, irr::core::array<bool, irr::core::irrAllocator<bool> > const&) (bin/minetest+0x4721d03)
    minetest/minetest#4 0x55f21aadc989 in irr::core::array<irr::core::array<bool, irr::core::irrAllocator<bool> >, irr::core::irrAllocator<irr::core::array<bool, irr::core::irrAllocator<bool> > > >::reallocate(unsigned int, bool) (bin/minetest+0x4721989)
    minetest/minetest#5 0x55f21aad2235 in irr::core::array<irr::core::array<bool, irr::core::irrAllocator<bool> >, irr::core::irrAllocator<irr::core::array<bool, irr::core::irrAllocator<bool> > > >::insert(irr::core::array<bool, irr::core::irrAllocator<bool> > const&, unsigned int) (bin/minetest+0x4717235)
    minetest/minetest#6 0x55f21aacd3be in irr::core::array<irr::core::array<bool, irr::core::irrAllocator<bool> >, irr::core::irrAllocator<irr::core::array<bool, irr::core::irrAllocator<bool> > > >::push_back(irr::core::array<bool, irr::core::irrAllocator<bool> > const&) (bin/minetest+0x47123be)
    minetest/minetest#7 0x55f21aab8660 in irr::scene::CSkinnedMesh::finalize() (bin/minetest+0x46fd660)
    minetest/minetest#8 0x55f21ab89369 in irr::scene::CB3DMeshFileLoader::createMesh(irr::io::IReadFile*) (bin/minetest+0x47ce369)
    minetest/minetest#9 0x55f21a731aad in irr::scene::CSceneManager::getUncachedMesh(irr::io::IReadFile*, irr::core::string<char, irr::core::irrAllocator<char> > const&, irr::core::string<char, irr::core::irrAllocator<char> > const&) (bin/minetest+0x4376aad)
    minetest/minetest#10 0x55f21a73166f in irr::scene::CSceneManager::getMesh(irr::io::IReadFile*) (bin/minetest+0x437666f)
    minetest/minetest#11 0x55f2195bfd75 in Client::getMesh(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool) (bin/minetest+0x3204d75)
    minetest/minetest#12 0x55f2196cd38f in GenericCAO::addToScene(ITextureSource*, irr::scene::ISceneManager*) (bin/minetest+0x331238f)
    minetest/minetest#13 0x55f219615398 in ClientEnvironment::addActiveObject(ClientActiveObject*) (bin/minetest+0x325a398)
    minetest/minetest#14 0x55f2196157e3 in ClientEnvironment::addActiveObject(unsigned short, unsigned char, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) (bin/minetest+0x325a7e3)
    minetest/minetest#15 0x55f219dab4bb in Client::handleCommand_ActiveObjectRemoveAdd(NetworkPacket*) (bin/minetest+0x39f04bb)
    minetest/minetest#16 0x55f2195c82e7 in Client::handleCommand(NetworkPacket*) (bin/minetest+0x320d2e7)
    minetest/minetest#17 0x55f2195b36cc in Client::ProcessData(NetworkPacket*) (bin/minetest+0x31f86cc)
    minetest/minetest#18 0x55f2195b3079 in Client::ReceiveAll() (bin/minetest+0x31f8079)
    minetest/minetest#19 0x55f2195ac330 in Client::step(float) (bin/minetest+0x31f1330)
    minetest/minetest#20 0x55f21979f7d2 in Game::step(float*) (bin/minetest+0x33e47d2)
    minetest/minetest#21 0x55f2197473b0 in Game::run() (bin/minetest+0x338c3b0)
    minetest/minetest#22 0x55f21978705f in the_game(bool*, InputHandler*, RenderingEngine*, GameStartData const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, ChatBackend&, bool*) (bin/minetest+0x33cc05f)
    minetest/minetest#23 0x55f21962ec7a in ClientLauncher::run(GameStartData&, Settings const&) (bin/minetest+0x3273c7a)
    minetest/minetest#24 0x55f21a2dfe71 in main (bin/minetest+0x3f24e71)
    minetest/minetest#25 0x7ff59080c09a in __libc_start_main ../csu/libc-start.c:308
    minetest/minetest#26 0x55f219558419 in _start (bin/minetest+0x319d419)

I can not provide many details about how to reproduce it, but it happened in MineClone5.

To my knowledge UBsan has no false-positives. Therefore, this issue should be assumed to be a remotely-exploitable security vulnerability on the client, until it is somehow proven that this is not the case.

Corrupted model file hangs Minetest 5.4.1 client upon connection … b3d? more like bad3d!

Minetest version

5.4.1

OS / Hardware

Operating system: GNU/Linux

Summary

A corrupted B3D model found by using AFL on the Irrlicht hello world example code (example 1) in like 10 minutes or so of fuzzing is able to stall Minetest 5.4.1 forever upon connecting to a server that delivers it.

If you want to do this yourself, note that both the model ninja.b3d and the example code were removed recently from irrlichtmt by @hecktest, but they are still in the git history of course.

Steps to reproduce
  1. Download attached bad3d mod.
  2. Create a new world.
  3. Enable bad3d mod.
  4. Connect to server.
  5. Wait a long time.
  6. Send SIGTERM to Minetest, as it is very good at not dying while hanging.

bad3d.zip

CMake warnings when LTO is enabled as part of building Minetest

When building Minetest on Fedora 34 with CMake 3.20 and cmake -Bbuild -DCMAKE_BUILD_TYPE=Release -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=1, I get the following warnings near the end of the configuration process:

❯ cmake -Bbuild -DCMAKE_BUILD_TYPE=Release -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=1                                                                                                            
-- *** Will build version 5.5.0-dev ***
-- Using user-provided IrrlichtMt at subdirectory 'lib/irrlichtmt'
-- *** Building IrrlichtMt 1.9.0 ***
-- Found ZLIB: /usr/lib64/libz.so (found version "1.2.11") 
-- Found JPEG: /usr/local/lib64/libjpeg.so (found version "62") 
-- Found PNG: /usr/lib64/libpng.so (found version "1.6.37") 
-- Looking for _IRR_COMPILE_WITH_OGLES1_
-- Looking for _IRR_COMPILE_WITH_OGLES1_ - not found
-- Looking for _IRR_COMPILE_WITH_OGLES2_
-- Looking for _IRR_COMPILE_WITH_OGLES2_ - not found
-- Looking for _IRR_COMPILE_WITH_OPENGL_
-- Looking for _IRR_COMPILE_WITH_OPENGL_ - found
-- Found OpenGL: /usr/lib64/libOpenGL.so   
-- Found X11: /usr/include   
-- Looking for XOpenDisplay in /usr/lib64/libX11.so;/usr/lib64/libXext.so
-- Looking for XOpenDisplay in /usr/lib64/libX11.so;/usr/lib64/libXext.so - found
-- Looking for gethostbyname
-- Looking for gethostbyname - found
-- Looking for connect
-- Looking for connect - found
-- Looking for remove
-- Looking for remove - found
-- Looking for shmat
-- Looking for shmat - found
-- Looking for IceConnectionNumber in ICE
-- Looking for IceConnectionNumber in ICE - found
-- Using GMP provided by system.
-- Found GMP: /usr/lib64/libgmp.so  
-- Using JsonCpp provided by system.
-- Found Json: /usr/lib64/libjsoncpp.so  
-- Found LuaJIT: /usr/lib64/libluajit-5.1.so  
-- Using LuaJIT provided by system.
-- Found CURL: /usr/lib64/libcurl.so  
-- cURL support enabled.
-- Found GettextLib: /usr/include  
-- GetText enabled; locales found: ar;be;bg;ca;cs;da;de;dv;el;eo;es;et;eu;fi;fil;fr;gd;gl;he;hi;hu;id;it;ja;jbo;kk;kn;ko;ky;lt;lv;mr;ms;ms_Arab;nb;nl;nn;pl;pt;pt_BR;ro;ru;sk;sl;sr_Cyrl;sr_Latn;sv;sw;th;tr;tt;uk;vi;zh_CN;zh_TW
-- Found OpenAL: /usr/lib64/libopenal.so  
-- Found Vorbis: /usr/include  
-- Sound enabled.
-- Found Freetype: /usr/lib64/libfreetype.so (found version "2.10.4") 
-- Freetype enabled.
-- Looking for cbreak in /usr/lib64/libncursesw.so
-- Looking for cbreak in /usr/lib64/libncursesw.so - found
-- Found Ncursesw: /usr/lib64/libncursesw.so  
-- ncurses console enabled.
-- Could NOT find PostgreSQL (missing: PostgreSQL_LIBRARY PostgreSQL_INCLUDE_DIR) 
-- PostgreSQL not found!
-- LevelDB backend enabled.
-- Redis not found!
-- Found SQLite3: /usr/lib64/libsqlite3.so  
-- Prometheus client disabled.
-- SpatialIndex AreaStore backend enabled.
-- Looking for clock_gettime in rt
-- Looking for clock_gettime in rt - found
-- Looking for include file endian.h
-- Looking for include file endian.h - found
-- Locale blacklist applied; Locales used: be;bg;ca;cs;da;de;el;eo;es;et;eu;fi;fil;fr;gd;gl;hu;id;it;ja;jbo;kk;ko;ky;lt;lv;mr;ms;nb;nl;nn;pl;pt;pt_BR;ro;ru;sk;sl;sr_Cyrl;sr_Latn;sv;sw;tr;tt;uk;vi;zh_CN;zh_TW
-- Performing Test IS_AARCH64
-- Performing Test IS_AARCH64 - Failed
-- Found Doxygen: /usr/bin/doxygen (found version "1.9.1") found components: doxygen dot 
-- Configuring done
CMake Warning (dev) at lib/irrlichtmt/source/Irrlicht/CMakeLists.txt:117 (add_library):
  Policy CMP0069 is not set: INTERPROCEDURAL_OPTIMIZATION is enforced when
  enabled.  Run "cmake --help-policy CMP0069" for policy details.  Use the
  cmake_policy command to set the policy and suppress this warning.

  INTERPROCEDURAL_OPTIMIZATION property will be ignored for target
  'IRRMESHOBJ'.
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) at lib/irrlichtmt/source/Irrlicht/CMakeLists.txt:171 (add_library):
  Policy CMP0069 is not set: INTERPROCEDURAL_OPTIMIZATION is enforced when
  enabled.  Run "cmake --help-policy CMP0069" for policy details.  Use the
  cmake_policy command to set the policy and suppress this warning.

  INTERPROCEDURAL_OPTIMIZATION property will be ignored for target
  'IRRVIDEOOBJ'.
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) at lib/irrlichtmt/source/Irrlicht/CMakeLists.txt:178 (add_library):
  Policy CMP0069 is not set: INTERPROCEDURAL_OPTIMIZATION is enforced when
  enabled.  Run "cmake --help-policy CMP0069" for policy details.  Use the
  cmake_policy command to set the policy and suppress this warning.

  INTERPROCEDURAL_OPTIMIZATION property will be ignored for target
  'IRRIOOBJ'.
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) at lib/irrlichtmt/source/Irrlicht/CMakeLists.txt:125 (add_library):
  Policy CMP0069 is not set: INTERPROCEDURAL_OPTIMIZATION is enforced when
  enabled.  Run "cmake --help-policy CMP0069" for policy details.  Use the
  cmake_policy command to set the policy and suppress this warning.

  INTERPROCEDURAL_OPTIMIZATION property will be ignored for target 'IRROBJ'.
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) at lib/irrlichtmt/source/Irrlicht/CMakeLists.txt:222 (add_library):
  Policy CMP0069 is not set: INTERPROCEDURAL_OPTIMIZATION is enforced when
  enabled.  Run "cmake --help-policy CMP0069" for policy details.  Use the
  cmake_policy command to set the policy and suppress this warning.

  INTERPROCEDURAL_OPTIMIZATION property will be ignored for target
  'IRRGUIOBJ'.
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) at lib/irrlichtmt/source/Irrlicht/CMakeLists.txt:190 (add_library):
  Policy CMP0069 is not set: INTERPROCEDURAL_OPTIMIZATION is enforced when
  enabled.  Run "cmake --help-policy CMP0069" for policy details.  Use the
  cmake_policy command to set the policy and suppress this warning.

  INTERPROCEDURAL_OPTIMIZATION property will be ignored for target
  'IRROTHEROBJ'.
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) at lib/irrlichtmt/source/Irrlicht/CMakeLists.txt:256 (add_library):
  Policy CMP0069 is not set: INTERPROCEDURAL_OPTIMIZATION is enforced when
  enabled.  Run "cmake --help-policy CMP0069" for policy details.  Use the
  cmake_policy command to set the policy and suppress this warning.

  INTERPROCEDURAL_OPTIMIZATION property will be ignored for target
  'IrrlichtMt'.
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) at src/CMakeLists.txt:518 (add_executable):
  Policy CMP0069 is not set: INTERPROCEDURAL_OPTIMIZATION is enforced when
  enabled.  Run "cmake --help-policy CMP0069" for policy details.  Use the
  cmake_policy command to set the policy and suppress this warning.

  INTERPROCEDURAL_OPTIMIZATION property will be ignored for target
  'minetest'.
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Generating done
-- Build files have been written to: /home/hugo/Documents/Git/minetest/minetest/build

I'm also inclined to think that LTO isn't functional on Minetest, given what I have below:

Binary size comparison

LTO enabled

❯ ll -B bin/minetest     
Permissions      Size User Date Modified Name
.rwxr-xr-x  9,522,936 hugo  9 Aug 15:30  bin/minetest

LTO disabled

After building with LTO enabled, I ran git clean -dfx and built everything with LTO disabled, but binary size didn't increase. This means LTO is likely not working either.

❯ ll -B bin/minetest 
Permissions      Size User Date Modified Name
.rwxr-xr-x  9,522,936 hugo  9 Aug 15:34  minetest

In comparison, the -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=1 switch has a small but noticeable effect on binary size on Odamex (another software built using CMake). It also increases linking time a lot, so you know that LTO is working 🙂

minetest failed to build with error C2589, error C3878, error C2760 with MSVC under /permissive- mode on Windows

Minetest version
commit is 7ffc0268dfd78647187554d6248015329e9f5d2d
OS / Hardware

Operating system: Windows server 2019
CPU:

GPU model:
OpenGL version:

Summary

Minetest failed to build with error C2589, error C3878, error C2760 with MSVC under /permissive- mode on Windows. The commit we use is 7ffc0268dfd78647187554d6248015329e9f5d2d. Could you please take a look? Thanks.

VS version: VS2019 (16.11.11)
OS: Windwos server 2019

Steps to reproduce
  1. git clone https://github.com/minetest/minetest F:\gitP\minetest\minetest and cd F:\gitP\minetest\minetest
  2. xcopy F:\gitP\minetest\irrlicht F:\gitP\minetest\minetest\lib\irrlichtmt /k/r/e/i/s/c/h/f/y
  3. cd F:\gitP\Microsoft\vcpkg and bootstrap-vcpkg.bat 2>&1
  4. vcpkg.exe install --recurse zlib zstd curl[winssl] openal-soft libvorbis libogg sqlite3 freetype luajit gmp jsoncpp libjpeg-turbo --triplet x64-windows --clean-after-build 2>&1
  5. mkdir F:\gitP\minetest\minetest\build_amd64 and cd F:\gitP\minetest\minetest\build_amd64
  6. cmake -G "Visual Studio 16 2019" -A x64 -DCMAKE_SYSTEM_VERSION=10.0.18362.0 -DCMAKE_BUILD_TYPE=Release -DENABLE_GETTEXT=OFF -DENABLE_CURSES=OFF -DCMAKE_TOOLCHAIN_FILE=F:\gitP\Microsoft\vcpkg\scripts\buildsystems\vcpkg.cmake -DVCPKG_TARGET_TRIPLET=x64-windows .. 2>&1
  7. set CL= /permissive-
  8. mkdir F:\gitP\minetest\minetest\sdklocaltools and cd F:\gitP\minetest\minetest\sdklocaltools
  9. set PATH=F:\tools\build2\bin;%PATH%
  10. curl https://www.khronos.org/registry/OpenGL/api/GL/glext.h -O -L 2>&1
    curl https://www.khronos.org/registry/OpenGL/api/GL/glcorearb.h -O -L 2>&1
    curl https://www.khronos.org/registry/OpenGL/api/GL/glxext.h -O -L 2>&1
    curl https://www.khronos.org/registry/OpenGL/api/GL/wglext.h -O -L 2>&1
  11. xcopy F:\gitP\minetest\minetest\sdklocaltools "C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\gl" /k/r/e/i/s/c/h/f/y
  12. cd F:\gitP\minetest\minetest\build_amd64
  13. msbuild /m /p:Platform=x64 /p:Configuration=Release minetest.sln /t:Rebuild 2>&1
Excepted result:

build successfully.

Actual result:
F:\gitP\minetest\minetest\lib\irrlichtmt\include\irrArray.h(397,16): error C2589: '(': illegal token on right side of '::' [F:\gitP\minetest\minetest\build_amd64\lib\irrlichtmt\source\Irrlicht\IRROTHEROBJ.vcxproj]
        F:\gitP\minetest\minetest\lib\irrlichtmt\include\irrArray.h(397,16): error C3878: syntax error: unexpected token '(' following 'expression' [F:\gitP\minetest\minetest\build_amd64\lib\irrlichtmt\source\Irrlicht\IRROTHEROBJ.vcxproj]
        F:\gitP\minetest\minetest\lib\irrlichtmt\include\irrArray.h(397,16): error C2760: syntax error: ')' was unexpected here; expected ';' [F:\gitP\minetest\minetest\build_amd64\lib\irrlichtmt\source\Irrlicht\IRROTHEROBJ.vcxproj]
        F:\gitP\minetest\minetest\lib\irrlichtmt\include\irrArray.h(397,16): error C3878: syntax error: unexpected token ')' following 'expression_statement' [F:\gitP\minetest\minetest\build_amd64\lib\irrlichtmt\source\Irrlicht\IRROTHEROBJ.vcxproj]
        F:\gitP\minetest\minetest\lib\irrlichtmt\include\irrArray.h(397,16): error C2760: syntax error: ':' was unexpected here; expected ';' [F:\gitP\minetest\minetest\build_amd64\lib\irrlichtmt\source\Irrlicht\IRROTHEROBJ.vcxproj]
        F:\gitP\minetest\minetest\lib\irrlichtmt\include\irrArray.h(397,16): error C3878: syntax error: unexpected token ':' following 'expression_statement' [F:\gitP\minetest\minetest\build_amd64\lib\irrlichtmt\source\Irrlicht\IRROTHEROBJ.vcxproj]
Detailed log:

build.log

Add EGL DRM backend

Problem

Drawing directly to display is faster that throught Xorg or anything else.

Solutions

To add it there must be reading input from device node. Also cursor would be needed.

Alternatives

fbdev, dumb buffer DRM

Additional context

It should be easy to add by adding additional framebuffer adding code.

Android build broken due to CMake

-- The CXX compiler identification is Clang 11.0.5
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: [...]/llvm/prebuilt/linux-x86_64/bin/clang++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- *** Building IrrlichtMt 1.9.0 ***
-- Found ZLIB: [...]/llvm/prebuilt/linux-x86_64/sysroot/usr/lib/arm-linux-androideabi/16/libz.so (found version "1.2.11") 
-- Found JPEG: [...]/libjpeg/armeabi-v7a/opt/libjpeg-turbo/lib32/libjpeg.a (found version "62") 
-- Found PNG: [...]/libpng/armeabi-v7a/usr/local/lib/libpng.a (found version "1.6.37") 
-- Looking for _IRR_COMPILE_WITH_OGLES1_
-- Looking for _IRR_COMPILE_WITH_OGLES1_ - found
-- Found OpenGLES: [...]/llvm/prebuilt/linux-x86_64/sysroot/usr/lib/arm-linux-androideabi/16/libGLESv1_CM.so
-- Looking for _IRR_COMPILE_WITH_OGLES2_
-- Looking for _IRR_COMPILE_WITH_OGLES2_ - not found
-- Looking for _IRR_COMPILE_WITH_OPENGL_
-- Looking for _IRR_COMPILE_WITH_OPENGL_ - not found
-- The C compiler identification is Clang 11.0.5
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: [...]/llvm/prebuilt/linux-x86_64/bin/clang - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Configuring done
CMake Error: install(EXPORT "IrrlichtMt-export" ...) includes target "IrrlichtMt" which requires target "native_app_glue" that is not in any export set.
-- Generating done
CMake Generate step failed.  Build files cannot be regenerated correctly.

@JosiahWI

CMake install target breaks build on CMake 3.7

Maybe wrong name?

CMake Error at CMakeLists.txt:32 (install):
  install TARGETS given target "IrrlichtMt" which does not exist in this directory.
-- Configuring incomplete, errors occurred!

Pixelflood 2 – Segfault Boogaloo: Sending lottapixel.jpg from server segfaults client upon connection

Minetest version

Minetest commit 719a12eca with irrlichtmt commit 594de99

OS / Hardware

Operating system: GNU/Linux
CPU: x64 something

Summary

I have upgraded my Pixelflood mod to work with the new code by changing the bytes 0F 0A 0F 0A in it to 7D 00 7D 00, giving it an apparent size of 32000×32000 pixels.

2021-09-14 22:54:52: ERROR[Main]: Irrlicht: JPEG FATAL ERROR in _tempreadfile: Corrupt JPEG data: bad Huffman code
2021-09-14 22:54:54: WARNING[Main]: Irrlicht: Could not create ITexture, texture needs to have a non-empty name.
UndefinedBehaviorSanitizer:DEADLYSIGNAL
==22014==ERROR: UndefinedBehaviorSanitizer: SEGV on unknown address 0x7f8614c45c10 (pc 0x7f888b9b9744 bp 0x7ffcb33a8910 sp 0x7ffcb33a88c8 T22014)
==22014==The signal is caused by a READ memory access.
    #0 0x7f888b9b9743  (/lib/x86_64-linux-gnu/libc.so.6+0x15c743)
    minetest/minetest#1 0x1faddbf in irr::video::CColorConverter::convert_A8R8G8B8toA8R8G8B8(void const*, int, void*) (bin/minetest+0x1faddbf)
    minetest/minetest#2 0x1fb1d37 in irr::video::CColorConverter::convert_viaFormat(void const*, irr::video::ECOLOR_FORMAT, int, void*, irr::video::ECOLOR_FORMAT) (bin/minetest+0x1fb1d37)
    minetest/minetest#3 0x1fb79cb in irr::video::CImage::copyToScaling(void*, unsigned int, unsigned int, irr::video::ECOLOR_FORMAT, unsigned int) (bin/minetest+0x1fb79cb)
    minetest/minetest#4 0x1fb7e4f in irr::video::CImage::copyToScaling(irr::video::IImage*) (bin/minetest+0x1fb7e4f)
    minetest/minetest#5 0x1f2e64c in irr::video::COpenGLCoreTexture<irr::video::COpenGLDriver>::COpenGLCoreTexture(irr::core::string<char, irr::core::irrAllocator<char> > const&, irr::core::array<irr::video::IImage*, irr::core::irrAllocator<irr::video::IImage*> > const&, irr::video::E_TEXTURE_TYPE, irr::video::COpenGLDriver*) (bin/minetest+0x1f2e64c)
    minetest/minetest#6 0x1f0a69f in irr::video::COpenGLDriver::createDeviceDependentTexture(irr::core::string<char, irr::core::irrAllocator<char> > const&, irr::video::IImage*) (bin/minetest+0x1f0a69f)
    minetest/minetest#7 0x1eb6ab7 in irr::video::CNullDriver::addTexture(irr::core::string<char, irr::core::irrAllocator<char> > const&, irr::video::IImage*) (bin/minetest+0x1eb6ab7)
    minetest/minetest#8 0xfe4054 in TextureSource::generateTexture(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) (bin/minetest+0xfe4054)
    minetest/minetest#9 0xfe344c in TextureSource::getTextureId(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) (bin/minetest+0xfe344c)
    minetest/minetest#10 0xfe5cb1 in TextureSource::getTexture(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned int*) (bin/minetest+0xfe5cb1)
    minetest/minetest#11 0xff8791 in TextureSource::getTextureAverageColor(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) (bin/minetest+0xff8791)
    minetest/minetest#12 0x1ae9fff in ContentFeatures::updateTextures(ITextureSource*, IShaderSource*, irr::scene::IMeshManipulator*, Client*, TextureSettings const&) (bin/minetest+0x1ae9fff)
    minetest/minetest#13 0x1af8bb3 in NodeDefManager::updateTextures(IGameDef*, void*) (bin/minetest+0x1af8bb3)
    minetest/minetest#14 0xb97b2e in Client::afterContentReceived() (bin/minetest+0xb97b2e)
    minetest/minetest#15 0xd5708c in Game::createClient(GameStartData const&) (bin/minetest+0xd5708c)
    minetest/minetest#16 0xd56559 in Game::startup(bool*, InputHandler*, RenderingEngine*, GameStartData const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, bool*, ChatBackend*) (bin/minetest+0xd56559)
    minetest/minetest#17 0xd9a1b1 in the_game(bool*, InputHandler*, RenderingEngine*, GameStartData const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, ChatBackend&, bool*) (bin/minetest+0xd9a1b1)
    minetest/minetest#18 0xc2e1cf in ClientLauncher::run(GameStartData&, Settings const&) (bin/minetest+0xc2e1cf)
    minetest/minetest#19 0x1a4d78b in main (bin/minetest+0x1a4d78b)
    minetest/minetest#20 0x7f888b88109a in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2409a)
    minetest/minetest#21 0xb06d69 in _start (bin/minetest+0xb06d69)

UndefinedBehaviorSanitizer can not provide additional info.
==22014==ABORTING
# exited 1
Steps to reproduce
  1. Install attached mod on server.
  2. Connect to server that runs it.
  3. Observe a client segfaulting.

pixelflood2.zip

GUI freezes randomly when a string input field is active (Linux)

When a string input field is active (that means, when I press keys, it writes something into it) (the chat does it also), the GUI sometimes freezes for a long time. The memory or CPU usage doesn't seem to exceed reasonable bounds, just the GUI doesn't react. When I send SIGTERM to Minetest, it closes quickly.

EDIT: When I press Ctrl, Shift or Alt, it unfreezes.

OS: Ubuntu 18.04
CPU: Intel® Core™ i3-6100U CPU @ 2.30GHz × 4
GPU: Intel® HD Graphics 520 (SKL GT2)

Pixelflood 3 – Server-Sent Client-Side Mayhem: Sending overalloc.bmp from server segfaults client upon connection

Minetest version

Minetest commit 719a12e with irrlichtmt commit 594de99

OS / Hardware

Operating system: GNU/Linux
CPU: 64-bit intel

Summary

I stole a 165 byte BMP image of size 1111498827×1083981 from here: image-rs/image#622

lib/irrlichtmt/source/Irrlicht/CColorConverter.cpp:22:16: runtime error: signed integer overflow: 1111498827 * 1083981 cannot be represented in type 'int'
    #0 0x1fa7286 in irr::video::CColorConverter::convert1BitTo16Bit(unsigned char const*, short*, int, int, int, bool) (bin/minetest+0x1fa7286)
    minetest/minetest#1 0x1fd1212 in irr::video::CImageLoaderBMP::loadImage(irr::io::IReadFile*) const (bin/minetest+0x1fd1212)
    minetest/minetest#2 0x1ec1f1e in irr::video::CNullDriver::createImagesFromFile(irr::io::IReadFile*, irr::video::E_TEXTURE_TYPE*) (bin/minetest+0x1ec1f1e)
    minetest/minetest#3 0xba5954 in irr::video::IVideoDriver::createImageFromFile(irr::io::IReadFile*) (bin/minetest+0xba5954)
    minetest/minetest#4 0xb8b9ca in Client::loadMedia(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool) (bin/minetest+0xb8b9ca)
    minetest/minetest#5 0xc91f29 in ClientMediaDownloader::loadMedia(Client*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) (bin/minetest+0xc91f29)
    minetest/minetest#6 0xc9934c in IClientMediaDownloader::checkAndLoad(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool, Client*) (bin/minetest+0xc9934c)
    minetest/minetest#7 0xc9af55 in ClientMediaDownloader::conventionalTransferDone(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, Client*) (bin/minetest+0xc9af55)
    minetest/minetest#8 0x142e519 in Client::handleCommand_Media(NetworkPacket*) (bin/minetest+0x142e519)
    minetest/minetest#9 0xba6ea0 in Client::handleCommand(NetworkPacket*) (bin/minetest+0xba6ea0)
    minetest/minetest#10 0xb8e3f8 in Client::ProcessData(NetworkPacket*) (bin/minetest+0xb8e3f8)
    minetest/minetest#11 0xb88968 in Client::ReceiveAll() (bin/minetest+0xb88968)
    minetest/minetest#12 0xb84457 in Client::step(float) (bin/minetest+0xb84457)
    minetest/minetest#13 0xd70c90 in Game::getServerContent(bool*) (bin/minetest+0xd70c90)
    minetest/minetest#14 0xd56ce4 in Game::createClient(GameStartData const&) (bin/minetest+0xd56ce4)
    minetest/minetest#15 0xd56559 in Game::startup(bool*, InputHandler*, RenderingEngine*, GameStartData const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, bool*, ChatBackend*) (bin/minetest+0xd56559)
    minetest/minetest#16 0xd9a1b1 in the_game(bool*, InputHandler*, RenderingEngine*, GameStartData const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, ChatBackend&, bool*) (bin/minetest+0xd9a1b1)
    minetest/minetest#17 0xc2e1cf in ClientLauncher::run(GameStartData&, Settings const&) (bin/minetest+0xc2e1cf)
    minetest/minetest#18 0x1a4d78b in main (bin/minetest+0x1a4d78b)
    minetest/minetest#19 0x7f512455409a in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2409a)
    minetest/minetest#20 0xb06d69 in _start (bin/minetest+0xb06d69)

UndefinedBehaviorSanitizer:DEADLYSIGNAL
==25512==ERROR: UndefinedBehaviorSanitizer: SEGV on unknown address 0x7f4d9c6b9898 (pc 0x000001fa75da bp 0x7ffc178c0910 sp 0x7ffc178c0720 T25512)
==25512==The signal is caused by a WRITE memory access.
    #0 0x1fa75d9 in irr::video::CColorConverter::convert1BitTo16Bit(unsigned char const*, short*, int, int, int, bool) (bin/minetest+0x1fa75d9)
    minetest/minetest#1 0x1fd1212 in irr::video::CImageLoaderBMP::loadImage(irr::io::IReadFile*) const (bin/minetest+0x1fd1212)
    minetest/minetest#2 0x1ec1f1e in irr::video::CNullDriver::createImagesFromFile(irr::io::IReadFile*, irr::video::E_TEXTURE_TYPE*) (bin/minetest+0x1ec1f1e)
    minetest/minetest#3 0xba5954 in irr::video::IVideoDriver::createImageFromFile(irr::io::IReadFile*) (bin/minetest+0xba5954)
    minetest/minetest#4 0xb8b9ca in Client::loadMedia(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool) (bin/minetest+0xb8b9ca)
    minetest/minetest#5 0xc91f29 in ClientMediaDownloader::loadMedia(Client*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) (bin/minetest+0xc91f29)
    minetest/minetest#6 0xc9934c in IClientMediaDownloader::checkAndLoad(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool, Client*) (bin/minetest+0xc9934c)
    minetest/minetest#7 0xc9af55 in ClientMediaDownloader::conventionalTransferDone(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, Client*) (bin/minetest+0xc9af55)
    minetest/minetest#8 0x142e519 in Client::handleCommand_Media(NetworkPacket*) (bin/minetest+0x142e519)
    minetest/minetest#9 0xba6ea0 in Client::handleCommand(NetworkPacket*) (bin/minetest+0xba6ea0)
    minetest/minetest#10 0xb8e3f8 in Client::ProcessData(NetworkPacket*) (bin/minetest+0xb8e3f8)
    minetest/minetest#11 0xb88968 in Client::ReceiveAll() (bin/minetest+0xb88968)
    minetest/minetest#12 0xb84457 in Client::step(float) (bin/minetest+0xb84457)
    minetest/minetest#13 0xd70c90 in Game::getServerContent(bool*) (bin/minetest+0xd70c90)
    minetest/minetest#14 0xd56ce4 in Game::createClient(GameStartData const&) (bin/minetest+0xd56ce4)
    minetest/minetest#15 0xd56559 in Game::startup(bool*, InputHandler*, RenderingEngine*, GameStartData const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, bool*, ChatBackend*) (bin/minetest+0xd56559)
    minetest/minetest#16 0xd9a1b1 in the_game(bool*, InputHandler*, RenderingEngine*, GameStartData const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, ChatBackend&, bool*) (bin/minetest+0xd9a1b1)
    minetest/minetest#17 0xc2e1cf in ClientLauncher::run(GameStartData&, Settings const&) (bin/minetest+0xc2e1cf)
    minetest/minetest#18 0x1a4d78b in main (bin/minetest+0x1a4d78b)
    minetest/minetest#19 0x7f512455409a in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2409a)
    minetest/minetest#20 0xb06d69 in _start (bin/minetest+0xb06d69)

UndefinedBehaviorSanitizer can not provide additional info.
==25512==ABORTING
# exited 1
Steps to reproduce
  1. Install attached mod on server.
  2. Connect to server that runs it.
  3. Observe a client segfaulting.

pixelflood3.zip

Commit 7d1dc8b2d54ada305e4e2caa38debf35a171c52d looks sus

This commit is titled “ Get rid of ancient workaround ...that probably negatively impacted performance or something else”: 7d1dc8b

As far as I can tell, the code that was removed followed the recommendations from this article:
https://docs.microsoft.com/en-us/windows/win32/dxtecharts/game-timing-and-multicore-processors

  1. Compute all timing on a single thread. Computation of timing on multiple threads — for example, with each thread associated with a specific processor — greatly reduces performance of multi-core systems.

  2. Set that single thread to remain on a single processor by using the Windows API SetThreadAffinityMask. Typically, this is the main game thread. While QueryPerformanceCounter and QueryPerformanceFrequency typically adjust for multiple processors, bugs in the BIOS or drivers may result in these routines returning different values as the thread moves from one processor to another. So, it's best to keep the thread on a single processor.

I think it would be a good idea to either explain why the code was removed or revert commit 7d1dc8b.

M Key from AZERTY French Keyboard (macOS)

Hi !
I'm encountered a problem with the keyboard, M key and some other key not work properly.

Step to reproduce

  • Azerty french keyboard MacOS (magic keyboard 2)
  • Press "m" key on text field
  • Minetest 5.6.0 dev

Inside control setting when I change keyboard setting with "m" key, engine change it with F10 key

minetest/minetest#11058

Add cube map support.

There is currently only video::ITexture class, but it is always 2d and it can not be cube map type (saving 6 faces of cube).

I suggest to add something like video::ITextureCube that would consist of 6 video::ITexture class pointers.

Usecases: all-directional shadow mapping, maybe something else (I don't know).

Readd all media formats

They shouldn't have been removed in the first place; their removal breaks Minetest's backwards compatibility. Keeping the readers around is not too much of a hassle in terms of added compile time and code base size.

Missing a license file

The license is already specified in the readme. However, adding a LICENSE.md file is secure and better.
This way, visitors can directly check the license file when they check the repository.

What do you think? Thanks. 🙂

SDL issue list

This is a list of bugs and other issues we still have with the sdl backend. Please feel free to add more items and/or correct wrong information.

  • Mouse spinning issues.
    PR: #123 + minetest/minetest#12636
    (Also at some point (i.e. after dropping all non-SDL backends) we should use relative mouse motion values.)
  • Clipboard doesn't work.
    PR: #132
  • Cursor icons API is not implemented.
    PR: #135
  • In inventory, items are always moved as if shift was hold.
    PR: #141
  • Minetest implements some thing platform-dependently, see minetest/src/client/renderingengine.cpp. (Only found X11 stuff in this file.) On sdl, the stuff doesn't really work. (Also, now that we use our own irrlicht fork, that code can be moved into this repo.)
    The things implemented there include stuff like getting display density or setting window properties.
    PR: #181 + minetest/minetest#13348
  • The minetest window window is moved a bit down at each start (about the thickness of the window decoration).
    PR: #142 + minetest/minetest#12861
  • [ ] Formspecs look a bit different. (Probably due to missing display size info stuff.)
  • Compiling with sdl requires modifying sourcecode:
    //! Uncomment this line to compile with the SDL device
    //#define _IRR_COMPILE_WITH_SDL_DEVICE_

    Edit: For the record, now it's: $ cmake -DUSE_SDL2=1 .
  • Pressing the inventory key (i) while a formspec is open always closes it, even if a text input field is focused.
    PR: #146

CPack Support

The CPack support information is missing from CMakeLists.txt. Trying to generate package (e.g. cpack -G DEB) results with an error. Also files generated by cpack should be listed in .gitignore file too. By this would mean users would be able to uninstall the (now renamed) library if needed.

Missing CMAKE_DL_LIBS in link interface

cmake_minimum_required(VERSION 3.18)

project(perftest
    VERSION 0.0.1
    DESCRIPTION "Performance comparison for IrrlichtMt changes"
    LANGUAGES CXX
)

find_package(IrrlichtMt REQUIRED)

add_executable(main main.cpp)
target_link_libraries(main PRIVATE IrrlichtMt::IrrlichtMt)
mezhir@Inspiron:~/code/open_contrib/irr_perf_test$ cmake --build build
[0/1] Re-running CMake...
-- Configuring done
-- Generating done
-- Build files have been written to: /home/mezhir/code/open_contrib/irr_perf_test/build
[1/1] Linking CXX executable main
FAILED: main 
: && /usr/bin/c++ -march=native -flto -g  CMakeFiles/main.dir/main.cpp.o -o main  /home/mezhir/code/open_contrib/irrlicht/build/lib/Linux/libIrrlichtMt.a  /usr/lib/x86_64-linux-gnu/libz.so  /usr/lib/x86_64-linux-gnu/libjpeg.so  /usr/lib/x86_64-linux-gnu/libpng.so  /usr/lib/x86_64-linux-gnu/libGL.so  /usr/lib/x86_64-linux-gnu/libGLU.so  /usr/lib/x86_64-linux-gnu/libX11.so  /usr/lib/x86_64-linux-gnu/libXxf86vm.so && :
/usr/bin/ld: /home/mezhir/code/open_contrib/irrlicht/build/lib/Linux/libIrrlichtMt.a(CGLXManager.cpp.o): undefined reference to symbol 'dlclose@@GLIBC_2.2.5'
/usr/bin/ld: /lib/x86_64-linux-gnu/libdl.so.2: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.

Fix copy/paste issue on Linux platforms

The long existing copy/paste issues of Minetest on Linux platforms have already been identified as an Irrlicht issue (see minetest/minetest#7830 ). So here would be the place to fix it.

There have already been efforts to fix the issue on Irrlicht 1.8.4, which can be found in the https://github.com/edo9300/irrlicht1-8-4 repository, mostly in the commits from March 2020. Examples for relevant commits would be edo9300/irrlicht1-8-4@f4a3f9a , edo9300/irrlicht1-8-4@d158440 and edo9300/irrlicht1-8-4@714022e ). I can confirm that copy/paste on Linux platforms can successfully be done using the Irrlicht version from that repository, although I had to change some string types from UTF8 to wide strings. For copying from Minetest to other applications, I had to use a wrapper because Minetest/Irrlicht served the clipboard selection requests only for a very short timeframe.

Maybe this existing work can be ported to the Minetest Irrlicht fork in order to solve the copy/paste issues.

Policy on warning flags

If #79 is merged, most or all of the warnings in the CI should be resolved. This would open an opportunity to increase the warning level. What should be our policy on warnings?

Rename

To avoid confusion, I suggest to rename this thing to something unique.

I don't have any name suggestion myself, just any name that is not “Irrlicht” should work.

Android: Minetest crashed when entering a world

IrrlichtMt version
abebac8bd4c60c8a25a8e4fa76c1e260f741daeb (from bisect)
OS / Hardware

Operating system: Android 12
CPU: Qualcomm Snapdragon 732G (Samsung Galaxy A72)

GPU model: Qualcomm Adreno 618
OpenGL version: OpenGL ES-CM 1.1

Summary

There seems to be a segmentation fault when entering a world on the Android version. Here is the logcat output:

net.minetest.minetest A/libc: Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0 in tid 7547 (MinetestNativeT), pid 7349 (netest.minetest)
*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
Build fingerprint: '???????/????????/???????/???????????????/??????????????????/????????????'
Revision: '7'
ABI: 'arm64'
Processor: '7'
Timestamp: ????-??-?? ??:??:??.?????????+????
Process uptime: 11s
Cmdline: net.minetest.minetest
pid: 7349, tid: 7547, name: MinetestNativeT  >>> net.minetest.minetest <<<
uid: 10473
signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0
Cause: null pointer dereference
    x0  0000000000000000  x1  b40000731d73c150  x2  00000000000069c0  x3  0000000000000000
    x4  b40000731d742b10  x5  00000000000069c0  x6  000000003f800000  x7  3f800000ffcbcbe0
    x8  00000000000000b4  x9  0000000000000000  x10 00000000be11e43a  x11 000000001d751130
    x12 4170000043070000  x13 0000000040a00000  x14 000000007ffffffe  x15 000000003f800000
    x16 00000070af10a358  x17 00000073f336c3d0  x18 00000070ac1ea000  x19 b40000731d74a770
    x20 b40000717d5980f0  x21 00000000000069c0  x22 b40000731d73c150  x23 00000000000002f0
    x24 0000000000000000  x25 0000000000000810  x26 00000070ae1a7f32  x27 0000ff80fff00030
    x28 000000000000000a  x29 000000711a30e800
    lr  00000070aebbec6c  sp  000000711a30e800  pc  00000073f336c358  pst 0000000020001000
backtrace:
      #00 pc 000000000004d358  /apex/com.android.runtime/lib64/bionic/libc.so (__memcpy+248) (BuildId: 2eccdd45647af1cc8350cd505ceb730b)
      #01 pc 0000000000f12c68  /data/app/~~UQI8TdXUi9fpMk_yuV7X6g==/net.minetest.minetest-nf-h1RUFRPF2ebnE7dBraQ==/lib/arm64/libMinetest.so (irr::video::COGLES1Driver::updateVertexHardwareBuffer(irr::video::COGLES1Driver::SHWBufferLink_opengl*)+160) (BuildId: 55aafccb85241ed52ff078f63e9f6287c1b36039)
      #02 pc 0000000000f130f4  /data/app/~~UQI8TdXUi9fpMk_yuV7X6g==/net.minetest.minetest-nf-h1RUFRPF2ebnE7dBraQ==/lib/arm64/libMinetest.so (irr::video::COGLES1Driver::updateHardwareBuffer(irr::video::CNullDriver::SHWBufferLink*)+88) (BuildId: 55aafccb85241ed52ff078f63e9f6287c1b36039)
      #03 pc 0000000000f132a8  /data/app/~~UQI8TdXUi9fpMk_yuV7X6g==/net.minetest.minetest-nf-h1RUFRPF2ebnE7dBraQ==/lib/arm64/libMinetest.so (irr::video::COGLES1Driver::createHardwareBuffer(irr::scene::IMeshBuffer const*)+320) (BuildId: 55aafccb85241ed52ff078f63e9f6287c1b36039)
      #04 pc 0000000000f01b58  /data/app/~~UQI8TdXUi9fpMk_yuV7X6g==/net.minetest.minetest-nf-h1RUFRPF2ebnE7dBraQ==/lib/arm64/libMinetest.so (irr::video::CNullDriver::drawMeshBuffer(irr::scene::IMeshBuffer const*)+44) (BuildId: 55aafccb85241ed52ff078f63e9f6287c1b36039)
      #05 pc 000000000095a584  /data/app/~~UQI8TdXUi9fpMk_yuV7X6g==/net.minetest.minetest-nf-h1RUFRPF2ebnE7dBraQ==/lib/arm64/libMinetest.so (ClientMap::DrawDescriptor::draw(irr::video::IVideoDriver*)+44) (BuildId: 55aafccb85241ed52ff078f63e9f6287c1b36039)
      #06 pc 0000000000959680  /data/app/~~UQI8TdXUi9fpMk_yuV7X6g==/net.minetest.minetest-nf-h1RUFRPF2ebnE7dBraQ==/lib/arm64/libMinetest.so (ClientMap::renderMap(irr::video::IVideoDriver*, int)+1788) (BuildId: 55aafccb85241ed52ff078f63e9f6287c1b36039)
      #07 pc 000000000095cd1c  /data/app/~~UQI8TdXUi9fpMk_yuV7X6g==/net.minetest.minetest-nf-h1RUFRPF2ebnE7dBraQ==/lib/arm64/libMinetest.so (ClientMap::render()+84) (BuildId: 55aafccb85241ed52ff078f63e9f6287c1b36039)
      #08 pc 0000000000ecb1f8  /data/app/~~UQI8TdXUi9fpMk_yuV7X6g==/net.minetest.minetest-nf-h1RUFRPF2ebnE7dBraQ==/lib/arm64/libMinetest.so (irr::scene::CSceneManager::drawAll()+1028) (BuildId: 55aafccb85241ed52ff078f63e9f6287c1b36039)
      #09 pc 0000000000a31bfc  /data/app/~~UQI8TdXUi9fpMk_yuV7X6g==/net.minetest.minetest-nf-h1RUFRPF2ebnE7dBraQ==/lib/arm64/libMinetest.so (RenderingCore::draw3D()+28) (BuildId: 55aafccb85241ed52ff078f63e9f6287c1b36039)
      #10 pc 0000000000a32c64  /data/app/~~UQI8TdXUi9fpMk_yuV7X6g==/net.minetest.minetest-nf-h1RUFRPF2ebnE7dBraQ==/lib/arm64/libMinetest.so (RenderingCorePlain::drawAll()+16) (BuildId: 55aafccb85241ed52ff078f63e9f6287c1b36039)
      #11 pc 0000000000a31bac  /data/app/~~UQI8TdXUi9fpMk_yuV7X6g==/net.minetest.minetest-nf-h1RUFRPF2ebnE7dBraQ==/lib/arm64/libMinetest.so (RenderingCore::draw(irr::video::SColor, bool, bool, bool, bool)+264) (BuildId: 55aafccb85241ed52ff078f63e9f6287c1b36039)
      #12 pc 00000000009f93bc  /data/app/~~UQI8TdXUi9fpMk_yuV7X6g==/net.minetest.minetest-nf-h1RUFRPF2ebnE7dBraQ==/lib/arm64/libMinetest.so (RenderingEngine::draw_scene(irr::video::SColor, bool, bool, bool, bool)+64) (BuildId: 55aafccb85241ed52ff078f63e9f6287c1b36039)
      #13 pc 0000000000996378  /data/app/~~UQI8TdXUi9fpMk_yuV7X6g==/net.minetest.minetest-nf-h1RUFRPF2ebnE7dBraQ==/lib/arm64/libMinetest.so (Game::updateFrame(ProfilerGraph*, RunStats*, float, CameraOrientation const&)+2244) (BuildId: 55aafccb85241ed52ff078f63e9f6287c1b36039)
      #14 pc 0000000000993ba8  /data/app/~~UQI8TdXUi9fpMk_yuV7X6g==/net.minetest.minetest-nf-h1RUFRPF2ebnE7dBraQ==/lib/arm64/libMinetest.so (Game::run()+1008) (BuildId: 55aafccb85241ed52ff078f63e9f6287c1b36039)
      #15 pc 00000000009a0cbc  /data/app/~~UQI8TdXUi9fpMk_yuV7X6g==/net.minetest.minetest-nf-h1RUFRPF2ebnE7dBraQ==/lib/arm64/libMinetest.so (the_game(bool*, InputHandler*, RenderingEngine*, GameStartData const&, std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> >&, ChatBackend&, bool*)+124) (BuildId: 55aafccb85241ed52ff078f63e9f6287c1b36039)
      #16 pc 000000000094de48  /data/app/~~UQI8TdXUi9fpMk_yuV7X6g==/net.minetest.minetest-nf-h1RUFRPF2ebnE7dBraQ==/lib/arm64/libMinetest.so (ClientLauncher::run(GameStartData&, Settings const&)+2468) (BuildId: 55aafccb85241ed52ff078f63e9f6287c1b36039)
      #17 pc 0000000000c63630  /data/app/~~UQI8TdXUi9fpMk_yuV7X6g==/net.minetest.minetest-nf-h1RUFRPF2ebnE7dBraQ==/lib/arm64/libMinetest.so (main+1284) (BuildId: 55aafccb85241ed52ff078f63e9f6287c1b36039)
      #18 pc 0000000000ca57d0  /data/app/~~UQI8TdXUi9fpMk_yuV7X6g==/net.minetest.minetest-nf-h1RUFRPF2ebnE7dBraQ==/lib/arm64/libMinetest.so (android_main+84) (BuildId: 55aafccb85241ed52ff078f63e9f6287c1b36039)
      #19 pc 00000000013ca1f4  /data/app/~~UQI8TdXUi9fpMk_yuV7X6g==/net.minetest.minetest-nf-h1RUFRPF2ebnE7dBraQ==/lib/arm64/libMinetest.so (BuildId: 55aafccb85241ed52ff078f63e9f6287c1b36039)
      #20 pc 00000000000b6d54  /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)+264) (BuildId: 2eccdd45647af1cc8350cd505ceb730b)
      #21 pc 0000000000053370  /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+68) (BuildId: 2eccdd45647af1cc8350cd505ceb730b)
Steps to reproduce
  1. Enter any world (singleplayer or on a server).
Note

That commit does fix the problem for my computer (MSVC build using Windows 10 [10.0.19044] and AMD Ryzen 5 4500U). I got the same error ("vector subscript out of range") without that commit:

#01  minetest.exe!std::vector<irr::video::S3DVertex,std::allocator<irr::video::S3DVertex>>::operator[](const unsigned __int64 _Pos) Line 1565  C++
#02  minetest.exe!irr::core::array<irr::video::S3DVertex>::pointer() Line 231  C++
#03  minetest.exe!irr::scene::CMeshBuffer<irr::video::S3DVertex>::getVertices() Line 62  C++
#04  minetest.exe!irr::scene::CMeshBuffer<irr::video::S3DVertex>::append(const void * const vertices, unsigned int numVertices, const unsigned short * const indices, unsigned int numIndices) Line 188  C++
#05  minetest.exe!createExtrusionMesh(int resolution_x, int resolution_y) Line 70  C++
#06  minetest.exe!ExtrusionMeshCache::ExtrusionMeshCache() Line 144  C++
#07  minetest.exe!WieldMeshSceneNode::WieldMeshSceneNode(irr::scene::ISceneManager * mgr, int id, bool lighting) Line 210  C++
#08  minetest.exe!Camera::Camera(MapDrawControl & draw_control, Client * client, RenderingEngine * rendering_engine) Line 65  C++
#09  minetest.exe!Game::createClient(const GameStartData & start_data) Line 1355  C++
#10  minetest.exe!Game::startup(bool * kill, InputHandler * input, RenderingEngine * rendering_engine, const GameStartData & start_data, std::string & error_message, bool * reconnect, ChatBackend * chat_backend) Line 1057  C++
#11  minetest.exe!the_game(bool * kill, InputHandler * input, RenderingEngine * rendering_engine, const GameStartData & start_data, std::string & error_message, ChatBackend & chat_backend, bool * reconnect_requested) Line 4356  C++
#12  minetest.exe!ClientLauncher::run(GameStartData & start_data, const Settings & cmd_args) Line 264  C++
#13  minetest.exe!main(int argc, char * * argv) Line 250  C++
#14  [External Code]

SDL2 header not found on Mac OS

The header includes <SDL2/SDL.h> and this seemed to work for me on Debian Linux, but maybe I didn't enable SDL2 correctly. The Discord user who reported the issue confirmed that the include path CMake sets points directly to the SDL2 directory, which would explain why this include doesn't work.

Avoid installing system-wide when using with older MT versions or other software

Doing so might cause incompatibilities with other software that depends on the original version. Also some package managers might even overwrite such version or the wrong version might be used if installed on different location. It might also cause bugs if different library is loaded instead of expected one and not doing a global installation this might be avoided.

Native wayland support

Sometimes when I start an X11 app on my computer, xwayland stops working. While we are thinking about how to solve this issue, why don't we think about how to port Minetest (and Irrlicht) to Wayland?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.