SagerNet / sing-box

The universal proxy platform
https://sing-box.sagernet.org/
Other
18.85k stars 2.25k forks source link

自 v1.10.0-alpha.12 开始的由 find_process 触发的 panic #1885

Closed xireiki closed 1 month ago

xireiki commented 3 months ago

操作系统

Android

系统版本

Android 13

安装类型

sing-box 原始命令行程序

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

No response

版本

sing-box version 1.10.0-alpha.16                                                        
Environment: go1.22.3 android/arm64
Tags: with_quic,with_grpc,with_dhcp,with_wireguard,with_ech,with_utls,with_clash_api,with_v2ray_api,with_gvisor
Revision: 1bc83a119d61f84d34bcb8bbedd4b41c74c2fa40
CGO: enabled

描述

以下是配置

bug-share.json

以下是日志

+0800 2024-06-24 02:56:38 INFO router: updated default interface rmnet_data4, index 18, vpn disabled +0800 2024-06-24 02:56:38 INFO clash-api: restful api listening at 127.0.0.1:9999 +0800 2024-06-24 02:56:38 INFO inbound/tproxy[tproxy-in]: tcp server started at [::]:1536 +0800 2024-06-24 02:56:38 INFO inbound/tproxy[tproxy-in]: udp server started at [::]:1536 +0800 2024-06-24 02:56:38 INFO outbound/vless[🇭🇰 HK06 - VLESS]: outbound connection to www.gstatic.com:443 +0800 2024-06-24 02:56:38 DEBUG dns: lookup domain hk-06.riolu.lol +0800 2024-06-24 02:56:38 INFO outbound/direct[direct]: outbound packet connection to 119.29.29.29:53 +0800 2024-06-24 02:56:38 INFO outbound/shadowsocks[🇭🇰 HK03 - SS2022]: outbound connection to www.gstatic.com:443 +0800 2024-06-24 02:56:38 DEBUG dns: lookup domain hk-03-s2.riolu.lol +0800 2024-06-24 02:56:38 INFO outbound/shadowsocks[🇭🇰 HK06 - SS]: outbound connection to www.gstatic.com:443 +0800 2024-06-24 02:56:38 DEBUG dns: lookup domain hk-06-s.riolu.lol +0800 2024-06-24 02:56:38 INFO outbound/shadowsocks[🇭🇰 HK07 - SS]: outbound connection to www.gstatic.com:443 +0800 2024-06-24 02:56:38 DEBUG dns: lookup domain 127.0.0.1 +0800 2024-06-24 02:56:38 INFO outbound/shadowsocks[🇭🇰 HK04 - SS2022]: outbound connection to www.gstatic.com:443 +0800 2024-06-24 02:56:38 DEBUG dns: lookup domain 127.0.0.1 +0800 2024-06-24 02:56:38 INFO outbound/shadowsocks[🇭🇰 HK08 - SS]: outbound connection to www.gstatic.com:443 +0800 2024-06-24 02:56:38 INFO outbound/shadowsocks[🇭🇰 HK05 - SS2022]: outbound connection to www.gstatic.com:443 +0800 2024-06-24 02:56:38 DEBUG dns: lookup domain hk-05-s2.riolu.lol +0800 2024-06-24 02:56:38 DEBUG dns: lookup domain hk-08-s.riolu.lol +0800 2024-06-24 02:56:38 INFO outbound/shadowsocks[🇭🇰 HK06 - SS2022]: outbound connection to www.gstatic.com:443 +0800 2024-06-24 02:56:38 DEBUG dns: lookup domain 127.0.0.1 +0800 2024-06-24 02:56:38 INFO outbound/shadowsocks[🇭🇰 HK01 - SS2022]: outbound connection to www.gstatic.com:443 +0800 2024-06-24 02:56:38 DEBUG dns: lookup domain 127.0.0.1 +0800 2024-06-24 02:56:38 INFO outbound/shadowsocks[🇭🇰 HK07 - SS2022]: outbound connection to www.gstatic.com:443 +0800 2024-06-24 02:56:38 DEBUG dns: lookup domain 127.0.0.1 +0800 2024-06-24 02:56:38 INFO sing-box started (0.177s) +0800 2024-06-24 02:56:38 INFO [1136797047 0ms] inbound/tproxy[tproxy-in]: inbound packet connection from 127.0.0.1:10086 +0800 2024-06-24 02:56:38 INFO [1136797047 0ms] inbound/tproxy[tproxy-in]: inbound packet connection to 202.101.172.37:53 +0800 2024-06-24 02:56:38 DEBUG [1136797047 0ms] router: sniffed packet protocol: dns +0800 2024-06-24 02:56:38 INFO [307964084 0ms] inbound/tproxy[tproxy-in]: inbound packet connection from 127.0.0.1:10086 +0800 2024-06-24 02:56:38 INFO [307964084 1ms] inbound/tproxy[tproxy-in]: inbound packet connection to 202.101.172.37:53 +0800 2024-06-24 02:56:38 DEBUG [307964084 1ms] router: sniffed packet protocol: dns

以下是 panic

panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x38 pc=0x5cc467ca2c]

goroutine 225 [running]: github.com/sagernet/sing-box/common/process.(androidSearcher).FindProcessInfo(0x400004c480, {0x0?, 0x40002996c0?}, {0x5cc3e4d1b7?, 0x0?}, {{{0x0?, 0x0?}, 0x400000e0d8?}, 0x24d0?}, {{{0x0?, ...}, ...}, ...}) github.com/sagernet/sing-box/common/process/searcher_android.go:25 +0x6c github.com/sagernet/sing-box/common/process.FindProcessInfo({0x5cc50f44e0?, 0x400004c480?}, {0x5cc5105d18?, 0x40008642a0?}, {0x5cc3e4d1b7?, 0x5cc4166028?}, {{{0x4000c0ed48?, 0x5cc408174c?}, 0x400000e0d8?}, 0x17a4?}, ...) github.com/sagernet/sing-box/common/process/searcher.go:33 +0x74 github.com/sagernet/sing-box/route.(Router).match0(0x40003da008, {0x5cc5105d18, 0x40008642a0}, 0x40002df380, {0x5cc5110068, 0x40003cf5f0}) github.com/sagernet/sing-box/route/router.go:1067 +0x1d8 github.com/sagernet/sing-box/route.(Router).match(0x0?, {0x5cc5105d18, 0x40008642a0}, 0x400025a1c0?, {0x5cc5110068?, 0x40003cf5f0?}) github.com/sagernet/sing-box/route/router.go:1049 +0x30 github.com/sagernet/sing-box/route.(Router).RouteConnection(, {, }, {, }, {{0x4000331240, 0x9}, {0x5cc3e50d0a, 0x6}, 0x0, ...}) github.com/sagernet/sing-box/route/router.go:897 +0x11f0 github.com/sagernet/sing-box/inbound.(*myInboundAdapter).newConnection(, {, }, {, }, {{0x4000331240, 0x9}, {0x5cc3e50d0a, 0x6}, 0x0, ...}) github.com/sagernet/sing-box/inbound/default.go:138 +0x100 github.com/sagernet/sing-box/inbound.(TProxy).NewConnection(, {, }, {, _}, {{0x4000331240, 0x9}, {0x5cc3e50d0a, 0x6}, 0x0, ...}) github.com/sagernet/sing-box/inbound/tproxy.go:80 +0x118 github.com/sagernet/sing-box/inbound.(myInboundAdapter).injectTCP(, {, _}, {{0x4000331240, 0x9}, {0x5cc3e50d0a, 0x6}, 0x0, {0x0, 0x0}, ...}) github.com/sagernet/sing-box/inbound/default_tcp.go:74 +0x15c created by github.com/sagernet/sing-box/inbound.(*myInboundAdapter).loopTCPIn in goroutine 67 github.com/sagernet/sing-box/inbound/default_tcp.go:66 +0xdc

重现方式

在 root 下执行 ./sing-box -D . -c bug.json run

以下是目录结构:

$ tree
.
├── Dashboard
├── bug.json
├── log.txt
└── src
    ├── cache.db
    ├── geoip.db
    ├── geosite.db
    ├── log
    │   └── sing-box.log
    └── rule_set
        ├── 69shu.json
        ├── 69shu.srs
        ├── domain-direct.json
        ├── domain-direct.srs
        ├── domain-proxy.json
        ├── domain-proxy.srs
        ├── geosite-category-ads-all.json
        ├── geosite-category-ads-all.srs
        └── proxy-domain.json

日志

No response

支持我们

完整性要求

github-actions[bot] commented 1 month ago

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