sing-box icon indicating copy to clipboard operation
sing-box copied to clipboard

panic: runtime error: invalid memory address or nil pointer dereference

Open XhstormR opened this issue 2 years ago • 1 comments

操作系统

macOS

系统版本

Darwin 23.3.0 x86_64 i386

安装类型

sing-box 原始命令行程序

如果您使用图形客户端程序,请提供该程序版本。

No response

版本

sing-box version 1.9.0-beta.5

Environment: go1.22.0 darwin/amd64
Tags: with_gvisor,with_quic,with_dhcp,with_wireguard,with_ech,with_utls,with_reality_server,with_acme,with_clash_api
Revision: 9f6233de0db9239b5310920b7bc8b2f06105fc88
CGO: disabled

描述

运行13小时后程序崩溃。

INFO[50312] [2531258277 0ms] inbound/mixed[0]: inbound connection from 127.0.0.1:54504
INFO[50312] [2531258277 0ms] inbound/mixed[0]: inbound connection to caserver.prod.internal:80
INFO[50312] [2531258277 0ms] outbound/trojan[悉尼]: outbound connection to caserver.prod.internal:80
INFO[50312] [806979673 0ms] inbound/mixed[0]: inbound connection from 127.0.0.1:54506
INFO[50312] [806979673 0ms] inbound/mixed[0]: inbound connection to caserver.prod.internal:80
INFO[50312] [806979673 0ms] outbound/trojan[悉尼]: outbound connection to caserver.prod.internal:80
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x66bf800]

goroutine 94704 [running]:
github.com/sagernet/sing/common/exceptions.(*multiError).Unwrap(0x80bf9e0?)
        github.com/sagernet/[email protected]/common/exceptions/multi.go:20
github.com/sagernet/sing/common/exceptions.Expand({0x77487a0, 0x0})
        github.com/sagernet/[email protected]/common/exceptions/multi.go:41 +0x91
github.com/sagernet/sing/common.FlatMap[...](...)
        github.com/sagernet/[email protected]/common/cond.go:77
github.com/sagernet/sing/common/exceptions.ExpandAll({0xc00040d180?, 0xc0002cd230?, 0xc0002cd230?})
        github.com/sagernet/[email protected]/common/exceptions/multi.go:47 +0xc2
github.com/sagernet/sing/common/exceptions.Errors({0xc0002cd230?, 0x7748ea0?, 0xc000808230?})
        github.com/sagernet/[email protected]/common/exceptions/multi.go:25 +0x31
github.com/sagernet/sing/protocol/http.HandleConnection({0x7759338, 0xc000e679b0}, {0x7760d08, 0xc000808230}, 0xc000115d40, 0x0, {0x5115e028, 0xc000a48fc0}, {{0x0, 0x0}, ...})
        github.com/sagernet/[email protected]/protocol/http/handshake.go:141 +0x1718
github.com/sagernet/sing-box/inbound.(*Mixed).NewConnection(_, {_, _}, {_, _}, {{0x0, 0x0}, {0x724365c, 0x5}, 0x0, ...})
        github.com/sagernet/sing-box/inbound/mixed.go:63 +0x846
github.com/sagernet/sing-box/inbound.(*myInboundAdapter).injectTCP(_, {_, _}, {{0x0, 0x0}, {0x724365c, 0x5}, 0x0, {0x0, 0x0}, ...})
        github.com/sagernet/sing-box/inbound/default_tcp.go:69 +0x1b6
created by github.com/sagernet/sing-box/inbound.(*myInboundAdapter).loopTCPIn in goroutine 8
        github.com/sagernet/sing-box/inbound/default_tcp.go:61 +0xe5

image

重现方式

./sing-box run -c 123.json

123.json:

{
  "log": {
    "level": "info"
  },
  "inbounds": [
    {
      "type": "mixed", // SOCKS5 HTTP 代理
      "listen": "127.0.0.1",
      "listen_port": 1080,
      "set_system_proxy": true
    }
  ],
  "outbounds": [
    {
      "tag": "香港2024-1",
      "type": "trojan",
      "password": "123456",
      "server": "xxx",
      "server_port": 443,
      "tls": {
        "enabled": true,
        "server_name": "xxx"
      }
    },
    {
      "tag": "直连",
      "type": "direct"
    },
    {
      "tag": "拦截",
      "type": "block"
    },
    {
      "tag": "域名",
      "type": "dns"
    }
  ],
  "dns": {
    "strategy": "ipv4_only",
    "servers": [
      {
        "tag": "remote",
        "address": "https://9.9.9.9/dns-query",
        "detour": "自选"
      },
      {
        "tag": "local",
        "address": "1.2.4.8",
        "detour": "直连"
      }
    ],
    "rules": [
      {
        "outbound": "any",
        "server": "local"
      },
      {
        "clash_mode": "Direct",
        "server": "local"
      },
      {
        "clash_mode": "Global",
        "server": "remote"
      },
      {
        "rule_set": "geosite-cn",
        "server": "local"
      }
    ]
  },
  "route": {
    "auto_detect_interface": true,
    "rules": [
      {
        "protocol": "dns",
        "outbound": "域名"
      },
      {
        "ip_is_private": true,
        "outbound": "直连"
      },
      {
        "clash_mode": "Direct",
        "outbound": "直连"
      },
      {
        "clash_mode": "Global",
        "outbound": "自选"
      },
      {
        "rule_set": [
          "geosite-category-ads-all"
        ],
        "outbound": "拦截"
      },
      {
        "rule_set": [
          "geoip-cn",
          "geosite-cn",
          "geosite-private"
        ],
        "outbound": "直连"
      }
    ],
    "rule_set": [
      {
        "tag": "geoip-cn",
        "type": "remote",
        "format": "binary",
        "url": "https://raw.githubusercontent.com/SagerNet/sing-geoip/rule-set/geoip-cn.srs",
        "download_detour": "自选"
      },
      {
        "tag": "geosite-cn",
        "type": "remote",
        "format": "binary",
        "url": "https://raw.githubusercontent.com/SagerNet/sing-geosite/rule-set/geosite-geolocation-cn.srs",
        "download_detour": "自选"
      },
      {
        "tag": "geosite-private",
        "type": "remote",
        "format": "binary",
        "url": "https://raw.githubusercontent.com/SagerNet/sing-geosite/rule-set/geosite-private.srs",
        "download_detour": "自选"
      },
      {
        "tag": "geosite-category-ads-all",
        "type": "remote",
        "format": "binary",
        "url": "https://raw.githubusercontent.com/SagerNet/sing-geosite/rule-set/geosite-category-ads-all.srs",
        "download_detour": "自选"
      }
    ]
  },
  "experimental": {
    "cache_file": {
      "enabled": true
    }
  }
}

日志

No response

完整性要求

  • [X] 我保证阅读了文档,了解所有我编写的配置文件项的含义,而不是大量堆砌看似有用的选项或默认值。
  • [X] 我保证提供了可以在本地重现该问题的服务器、客户端配置文件与流程,而不是一个脱敏的复杂客户端配置文件。
  • [X] 我保证提供了可用于重现我报告的错误的最简配置,而不是依赖远程服务器、TUN、图形界面客户端或者其他闭源软件。
  • [X] 我保证提供了完整的配置文件与日志,而不是出于对自身智力的自信而仅提供了部分认为有用的部分。

XhstormR avatar Mar 02 '24 02:03 XhstormR

运行12小时后又稳定出现 image

XhstormR avatar Mar 03 '24 23:03 XhstormR

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 5 days

github-actions[bot] avatar May 03 '24 01:05 github-actions[bot]