Skip to content

API: Cuberite crashes under Windows 11 when player functions are called #5594

@Seadragon91

Description

@Seadragon91

Client version: 1.12.2
Server OS: Windows 11
Cuberite Commit id: 4b2b02a

Expected behavior

A bad API call should not crash the server.

Actual behavior

Server crashes when this function is called:
a_Player:SendMessageFailure(true)

Steps to reproduce the behavior

Run this plugin:

function Initialize(a_Plugin)
        g_Plugin = a_Plugin
        a_Plugin:SetName("TestPlugin")
        a_Plugin:SetVersion(1)

        cPluginManager.BindCommand("/testit", "", CmdTestIt, " - testit")
        return true
end

function CmdTestIt(a_Split, a_Player)
        a_Player:SendMessageFailure(true)
        a_Player:SendMessage("Command run")
        return true
end

Server log

[20:43:18] Player Seadragon91 is executing command "/testit" in world "world" at world age 1149.
[20:43:18] LUA: Plugins\TestPlugin/TestPlugin.lua:11: error in function 'SendMessageFailure'.
     argument #2 is 'boolean'; 'string' expected.

[20:43:18] Stack trace:
[20:43:18]   [C](-1): SendMessageFailure
[20:43:18]   Plugins\TestPlugin/TestPlugin.lua(11): (no name)
[20:43:18] Stack trace end

Hello long time no see :)

Started testing my Plugin APIFuzzing and got many crashes.
I think the cause for most of them is the same.
Bisected the cause down to this commit: 7b8f6eb

When I run the plugin under Linux, no crash occurs I only see the output above.
Under windows after the output the server crashes.
Not sure if that is a problem only under windows 11. I don't have windows 10 anymore.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions