sing-box randomly panics
Operating system
Linux
System version
OpenSUSE Tumbleweed 20240315
Installation type
Original sing-box Command Line
If you are using a graphical client, please provide the version of the client.
No response
Version
v1.8.0, v1.8.9, v1.9.0-beta.17
Description
Sing-box works fine at first, but it will randomly panic within 1-2 days. There seems to be no obvious reason for the panic. I have sing-box with the same version and similar config running in same environment on other environment, but that works fine. I have no idea in figuring out this. According to the log, this seems to be related to sing package, please feel free to transfer this issue to sing if necessary.
Reproduction
Here's the sing-box config:
{
"inbounds": [
{
"fallback": {
"server": "fe2.update.microsoft.com",
"server_port": 80
},
"listen": "0.0.0.0",
"listen_port": 2666,
"tag": "trojan-multiport-in",
"tls": {
"certificate_path": "/tmp/conf/server.crt",
"enabled": true,
"key_path": "/tmp/conf/server.key"
},
"type": "trojan",
"users": []
},
{
"listen": "::",
"listen_port": 26666,
"method": "aes-128-gcm",
"password": "<redacted>",
"tag": "ss-in",
"type": "shadowsocks"
},
{
"listen": "::",
"listen_port": 38888,
"method": "aes-128-gcm",
"password": "<redacted>",
"tag": "ss-in",
"type": "shadowsocks",
"users": [
{
"name": "default",
"password": "<redacted>"
}
]
},
{
"fallback": {
"server": "fe2.update.microsoft.com",
"server_port": 80
},
"listen": "0.0.0.0",
"listen_port": 9443,
"tag": "trojan-in",
"tls": {
"certificate_path": "/tmp/conf/server.crt",
"enabled": true,
"key_path": "/tmp/conf/server.key"
},
"type": "trojan",
"users": []
},
{
"listen": "::",
"listen_port": 9666,
"tag": "vmess-in",
"tls": {
"certificate_path": "/tmp/conf/server.crt",
"enabled": true,
"key_path": "/tmp/conf/server.key"
},
"transport": {
"service_name": "<redacted>",
"type": "grpc"
},
"type": "vmess",
"users": []
},
{
"detour": "vmess-in-inline-forward",
"down_mbps": 200,
"ignore_client_bandwidth": false,
"listen": "::",
"listen_port": 22443,
"masquerade": "https://www.example.com",
"tag": "hy2-in-cn-forward",
"tls": {
"certificate_path": "/tmp/conf/server.crt",
"enabled": true,
"key_path": "/tmp/conf/server.key"
},
"type": "hysteria2",
"up_mbps": 200,
"users": [
{
"name": "default",
"password": "<redacted>"
}
]
},
{
"tag": "vmess-in-inline-forward",
"type": "vmess",
"users": []
}
],
"log": {
"disabled": false,
"level": "warning"
}
}
Logs
After some time of running sing-box will panic and produce the following output:
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x20 pc=0x821665]
goroutine 75999 [running]:
github.com/sagernet/sing/common/buf.(*Buffer).Len(...)
github.com/sagernet/[email protected]/common/buf/buffer.go:327
github.com/sagernet/sing/common/bufio.copyPacketWaitWithPool({0x7f35c1dd9d28, 0xc000a0f1d0}, {0x7f35c1de00c8, 0xc00055be00}, {0x165d908, 0xc000>
github.com/sagernet/[email protected]/common/bufio/copy_direct.go:72 +0x145
github.com/sagernet/sing/common/bufio.CopyPacket({0x7f35c1de00c8?, 0xc00055be00?}, {0x7f35c1dd9d28, 0xc000a0f1d0})
github.com/sagernet/[email protected]/common/bufio/copy.go:240 +0x448
github.com/sagernet/sing/common/bufio.CopyPacketConnContextList.func2({0xc000c19f50?, 0xd8a501?})
github.com/sagernet/[email protected]/common/bufio/copy.go:331 +0x68
github.com/sagernet/sing/common/task.(*Group).RunContextList.func1()
github.com/sagernet/[email protected]/common/task/task.go:91 +0x107
created by github.com/sagernet/sing/common/task.(*Group).RunContextList in goroutine 76016
github.com/sagernet/[email protected]/common/task/task.go:75 +0x198
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.
Try 1.9.0-rc.2
Seems to be fixed as no panic was observed in the last week. Mark the issue as closed. Thanks!
Duplicate of #2315.
Cc @wooferzfg
Hey, just to be clear, this isn't a duplicate of that issue, which appears to be about the Splits component updating the split PB during a run (I think?).
In the screenshot below, I've circled:
- my text component where I'm manually writing my PB.
- the segment PB that shows in the Detailed Timer component during a run.
- The "Sum of Best" component.
This PR is about making a component in the "Information" section like "Sum of Best" but that shows the PB.
I somehow misread that other issue entirely. Though it's still possible this is a duplicate.
You can already do this by adding a Splits component that only shows 1 split, and override the timing method. Not planning to create a separate component for this, since almost everyone just shows their PB via the Splits component already.
That's not very intuitive a usage, but if it works, then I'll be satisfied. Does it support saying "Personal Best" on the line or is it locked to the name of the last split?
almost everyone just shows their PB via the Splits component already
I don't think this is at all fair to say. LiveSplit does have the ability to use different comparisons and it's not uncommon for a runner to compare against world record or average splits, which obviously means they are not showing their PB via their splits.
I think this is a perfectly fine feature request to keep open. A more generic component that simply says a comparison's name and its time for the final split would work perfectly for this. In the settings, the user simply chooses which comparison to display (or the current one). The output could just be Personal Best 0:00:00.00.
@wooferzfg Thoughts?
You can already do this by adding a Splits component that only shows 1 split, and override the timing method.
This is what that looks like, if I've understood right:
Not great. I couldn't find a way to make it say what the comparison is instead of the last split name, and I'd guess it will be highlighted when the run is ongoing, which will look odd, since that split will appear twice. (The current comparison for the main Splits component in this picture is a goal time with balanced times, so it's not the PB.) My request is a lot closer to what @just-ero said, just have a generic info component to display this, similar to the other static info components like Sum of Best.
@Zannick I know you want this as an official component, but if you don't mind an unofficial component, I have already developed one that you can try if you like. https://soushinsoujin989.blogspot.com/2021/08/livesplit_76.html#ComparisonTime
@wooferzfg @just-ero If you think this feature should be provided as an official component, I will open the source code and you can use it as you like. (Translated by DeepL)
If you think this feature should be provided as an official component, I will open the source code and you can use it as you like.
That would be very helpful
The source code has been uploaded to GitHub. Please feel free to use it. https://github.com/Kuhaku9893/LiveSplit.ComparisonTime
- The project files are not in SDK style.
- UpdateURL in ComponentFactory.cs is currently blank.
- RunPrediction source code is used.
(Translated by DeepL)