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

if you request a ping again, the application crashes #43

Closed
dukker11 opened this issue Oct 5, 2024 · 1 comment
Closed

if you request a ping again, the application crashes #43

dukker11 opened this issue Oct 5, 2024 · 1 comment

Comments

@dukker11
Copy link

dukker11 commented Oct 5, 2024

if you request a ping again, the application crashes

Write LOG:

2024/10/03 21:20:23 Reuse of exported var name: stats
2024/10/03 21:20:23 Reuse of exported var name: stats
panic: Reuse of exported var name: stats
goroutine 17 [running, locked to thread]:
log.Panicln({0x1300599d0?, 0x5?, 0x1303a4f80?})
/opt/homebrew/Cellar/go/1.23.1/libexec/src/log/log.go:446 +0x60
expvar.Publish({0x1061f6604, 0x5}, {0x106706080, 0x1303a4f70})
/opt/homebrew/Cellar/go/1.23.1/libexec/src/expvar/expvar.go:311 +0xbc
github.com/xtls/xray-core/app/metrics.NewMetricsHandler({0x1067150e8, 0x12b548f30}, 0x1301347c0)
/Users/pan/go/pkg/mod/github.com/xtls/xray-core@v1.8.24/app/metrics/metrics.go:38 +0x10c
github.com/xtls/xray-core/app/metrics.init.1.func1({0x1067150e8?, 0x12b548f30?}, {0x1065cef20?, 0x1301347c0?})
/Users/pan/go/pkg/mod/github.com/xtls/xray-core@v1.8.24/app/metrics/metrics.go:117 +0x40
github.com/xtls/xray-core/common.CreateObject({0x1067150e8, 0x12b548f30}, {0x1065cef20, 0x1301347c0})
/Users/pan/go/pkg/mod/github.com/xtls/xray-core@v1.8.24/common/type.go:32 +0x148
github.com/xtls/xray-core/core.CreateObject(0x1301dabe0?, {0x1065cef20?, 0x1301347c0?})
/Users/pan/go/pkg/mod/github.com/xtls/xray-core@v1.8.24/core/functions.go:21 +0x68
github.com/xtls/xray-core/core.initInstanceWithConfig(0x13027eb40, 0x1301db3b0)
/Users/pan/go/pkg/mod/github.com/xtls/xray-core@v1.8.24/core/xray.go:200 +0x23c
github.com/xtls/xray-core/core.New(0x13027eb40)
/Users/pan/go/pkg/mod/github.com/xtls/xray-core@v1.8.24/core/xray.go:165 +0x50
github.com/xtls/libxray/xray.StartXray({0x130052660, 0x5f})
/Users/pan/xrayGo/libXray/xray/xray.go:24 +0x88
github.com/xtls/libxray/xray.Ping({0x0?, 0xcb?}, {0x130052660, 0x5f}, 0x1e, {0x1303cc018, 0x16}, {0x1303cc000, 0x18})
/Users/pan/xrayGo/libXray/xray/ping.go:15 +0x78
github.com/xtls/libxray.Ping({0x12b508000?, 0x110?})
/Users/pan/xrayGo/libXray/xray_wrapper.go:54 +0xd4
main.proxylibXray__Ping({0x125d16080, 0x110, {0x0, 0x0, 0x0, 0x0}})
/private/var/folders/5s/87f50tbn7lx74t9vdb75l4440000gn/T/gomobile-work-2592949271/ios/src-arm64/gobind/go_libXraymain.go:68 +0x2c
@yiguous
Copy link
Collaborator

yiguous commented Oct 8, 2024

Because of the upstream, which is expvar, there is no way to solve this problem, you can reference its document.
So here is my suggestion.

  1. Do not enable "metrics" when ping and testing.
  2. Use another process, like child process, to run xray instance if you need enable metrics.

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