Southclaws / sampctl

The Swiss Army Knife of SA:MP - vital tools for any server owner or library maintainer.
GNU General Public License v3.0
242 stars 33 forks source link

sampctl run -> run time error: invalid memory address or nil pointer dereference #493

Closed cristiifrim closed 1 year ago

cristiifrim commented 1 year ago

When I use sampctl run ( i use sampctl 1.11.0) i get this error message in main runtime mode

OS: Fedora WS 37

Edit: downgrading to 1.10.0 seems to fix it

pawn.json:

    "runtime": {
        "version": "0.3.7",
        "mode": "main",
        "rcon_password": "password",
        "port": 7777,
        "hostname": "SA-MP Server",
        "maxplayers": 50,
        "language": "",
        "mapname": "San Andreas",
        "weburl": "www.sa-mp.com",
        "gamemodetext": "Unknown",
        "announce": true,
        "lanmode": false,
        "query": true,
        "rcon": false,
        "logqueries": false,
        "sleep": 5,
        "maxnpc": 0,
        "stream_rate": 1000,
        "stream_distance": 200,
        "onfoot_rate": 30,
        "incar_rate": 30,
        "weapon_rate": 30,
        "chatlogging": true,
        "timestamp": true,
        "messageholelimit": 3000,
        "messageslimit": 500,
        "ackslimit": 3000,
        "playertimeout": 10000,
        "minconnectiontime": 0,
        "lagcompmode": 1,
        "connseedtime": 300000,
        "db_logging": false,
        "db_log_queries": false,
        "conncookies": true,
        "cookielogging": false,
        "output": true
    },
    "builds": [
        {
            "name": "dev",
            "version": "3.10.10",
            "args": [
                "-;+",
                "-(+",
                "-d3",
                "-E",
                "-Z"
            ],
            "includes": [
                "gamemodes/utils",
                "gamemodes/core",
                "gamemodes/core/mysql"
            ],
            "compiler": {}
        }
    ]
}

Error message:

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x50 pc=0x85fa602]

goroutine 1 [running]:
github.com/Southclaws/sampctl/runtime.dorun({0x881e0e0, 0xa8aa000}, {0xaf54080, 0x33}, {0xad347e8, 0x4}, 0x0, {0x881b66c, 0xa89e0d8}, {0x881b644, ...})
    /home/runner/work/sampctl/sampctl/runtime/run.go:128 +0x782
github.com/Southclaws/sampctl/runtime.Run({0x881e0e0, 0xa8aa000}, {{0xa81c3f0, 0x29}, {0x871f573, 0x5}, 0x0, {0x8818b0c, 0x6}, {0xa8fa600, ...}, ...}, ...)
    /home/runner/work/sampctl/sampctl/runtime/run.go:60 +0x28f
github.com/Southclaws/sampctl/pkgcontext.(*PackageContext).Run(0xac25200, {0x881e0e0, 0xa8aa000}, {0x881b66c, 0xa89e0d8}, {0x881b644, 0xa89e0d0})
    /home/runner/work/sampctl/sampctl/pkgcontext/run.go:31 +0x10b
github.com/Southclaws/sampctl/commands.packageRun(0xa8f2370)
    /home/runner/work/sampctl/sampctl/commands/package_run.go:96 +0x52a
gopkg.in/urfave/cli%2ev1.HandleAction({0x867b0a0, 0x87518f8}, 0xa8f2370)
    /home/runner/go/pkg/mod/gopkg.in/urfave/cli.v1@v1.20.0/app.go:490 +0x63
gopkg.in/urfave/cli%2ev1.Command.Run({{0x871ec4e, 0x3}, {0x0, 0x0}, {0x0, 0x0, 0x0}, {0x8722873, 0xb}, {0x0, ...}, ...}, ...)
    /home/runner/go/pkg/mod/gopkg.in/urfave/cli.v1@v1.20.0/command.go:210 +0x910
gopkg.in/urfave/cli%2ev1.(*App).Run(0xae5c000, {0xa8a8000, 0x2, 0x2})
    /home/runner/go/pkg/mod/gopkg.in/urfave/cli.v1@v1.20.0/app.go:255 +0x7d6
github.com/Southclaws/sampctl/commands.Run({0xa8a8000, 0x2, 0x2}, {0x8818b0c, 0x6})
    /home/runner/work/sampctl/sampctl/commands/app.go:273 +0x1659
main.main()
    /home/runner/work/sampctl/sampctl/main.go:15 +0x4f
TonyD3x commented 1 year ago

The solution was easier than I thought, just delete the %appdata%/sampctl folder... And this will solve the problem.

🐺

ADRFranklin commented 1 year ago

You should be posting your entire pawn.json file, not just part of it.. It's possible some file or executable has moved or been modified so it no longer works, or you are missing core os libraries to run it.

ADRFranklin commented 1 year ago

Should be fixed in the latest version, if not please re-open this issue