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

strlen() expects parameter 1 to be string? #1076

Closed
HipsterAF opened this issue Jun 12, 2017 · 7 comments
Closed

strlen() expects parameter 1 to be string? #1076

HipsterAF opened this issue Jun 12, 2017 · 7 comments
Labels
Category: Core Related to internal functionality Status: Unconfirmed Bug has not yet been reproduced by a maintainer

Comments

@HipsterAF
Copy link

HipsterAF commented Jun 12, 2017

Issue description

spam on server console
12.06 01:21:10 [Server] INFO [01:21:10] [Server thread/CRITICAL]: TypeError: "strlen() expects parameter 1 to be string, boolean given" (EXCEPTION) in "/src/pocketmine/network/mcpe/protocol/BatchPacket" at line 89

Steps to reproduce the issue

  1. ...
  2. ...

OS and versions

  • PocketMine-MP: 433b836
  • PHP: 7.0.19
  • Server OS: Linux
  • Game version: McPE v1.1

Plugins

  • Test on a clean server without plugins: is the issue reproducible without any plugins loaded? Yes

If the issue is not reproducible without plugins:

  • Have you asked for help on our forums before creating an issue?
  • Can you provide sample, minimal reproducing code for the issue? If so, paste it in the bottom section
  • Paste your list of plugins here (use the 'plugins' command in PocketMine-MP)

Crashdump, backtrace or other files

  • ...
@dktapps
Copy link
Member

dktapps commented Jun 12, 2017

Once again... please enable debug and paste a stack trace or provide reproducing steps. This issue is not useful.

@HipsterAF
Copy link
Author

HipsterAF commented Jun 12, 2017

12.06 01:37:26 [Server] INFO [01:37:26] [Server thread/DEBUG]: #11 (1): require_once(string phar:///PocketMine-MP.phar/src/pocketmine/PocketMine.php)
12.06 01:37:26 [Server] INFO [01:37:26] [Server thread/DEBUG]: #10 /src/pocketmine/PocketMine(468): pocketmine\Server->__construct(BaseClassLoader object, pocketmine\utils\MainLogger object, string phar:///PocketMine-MP.phar/, string /, string /plugins/, string unknown)
12.06 01:37:26 [Server] INFO [01:37:26] [Server thread/DEBUG]: #9 /src/pocketmine/Server(1715): pocketmine\Server->start(boolean)
12.06 01:37:26 [Server] INFO [01:37:26] [Server thread/DEBUG]: #8 /src/pocketmine/Server(2130): pocketmine\Server->tickProcessor(boolean)
12.06 01:37:26 [Server] INFO [01:37:26] [Server thread/DEBUG]: #7 /src/pocketmine/Server(2248): pocketmine\Server->tick(boolean)
12.06 01:37:26 [Server] INFO [01:37:26] [Server thread/DEBUG]: #6 /src/pocketmine/Server(2471): pocketmine\network\Network->processInterfaces(boolean)
12.06 01:37:26 [Server] INFO [01:37:26] [Server thread/DEBUG]: #5 /src/pocketmine/network/Network(174): pocketmine\network\mcpe\RakLibInterface->process(boolean)
12.06 01:37:26 [Server] INFO [01:37:26] [Server thread/DEBUG]: #4 /src/pocketmine/network/mcpe/RakLibInterface(81): raklib\server\ServerHandler->handlePacket(boolean)
12.06 01:37:26 [Server] INFO [01:37:26] [Server thread/DEBUG]: #3 /src/raklib/server/ServerHandler(99): pocketmine\network\mcpe\RakLibInterface->handleEncapsulated(string 49.144.190.194:19132, raklib\protocol\EncapsulatedPacket object, integer 0)
12.06 01:37:26 [Server] INFO [01:37:26] [Server thread/DEBUG]: #2 /src/pocketmine/network/mcpe/RakLibInterface(138): pocketmine\Player->handleDataPacket(pocketmine\network\mcpe\protocol\BatchPacket object)
12.06 01:37:26 [Server] INFO [01:37:26] [Server thread/DEBUG]: #1 /src/pocketmine/Player(3383): pocketmine\network\mcpe\protocol\BatchPacket->handle(pocketmine\Player object)
12.06 01:37:26 [Server] INFO [01:37:26] [Server thread/DEBUG]: #0 /src/pocketmine/network/mcpe/protocol/BatchPacket(89): strlen(boolean )
12.06 01:37:26 [Server] INFO [01:37:26] [Server thread/CRITICAL]: TypeError: "strlen() expects parameter 1 to be string, boolean given" (EXCEPTION) in "/src/pocketmine/network/mcpe/protocol/BatchPacket" at line 89

@dktapps
Copy link
Member

dktapps commented Jun 12, 2017

By my eyes this is impossible, since an exception will be thrown before the code gets that far. Are you sure your local server is running un-modified PocketMine-MP?

@dktapps dktapps added Category: Core Related to internal functionality Status: Unconfirmed Bug has not yet been reproduced by a maintainer labels Jun 12, 2017
@Awzaw
Copy link

Awzaw commented Jun 12, 2017

It seems zlib_decode returns false on failure

@dktapps
Copy link
Member

dktapps commented Jun 12, 2017

@Awzaw I'm aware of that... and if you look at the PHP bindings' source code, you also see that it raises an E_WARNING when failure occurs, which is now converted into an ErrorException by the core code. That means that this issue is impossible unless the source of the target server was modified.

@HipsterAF HipsterAF changed the title strlen() expects to be parameter? strlen() expects parameter 1 to be string? Jun 12, 2017
@HipsterAF
Copy link
Author

i think it happens when someone tries to join server with an old client

@dktapps
Copy link
Member

dktapps commented Jun 12, 2017

I just tested with an older client and it simply doesn't handle the packet. Once again:

this issue is impossible unless the source code of the target server was modified.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Category: Core Related to internal functionality Status: Unconfirmed Bug has not yet been reproduced by a maintainer
Projects
None yet
Development

No branches or pull requests

3 participants