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

logger -> slice bounds out of range #350

Closed
rurirei opened this issue Mar 8, 2021 · 1 comment
Closed

logger -> slice bounds out of range #350

rurirei opened this issue Mar 8, 2021 · 1 comment

Comments

@rurirei
Copy link
Contributor

rurirei commented Mar 8, 2021

met this on each loglevel except error or none

[Debug] app/log: Logger started
[Info] transport/internet/tcp: listening TCP on 127.0.0.1:1080

panic: runtime error: slice bounds out of range [15:14]

goroutine 22 [running]:

github.com/xtls/xray-core/common/errors.(*Error).pkgPath(0x400085e660, 0x7de8b8cae8, 0x400009c060)

/home/runner/go/src/github.com/xtls/xray-core/common/errors/errors.go:45 +0xcc

github.com/xtls/xray-core/common/errors.(*Error).Error(0x400085e660, 0x7de96a7c20, 0x1)

/home/runner/go/src/github.com/xtls/xray-core/common/errors/errors.go:60 +0x194

github.com/xtls/xray-core/common/errors.(*Error).String(0x400085e660, 0x7de96a7c20, 0x400085e660)

/home/runner/go/src/github.com/xtls/xray-core/common/errors/errors.go:132 +0x20

github.com/xtls/xray-core/common/serial.ToString(0x7de96a7c20, 0x400085e660, 0x2, 0x8)

/home/runner/go/src/github.com/xtls/xray-core/common/serial/string.go:20 +0x14

github.com/xtls/xray-core/common/serial.Concat(0x4000068e48, 0x4, 0x4, 0x7de8cff9dc, 0x4000860050)

/home/runner/go/src/github.com/xtls/xray-core/common/serial/string.go:32 +0x60

github.com/xtls/xray-core/common/log.(*GeneralMessage).String(0x4000375de0, 0x4000068ef0, 0x3)

/home/runner/go/src/github.com/xtls/xray-core/common/log/log.go:27 +0xa4

github.com/xtls/xray-core/common/log.(*generalLogger).run(0x4000c00fa0)

github.com/xtls/xray-core/common/log.(*generalLogger).run(0x4000c00fa0)

created by github.com/xtls/xray-core/common/log.(*generalLogger).Handle

/home/runner/go/src/github.com/xtls/xray-core/common/log/logger.go:77 +0x8c

func (err *Error) pkgPath() string {
if err.pathObj == nil {
return ""
}
path := reflect.TypeOf(err.pathObj).PkgPath()
for i := 0; i < len(path); i++ {
if path[i] == '/' {
return path[trim:]
}
}
return path
}

{
  "log": {
    "loglevel": "debug"  // except error or none to no panic
  },
  "inbounds": [
    {
      "listen": "127.0.0.1",
      "port": 1080,
      "protocol": "socks",
      "settings": {
        "auth": "noauth",
        "udp": true
      },
      "sniffing": {
        "destOverride": [
          "http",
          "tls"
        ],
        "enabled": true
      }
    }
  ],
  "outbounds": [
    {
      "protocol": "shadowsocks",
      "settings": {
        "servers": [
          ...
        ]
      },
      "streamSettings": {
        "network": "tcp",
        "security": "none"
      },
      "tag": "proxy"
    }
  ],
  "routing": {
    "domainStrategy": "AsIs",
    "rules": []
  },
  "stats": {}
}
@RPRX RPRX closed this as completed in 3de5af0 Mar 8, 2021
@RPRX
Copy link
Member

RPRX commented Mar 8, 2021

请测试 3de5af0

mwhorse46 added a commit to mwhorse46/Xray-core that referenced this issue Feb 19, 2023
rampagekiller0725 added a commit to rampagekiller0725/wox that referenced this issue Jun 29, 2023
Autumn216 added a commit to Autumn216/wox that referenced this issue Oct 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants