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

Blocks at Resolving address... #12172

Closed
bugbuka opened this issue Apr 4, 2022 · 16 comments · Fixed by #12409
Closed

Blocks at Resolving address... #12172

bugbuka opened this issue Apr 4, 2022 · 16 comments · Fixed by #12409
Labels
Bug Issues that were confirmed to be a bug @ Build CMake, build scripts, official builds, compiler and linker errors macOS

Comments

@bugbuka
Copy link

bugbuka commented Apr 4, 2022

Minetest version
5.5.0
OS / Hardware

Operating system: macOS Monterey
CPU: intel

GPU model: AMD 5300

Summary

Screen Shot 2022-04-04 at 20 00 17

@bugbuka bugbuka added the Unconfirmed bug Bug report that has not been confirmed to exist/be reproducible label Apr 4, 2022
@sfan5
Copy link
Member

sfan5 commented Apr 4, 2022

Can you retest with --verbose --trace and post the log here?
Do you know if applications need special permissions for network access on macOS?

@bugbuka
Copy link
Author

bugbuka commented Apr 5, 2022

verbose.log

here is the verbose log.
i do not know any special permissions for network access on monterey.

@SmallJoker
Copy link
Member

SmallJoker commented Apr 5, 2022

At L3920, "singleplayer" is recognized with the newest protocol version.

  1. TOSERVER_INIT is received by the server
  2. TOCLIENT_HELLO is sent by the server (length 0x25, reliable)
  3. Client: TOCLIENT_HELLO is processed in ConnectionReceiveThread::receive (ProcessPacket from peer_id: 1)
    • strips BASE_HEADER_SIZE (7)
    • ConnectionReceiveThread::processPacket finds PACKET_TYPE_RELIABLE
    • strips RELIABLE_HEADER_SIZE (3)
    • ConnectionReceiveThread::processPacket finds PACKET_TYPE_ORIGINAL
    • strips ORIGINAL_HEADER_SIZE (1)
    • Resulting bytes: 0x25 (OK)
  4. Client: The event should be put into the queue and later processed by Receive
  5. Client: Receive: got event: CONNEVENT_DATA_RECEIVED (in Connection::Receive) never appears.

TOCLIENT_HELLO seems to be eaten somewhere, but I cannot figure out why.

EDIT: Could it be that semaphore_timedwait does not like zero delays? Perhaps increasing the timeout to 1 ms could help.

@bugbuka
Copy link
Author

bugbuka commented Apr 6, 2022

wait_time_ms
semaphore.txt
after applying above change, , it does not work. result in the same error.

it seems like some kind of dead lock.

@bugbuka
Copy link
Author

bugbuka commented Apr 14, 2022

any feedback? this issue blocks me.

@SmallJoker
Copy link
Member

I kinda hoped that someone with some more knowledge about MacOS would jump in - which did not happen.

If this is really a deadlock, please run Minetest in gdb and Ctrl+C (break) once the game is stuck.

$ gdb minetest
r         -- literal to start the process
^C        -- Ctrl+C user input
bt full   -- print full backtrace

Optimally, there's one backtrace which points to a lock await.

@bugbuka
Copy link
Author

bugbuka commented Apr 14, 2022

MacBook-Pro:minetest tom$ gdb ./build/macos/minetest.app/Contents/MacOS/minetest
GNU gdb (GDB) 11.2
Copyright (C) 2022 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-apple-darwin21.1.0".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ./build/macos/minetest.app/Contents/MacOS/minetest...
(gdb) r
Starting program: /Users/tom/game/minetest-root/minetest/build/macos/minetest.app/Contents/MacOS/minetest
Unable to find Mach task port for process-id 84140: (os/kern) failure (0x5).
 (please check gdb is codesigned - see taskgated(8))
(gdb)

@SmallJoker
Copy link
Member

@bugbuka Sorry for the delay. I do not know why gdb does not work there but I had yet another idea: Might the packets be discarded silently, but for the wrong reason?

catch (ProcessedSilentlyException &e) {
}

Which log output do you get if you insert errorstream << e.what() << std::endl; into this catch block?

@Zughy Zughy added the Action / change needed Code still needs changes (PR) / more information requested (Issues) label Apr 30, 2022
@bugbuka
Copy link
Author

bugbuka commented May 2, 2022

Screen Shot 2022-05-02 at 19 28 46

run ./build/macos/minetest.app/Contents/MacOS/minetest

2022-05-02 19:25:06: [Main]: Automatically selecting world at [/Users/tom/Library/Application Support/minetest/worlds/w1]
2022-05-02 19:25:11: WARNING[Main]: \!/ Mod security should never be disabled, as it allows any mod to access the host machine.Mods should use minetest.request_insecure_environment() instead \!/
         __.               __.                 __.  
  _____ |__| ____   _____ /  |_  _____  _____ /  |_ 
 /     \|  |/    \ /  __ \    _\/  __ \/   __>    _\
|  Y Y  \  |   |  \   ___/|  | |   ___/\___  \|  |  
|__|_|  /  |___|  /\______>  |  \______>_____/|  |  
      \/ \/     \/         \/                  \/   
2022-05-02 19:25:12: ACTION[Main]: World at [/Users/tom/Library/Application Support/minetest/worlds/w1]
2022-05-02 19:25:12: ACTION[Main]: Server for gameid="minetest" listening on 0.0.0.0:57221.
2022-05-02 19:25:12: ERROR[ConnectionReceive]: Got a SET_PEER_ID
2022-05-02 19:25:12: ERROR[ConnectionReceive]: Got a SET_PEER_IDGot an ACK
2022-05-02 19:25:12: ERROR[ConnectionReceive]: Got an ACK
2022-05-02 19:25:17: ERROR[ConnectionReceive]: Got a PING
2022-05-02 19:25:17: ERROR[ConnectionReceive]: Got an ACK
2022-05-02 19:25:17: ERROR[ConnectionReceive]: Got a PING
2022-05-02 19:25:17: ERROR[ConnectionReceive]: Got a PINGGot an ACK
2022-05-02 19:25:22: ERROR[ConnectionReceive]: Got a PING
2022-05-02 19:25:22: ERROR[ConnectionReceive]: Got an ACK
2022-05-02 19:25:22: ERROR[ConnectionReceive]: Got a PING
2022-05-02 19:25:22: ERROR[ConnectionReceive]: Got a PINGGot an ACK
2022-05-02 19:25:27: ERROR[ConnectionReceive]: Got a PING
2022-05-02 19:25:27: ERROR[ConnectionReceive]: Got a PINGGot an ACK
2022-05-02 19:25:27: ERROR[ConnectionReceive]: Got a PING
2022-05-02 19:25:27: ERROR[ConnectionReceive]: Got an ACK
2022-05-02 19:25:32: ERROR[ConnectionReceive]: Got a PING
2022-05-02 19:25:32: ERROR[ConnectionReceive]: Got an ACK
2022-05-02 19:25:32: ERROR[ConnectionReceive]: Got a PING
2022-05-02 19:25:32: ERROR[ConnectionReceive]: Got an ACK
2022-05-02 19:25:37: ERROR[ConnectionReceive]: Got a PING
2022-05-02 19:25:37: ERROR[ConnectionReceive]: Got a PINGGot an ACK
2022-05-02 19:25:37: ERROR[ConnectionReceive]: Got a PING
2022-05-02 19:25:37: ERROR[ConnectionReceive]: Got an ACK
2022-05-02 19:25:42: ERROR[ConnectionReceive]: Got a PING
2022-05-02 19:25:42: ERROR[ConnectionReceive]: Got an ACK
2022-05-02 19:25:42: ERROR[ConnectionReceive]: Got a PING
2022-05-02 19:25:42: ERROR[ConnectionReceive]: Got an ACK
2022-05-02 19:25:47: ERROR[ConnectionReceive]: Got a PING
2022-05-02 19:25:47: ERROR[ConnectionReceive]: Got an ACK
2022-05-02 19:25:47: ERROR[ConnectionReceive]: Got a PING
2022-05-02 19:25:47: ERROR[ConnectionReceive]: Got an ACK
2022-05-02 19:25:52: ERROR[ConnectionReceive]: Got a PING
2022-05-02 19:25:52: ERROR[ConnectionReceive]: Got an ACK
2022-05-02 19:25:52: ERROR[ConnectionReceive]: Got a PING
2022-05-02 19:25:52: ERROR[ConnectionReceive]: Got an ACK
2022-05-02 19:25:57: ERROR[ConnectionReceive]: Got a PING
2022-05-02 19:25:57: ERROR[ConnectionReceive]: Got an ACK
2022-05-02 19:25:57: ERROR[ConnectionReceive]: Got a PING
2022-05-02 19:25:57: ERROR[ConnectionReceive]: Got an ACK
2022-05-02 19:26:02: ERROR[ConnectionReceive]: Got a PING
2022-05-02 19:26:02: ERROR[ConnectionReceive]: Got an ACK
2022-05-02 19:26:02: ERROR[ConnectionReceive]: Got a PING
2022-05-02 19:26:02: ERROR[ConnectionReceive]: Got an ACK
2022-05-02 19:26:07: ERROR[ConnectionReceive]: Got a PING
2022-05-02 19:26:07: ERROR[ConnectionReceive]: Got an ACK
2022-05-02 19:26:07: ERROR[ConnectionReceive]: Got a PING
2022-05-02 19:26:07: ERROR[ConnectionReceive]: Got an ACK
2022-05-02 19:26:12: ERROR[ConnectionReceive]: Got a PING
2022-05-02 19:26:12: ERROR[ConnectionReceive]: Got an ACK
2022-05-02 19:26:12: ERROR[ConnectionReceive]: Got a PING
2022-05-02 19:26:12: ERROR[ConnectionReceive]: Got an ACK
2022-05-02 19:26:17: ERROR[ConnectionReceive]: Got a PING
2022-05-02 19:26:17: ERROR[ConnectionReceive]: Got an ACK
2022-05-02 19:26:17: ERROR[ConnectionReceive]: Got a PING
2022-05-02 19:26:17: ERROR[ConnectionReceive]: Got an ACK
2022-05-02 19:26:22: ERROR[ConnectionReceive]: Got a PING
2022-05-02 19:26:22: ERROR[ConnectionReceive]: Got an ACK
2022-05-02 19:26:22: ERROR[ConnectionReceive]: Got a PING
2022-05-02 19:26:22: ERROR[ConnectionReceive]: Got an ACK
2022-05-02 19:26:27: ERROR[ConnectionReceive]: Got a PING
2022-05-02 19:26:27: ERROR[ConnectionReceive]: Got an ACK
2022-05-02 19:26:27: ERROR[ConnectionReceive]: Got a PING
2022-05-02 19:26:27: ERROR[ConnectionReceive]: Got an ACK
^C2022-05-02 19:26:29: [Main]: INFO: signal_handler(): Ctrl-C pressed, shutting down.
^C2022-05-02 19:26:31: ERROR[ConnectionReceive]: Got an ACK
2022-05-02 19:26:32: ERROR[ConnectionReceive]: Got a PING
2022-05-02 19:26:32: ERROR[ConnectionReceive]: Got an ACK
2022-05-02 19:26:32: ERROR[ConnectionReceive]: Got a PING
2022-05-02 19:26:32: ERROR[ConnectionReceive]: Got an ACK

@SmallJoker
Copy link
Member

That looks correct. My output looks as follows:

2022-05-02 20:39:19: ERROR[ConnectionReceive]: Got a SET_PEER_ID
2022-05-02 20:39:19: ERROR[ConnectionReceive]: Got a SET_PEER_IDGot an ACK                                                                                         
2022-05-02 20:39:19: ERROR[ConnectionReceive]: Got an ACK                                                                                                          
Unified Inventory. Inventory size: 409
2022-05-02 20:39:19: ERROR[ConnectionReceive]: Got an ACK
2022-05-02 20:39:19: ERROR[ConnectionReceive]: Got an ACK                                                                                                          
2022-05-02 20:39:19: ERROR[ConnectionReceive]: Got an ACK                                                                                                          
2022-05-02 20:39:19: ERROR[ConnectionReceive]: Got an ACK                                                                                                          
2022-05-02 20:39:19: ERROR[ConnectionReceive]: Got an ACK                                                                                                          
2022-05-02 20:39:19: ERROR[ConnectionReceive]: Got an ACK                                                                                                          
2022-05-02 20:39:19: ERROR[ConnectionReceive]: Buffered a split packet chunk                                                                                       
2022-05-02 20:39:19: ERROR[ConnectionReceive]: Buffered a split packet chunkGot an ACK                                                                             
2022-05-02 20:39:19: ERROR[ConnectionReceive]: Buffered a split packet chunk  

PING appears after approx. 4 seconds similar to your case.

To make sure: do you have any additional mods enabled? If so, does disabling them make a difference?

@bugbuka
Copy link
Author

bugbuka commented May 3, 2022

no, have no additional mods.

Screen.Recording.2022-05-03.at.11.05.30.mov

@bugbuka
Copy link
Author

bugbuka commented May 3, 2022

it is wield, it can work now. i do not know what changes make this work.

@bugbuka
Copy link
Author

bugbuka commented May 3, 2022

i re-compile all the source code, then run minetest with
./build/macos/minetest.app/Contents/MacOS/minetest
it blocks.

exit the game with ctrl + c, re-run the app, the blocks gone.

@Zughy Zughy added @ Build CMake, build scripts, official builds, compiler and linker errors and removed Action / change needed Code still needs changes (PR) / more information requested (Issues) labels May 3, 2022
@tmarcinkevicius
Copy link

Hey,

Is minetest 5.5.1 brew package still has this issue?
I tried it today. Freezes on “Resolving address..."

@Zughy Zughy added Bug Issues that were confirmed to be a bug and removed Unconfirmed bug Bug report that has not been confirmed to exist/be reproducible labels May 27, 2022
@paradust7
Copy link
Contributor

paradust7 commented Jun 5, 2022

Confirmed this is still a problem, and determined the reason.

The offending code is here:

#if defined(__MACH__) && defined(__APPLE__)
settings->setDefault("keymap_sneak", "KEY_SHIFT");
settings->setDefault("fps_max", "0");
#endif

Setting fps_max to 0 is incompatible with the way it is used:

minetest/src/client/game.cpp

Lines 4081 to 4084 in 381f84e

const u64 frametime_min = 1000000.0f / (
device->isWindowFocused() && !g_menumgr.pausesGame()
? g_settings->getFloat("fps_max")
: g_settings->getFloat("fps_max_unfocused"));

This is undefined behavior, causing frametime_min to overflow, so that the first sleep_ms() below blocks forever.

@paradust7
Copy link
Contributor

After fixing this, there's a new bug with the mouse movement. I'll work on fixing that too, and then getting it fixed on brew.

carlocab pushed a commit to paradust7/homebrew-core that referenced this issue Jun 7, 2022
Upstream regressions prevent minetest 5.5.1 from playing properly on MacOS:
minetest/minetest#12172
minetest/minetest#11541

This change applies patches that fix both issues.
Also updates the install message to clarify that
--server is not needed to start minetest.
BrewTestBot pushed a commit to Homebrew/homebrew-core that referenced this issue Jun 7, 2022
Upstream regressions prevent minetest 5.5.1 from playing properly on MacOS:
minetest/minetest#12172
minetest/minetest#11541

This change applies patches that fix both issues.
Also updates the install message to clarify that
--server is not needed to start minetest.

Closes #103097.

Signed-off-by: Carlo Cabrera <30379873+carlocab@users.noreply.github.com>
Signed-off-by: BrewTestBot <1589480+BrewTestBot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Issues that were confirmed to be a bug @ Build CMake, build scripts, official builds, compiler and linker errors macOS
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants