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

sing-box core panic #2497

Open
4 of 5 tasks
inipew opened this issue Jan 23, 2025 · 2 comments
Open
4 of 5 tasks

sing-box core panic #2497

inipew opened this issue Jan 23, 2025 · 2 comments

Comments

@inipew
Copy link

inipew commented Jan 23, 2025

Operating system

Android

System version

android 10

Installation type

Original sing-box Command Line

If you are using a graphical client, please provide the version of the client.

No response

Version

sing-box version 1.11.0-beta.24

Environment: go1.23.5 android/arm64
Tags: with_gvisor,with_dhcp,with_wireguard,with_reality_server,with_clash_api,with_quic,with_utls,with_ech
Revision: 8cc7734a921bf6c24d52d3b8dc40a553a88d7f5a
CGO: enabled

Description

I don't know how to describe this error, it happened suddenly. on beta 20 this problem is quite rare, not that it doesn't exist at all, but it is quite rare.

Reproduction

The configuration I use is as follows

{
  "log": {
    "level": "warn",
    "timestamp": true
  },
  "inbounds": [
    {
      "type": "tproxy",
      "tag": "tproxy-in",
      "listen": "::",
      "listen_port": 65535
    }
  ],
  "experimental": {
    "cache_file": {
      "enabled": true,
      "path": "cache.db",
      "store_rdrc": true
    },
    "clash_api": {
      "external_controller": "0.0.0.0:9090",
      "external_ui": "zashboard",
      "external_ui_download_url": "https://github.com/Zephyruso/zashboard/archive/refs/heads/gh-pages.zip",
      "external_ui_download_detour": "SerperIndo",
      "default_mode": "Rule"
    }
  },
  ......
  "route": {
    "rules": [
      {
        "action": "sniff",
        "timeout": "300ms"
      },
      {
        "protocol": "dns",
        "action": "hijack-dns"
      },
      {
        "action": "route-options",
        "udp_disable_domain_unmapping": true,
        "udp_timeout": "8s"
      },
      ......
    ],
    "final": "Flow",
    "auto_detect_interface": true,
    "override_android_vpn": true
  }
}

Logs

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

goroutine 77 [running]:
github.com/sagernet/sing/common/udpnat2.(*natConn).Close(0x4000376ab8?)
github.com/sagernet/[email protected]/common/udpnat2/conn.go:110 +0x18
github.com/sagernet/sing/common/udpnat2.New.func2({{{0x4000376b18?, 0x599a9d7fdc?}, {0x4000376ac8?}}, 0xbdcc?}, 0xc9e36045793?)
github.com/sagernet/[email protected]/common/udpnat2/service.go:44 +0x20
github.com/sagernet/sing/contrab/freelru.(*LRU[...]).evict(0x599a75045c?, 0x376ae8?)
github.com/sagernet/[email protected]/contrab/freelru/lru.go:246 +0x1b8
github.com/sagernet/sing/contrab/freelru.(*LRU[...]).removeAt(0x599b418700, 0x192)
github.com/sagernet/[email protected]/contrab/freelru/lru.go:640 +0x30
github.com/sagernet/sing/contrab/freelru.(*LRU[...]).PurgeExpired(0x599b418700)
github.com/sagernet/[email protected]/contrab/freelru/lru.go:701 +0x48
github.com/sagernet/sing/contrab/freelru.(*LRU[...]).GetAndRefreshOrAdd(0x599b418700, {{{0x4000376be8, 0x599a9d24e0?}, {0x40001a4048?}}, 0xde0?}, 0x40014e8000?)
github.com/sagernet/[email protected]/contrab/freelru/lru.go:528 +0xa0
github.com/sagernet/sing/common/udpnat2.(*Service).NewPacket(0x400039eab0, {0x4000376df0, 0x1, 0x0?}, {{{0x0, 0xffffc0a82ac3}, {0x40001a4048}}, 0x8b34, {0x0, 0x0}}, ...)
github.com/sagernet/[email protected]/common/udpnat2/service.go:54 +0x178
github.com/sagernet/sing-box/protocol/redirect.(*TProxy).NewPacketEx(0x40003f9f20, 0x40005b4000, {0x400007e800?, 0x8b34?, 0x0?}, {{{0x0, 0xffffc0a82ac3}, {0x40001a4048}}, 0x8b34, {0x0, ...}})
github.com/sagernet/sing-box/protocol/redirect/tproxy.go:121 +0x108
github.com/sagernet/sing-box/common/listener.(*Listener).loopUDPIn(0x400017f8c0)
github.com/sagernet/sing-box/common/listener/listener_udp.go:75 +0x264
created by github.com/sagernet/sing-box/common/listener.(*Listener).Start in goroutine 1
github.com/sagernet/sing-box/common/listener/listener.go:88 +0x23c

Supporter

Integrity requirements

  • I confirm that I have read the documentation, understand the meaning of all the configuration items I wrote, and did not pile up seemingly useful options or default values.
  • I confirm that I have provided the server and client configuration files and process that can be reproduced locally, instead of a complicated client configuration file that has been stripped of sensitive data.
  • I confirm that I have provided the simplest configuration that can be used to reproduce the error I reported, instead of depending on remote servers, TUN, graphical interface clients, or other closed-source software.
  • I confirm that I have provided the complete configuration files and logs, rather than just providing parts I think are useful out of confidence in my own intelligence.
@nunu6689
Copy link

How to reproduce it? At least show more log before it happens

@inipew
Copy link
Author

inipew commented Jan 26, 2025

How to reproduce it? At least show more log before it happens

I don't know, because it happened randomly and suddenly. I can say that beta 20 is fine, even with the new dependencies of the latest alpha version(sing 0.6.0 beta 12 and other sing-box dependency)

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