nxtrace / NTrace-core

NextTrace, an open source visual route tracking CLI tool
https://www.nxtrace.org
GNU General Public License v3.0
5.76k stars 340 forks source link

执行命令出现 panic: runtime error: index out of range [0] with length 0 异常 #246

Closed sakullla closed 4 months ago

sakullla commented 5 months ago

本项目是基于Linux/macOS的,请确认您遇到的问题是否在Linux或macOS上存在。

你正在使用哪个版本的 nexttrace?

NextTrace v1.3.1 2024-05-31T02:04:05Z f303397

你看到的异常现象是什么?

执行命令出现 panic: runtime error: index out of range [0] with length 0 异常

你期待看到的正常表现是怎样的?

可以正常执行命令

请附上你的命令

nexttrace 1.1.1.1 -T --psize 10485760

请附上出错时软件输出的错误信息

NextTrace v1.3.1 2024-05-31T02:04:05Z f303397 [NextTrace API] preferred API IP - 104.21.40.176 - 222.49ms - Misaka.LAX IP Geo Data Provider: LeoMoeAPI traceroute to 1.1.1.1, 30 hops max, 10485760 bytes payload 1 panic: runtime error: index out of range [0] with length 0

goroutine 1 [running]: github.com/nxtrace/NTrace-core/printer.RealtimePrinter(0xc0003300c8, 0x0) github.com/nxtrace/NTrace-core/printer/realtime_printer.go:19 +0x3097 github.com/nxtrace/NTrace-core/trace.(*TCPTracer).Execute(0xc000330000) github.com/nxtrace/NTrace-core/trace/tcp_ipv4.go:88 +0x4e5 github.com/nxtrace/NTrace-core/trace.Traceroute({0x8da803?, 0x40e43b?}, {{0x0, 0x0}, 0x1, 0x1e, 0x3, 0x12, 0x3b9aca00, {0xc0000123f0, ...}, ...}) github.com/nxtrace/NTrace-core/trace/trace.go:98 +0x222 github.com/nxtrace/NTrace-core/cmd.Excute() github.com/nxtrace/NTrace-core/cmd/cmd.go:320 +0x1e8c main.main() github.com/nxtrace/NTrace-core/main.go:8 +0xf

是否查询过本仓库wiki有没有类似错误

未发现类似错误

tsosunchia commented 4 months ago

大于MTU就没啥意义了,会被fragment

tsosunchia commented 4 months ago

在实践中建议--psize不要设置为大于1400

PS: psize指的是payload大小 单位是byte

sakullla commented 4 months ago

好的