Fatal error when calling roomIDReq() #2

Open
opened 2024-01-29 05:47:19 -05:00 by bonkmaykr · 0 comments
Owner

The subroutine which handles manual teleport commands is plagued with a crash bug when asking the server to join the chatroom associated with the destination world. Cause is currently unknown, but the crash doesn't happen until the receiver thread has received the new room confirmation from the server and not when the network packet is actually sent (we know this because the teleportation actually succeeds just before the crash) so chances are likely it's part of Wirla's old code..

// teleport using a markEntry loaded from the database
void handleTeleportRequest(internalTypes::markEntry details) {
	std::cout << "info: delaying teleport by 1000ms to avoid race condition\n";
	sleep(1);

	std::cout << "info: requesting to join room \"" + details.room + "\"\n";
	roomIDReq(&roomsock, details.room); //fatal error
	room = details.room;

	std::cout << "info: setting position at " +
		std::to_string(details.position.x) + ", " +
		std::to_string(details.position.y) + ", " +
		std::to_string(details.position.z) + ", " +
		std::to_string(details.position.yaw) + "\n";
	teleport(&roomsock, xPos, yPos, zPos, direction); // force positional update immediately
	xPos = details.position.x; // remember so that the idle thread doesn't rubberband us
	yPos = details.position.y;
	zPos = details.position.z;
	direction = details.position.yaw;

	std::cout << "info: updating goto destination\n";
	realLocation = details.url;

	std::cout << "info: done! initiating watchdog\n";
}

Console output:

info: Joining room atlantis#beach
info: Connected to RoomServer: 209.240.84.122:5673
terminate called without an active exception
Aborted (core dumped)
The subroutine which handles manual teleport commands is plagued with a crash bug when asking the server to join the chatroom associated with the destination world. Cause is currently unknown, but the crash doesn't happen until the receiver thread has received the new room confirmation from the server and not when the network packet is actually sent (we know this because the teleportation actually succeeds just before the crash) so chances are likely it's part of Wirla's old code.. ``` // teleport using a markEntry loaded from the database void handleTeleportRequest(internalTypes::markEntry details) { std::cout << "info: delaying teleport by 1000ms to avoid race condition\n"; sleep(1); std::cout << "info: requesting to join room \"" + details.room + "\"\n"; roomIDReq(&roomsock, details.room); //fatal error room = details.room; std::cout << "info: setting position at " + std::to_string(details.position.x) + ", " + std::to_string(details.position.y) + ", " + std::to_string(details.position.z) + ", " + std::to_string(details.position.yaw) + "\n"; teleport(&roomsock, xPos, yPos, zPos, direction); // force positional update immediately xPos = details.position.x; // remember so that the idle thread doesn't rubberband us yPos = details.position.y; zPos = details.position.z; direction = details.position.yaw; std::cout << "info: updating goto destination\n"; realLocation = details.url; std::cout << "info: done! initiating watchdog\n"; } ``` Console output: ``` info: Joining room atlantis#beach info: Connected to RoomServer: 209.240.84.122:5673 terminate called without an active exception Aborted (core dumped) ```
bonkmaykr added the
bug
roadblock
labels 2024-01-29 05:47:19 -05:00
Sign in to join this conversation.
No description provided.