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

Crash sing-box check command #2544

Open
4 of 5 tasks
a-sv opened this issue Feb 5, 2025 · 0 comments
Open
4 of 5 tasks

Crash sing-box check command #2544

a-sv opened this issue Feb 5, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@a-sv
Copy link

a-sv commented Feb 5, 2025

Operating system

Linux

System version

Gentoo x86_64, Armbian v24.11.1 (arm64)

Installation type

Original sing-box Command Line

If you are using a graphical client, please provide the version of the client.

No response

Version

1.11.1

Description

Program crash when i run sing-box check command without root privileges.

$ ./sing-box check -c config.json 
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0x8c3abe]

goroutine 1 [running]:
github.com/sagernet/sing-box/log.(*observableLogger).Log(0xc000011e00, {0x1854ba0, 0x235bf80}, 0x85?, {0xc00012a000, 0x2, 0x2})
        github.com/sagernet/sing-box/log/observable.go:133 +0x45e
github.com/sagernet/sing-box/log.(*observableLogger).DebugContext(...)
        github.com/sagernet/sing-box/log/observable.go:176
github.com/sagernet/sing-box/log.(*observableLogger).Debug(0xc0001c00f0?, {0xc00012a000?, 0x163123d?, 0x10?})
        github.com/sagernet/sing-box/log/observable.go:148 +0x35
github.com/sagernet/sing-tun.NewAutoRedirect({0xc000207580, {0x1854c10, 0xc0001a03c0}, {0x1841540, 0xc000207508}, {0x7f17bd0dbd18, 0xc000011e00}, {0x1855ab8, 0xc0000acd80}, {0x18585a0, ...}, ...})
        github.com/sagernet/[email protected]/redirect_linux.go:85 +0x298
github.com/sagernet/sing-box/protocol/tun.NewInbound({_, _}, {_, _}, {_, _}, {_, _}, {{0x0, 0x0}, ...})
        github.com/sagernet/sing-box/protocol/tun/inbound.go:233 +0x2538
github.com/sagernet/sing-box/adapter/inbound.Register[...].func2({0x1869510?, 0xc000228000?}, {0x1867168?, 0xc000011e00?}, {0x1650fc0?, 0x0?}, {0x133dfc0, 0xc0000e5408})
        github.com/sagernet/sing-box/adapter/inbound/registry.go:23 +0x17c
github.com/sagernet/sing-box/adapter/inbound.(*Registry).Create(0xaae1f2?, {0x1854c10, 0xc0001a03c0}, {0x1869510, 0xc000228000}, {0x1867168, 0xc000011e00}, {0x1650fc0, 0x1}, {0xc000205714, ...}, ...)
        github.com/sagernet/sing-box/adapter/inbound/registry.go:64 +0x247
github.com/sagernet/sing-box/adapter/inbound.(*Manager).Create(0xc0000accc0, {0x1854c10?, 0xc0001a03c0?}, {0x1869510?, 0xc000228000?}, {0x1867168?, 0xc000011e00?}, {0x1650fc0, 0x1}, {0xc000205714, ...}, ...)
        github.com/sagernet/sing-box/adapter/inbound/manager.go:116 +0xc2
github.com/sagernet/sing-box.New({{{0xc0001cec00, 0x9b, 0x200}, {0x0, 0x0}, 0xc0001fbcb0, 0x0, 0x0, {0x0, 0x0, ...}, ...}, ...})
        github.com/sagernet/sing-box/box.go:186 +0x1685
main.check()
        github.com/sagernet/sing-box/cmd/sing-box/cmd_check.go:34 +0x1a5
main.init.func1(0xc0001fe000?, {0xc0000aaea0?, 0x4?, 0x1625db5?})
        github.com/sagernet/sing-box/cmd/sing-box/cmd_check.go:16 +0x17
github.com/spf13/cobra.(*Command).execute(0x2328c80, {0xc0000aae80, 0x2, 0x2})
        github.com/spf13/[email protected]/command.go:989 +0xa91
github.com/spf13/cobra.(*Command).ExecuteC(0x23289a0)
        github.com/spf13/[email protected]/command.go:1117 +0x3ff
github.com/spf13/cobra.(*Command).Execute(...)
        github.com/spf13/[email protected]/command.go:1041
main.main()
        github.com/sagernet/sing-box/cmd/sing-box/main.go:8 +0x1e

Reproduction

Run sing-box check -c config.json without root privileges.

Minimal config file for reproduce:

{
  "log": {
    "output": "sing-box.log"
  },
  "inbounds": [
    {
      "type": "tun",
      "auto_route": true,
      "auto_redirect": true
    }
  ]
}

Logs

Supporter

Integrity requirements

  • I confirm that I have read the documentation, understand the meaning of all the configuration items I wrote, and did not pile up seemingly useful options or default values.
  • I confirm that I have provided the server and client configuration files and process that can be reproduced locally, instead of a complicated client configuration file that has been stripped of sensitive data.
  • I confirm that I have provided the simplest configuration that can be used to reproduce the error I reported, instead of depending on remote servers, TUN, graphical interface clients, or other closed-source software.
  • I confirm that I have provided the complete configuration files and logs, rather than just providing parts I think are useful out of confidence in my own intelligence.
@nekohasekai nekohasekai added the bug Something isn't working label Feb 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants