sing-box
sing-box copied to clipboard
ruleset compile fail
Operating system
Linux
System version
Ubuntu 22.04.4 LTS
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.10.0-alpha.21
Environment: go1.22.5 linux/amd64
Tags: with_gvisor,with_quic,with_dhcp,with_wireguard,with_ech,with_utls,with_reality_server,with_acme,with_clash_api
Revision: d46daeb790a002b13664c89b09068b6ab84f2b04
CGO: disabled
sing-box version 1.9.3
Environment: go1.22.3 linux/amd64
Tags: with_gvisor,with_quic,with_dhcp,with_wireguard,with_ech,with_utls,with_reality_server,with_acme,with_clash_api
Revision: 085f60337799afc906069b540a38368968c123e4
CGO: disabled
Description
Bug:
Running sing-box rule-set compile xxx.json reports error and breaks.
Also tested on Windows 11 amd64, same bug appears.
Bugged version: Tested and confirmed for 1.9.0, 1.9.3 and 1.10.0-alpha.21
No bug version: Tested and confirmed for 1.8.14
json file link: https://www.mediafire.com/file/j3ysn3aq30becu5/sites2-direct.json/file
Reproduction
- Download json file: https://www.mediafire.com/file/j3ysn3aq30becu5/sites2-direct.json/file
- run
sing-box rule-set compile sites2-direct.json
Logs
panic: runtime error: index out of range [9] with length 9
goroutine 1 [running]:
github.com/sagernet/sing/common/domain.newSuccinctSet({0xc004224000, 0x27c2a, 0xc0001da930?})
github.com/sagernet/[email protected]/common/domain/set.go:31 +0x5c5
github.com/sagernet/sing/common/domain.NewMatcher({0xc0027f2000, 0x14030, 0x16999d0?}, {0xc004014000, 0x13dae, 0x1fdb010?})
github.com/sagernet/[email protected]/common/domain/matcher.go:39 +0x50d
github.com/sagernet/sing-box/common/srs.writeDefaultRule({_, _}, {{0x0, 0x0, 0x0}, {0x0, 0x0, 0x0}, {0xc0027f2000, 0x14030, ...}, ...})
github.com/sagernet/sing-box/common/srs/binary.go:236 +0x173
github.com/sagernet/sing-box/common/srs.writeRule({_, _}, {{0x1488fb3, 0x7}, {{0x0, 0x0, 0x0}, {0x0, 0x0, 0x0}, ...}, ...})
github.com/sagernet/sing-box/common/srs/binary.go:126 +0x98
github.com/sagernet/sing-box/common/srs.Write({0x1681be0, 0xc000070188}, {{0xc0001c4000?, 0x1b6?, 0x0?}})
github.com/sagernet/sing-box/common/srs/binary.go:96 +0x1d3
main.compileRuleSet({0x7ffcc4fef6dc, 0x12})
github.com/sagernet/sing-box/cmd/sing-box/cmd_rule_set_compile.go:76 +0x1db
main.init.func16(0xc0000fce00?, {0xc000050ca0?, 0x4?, 0x148762d?})
github.com/sagernet/sing-box/cmd/sing-box/cmd_rule_set_compile.go:25 +0x35
github.com/spf13/cobra.(*Command).execute(0x20660c0, {0xc000050c70, 0x1, 0x1})
github.com/spf13/[email protected]/command.go:987 +0xab1
github.com/spf13/cobra.(*Command).ExecuteC(0x2068340)
github.com/spf13/[email protected]/command.go:1115 +0x3ff
github.com/spf13/cobra.(*Command).Execute(...)
github.com/spf13/[email protected]/command.go:1039
main.main()
github.com/sagernet/sing-box/cmd/sing-box/main.go:38 +0x1e
Supporter
- [ ] I am a sponsor
Integrity requirements
- [X] 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.
- [X] 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.
- [X] 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.
- [X] 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.