ZeroBot-Plugin icon indicating copy to clipboard operation
ZeroBot-Plugin copied to clipboard

限速后使用功能直接导致插件崩溃

Open SakuraAzusa opened this issue 1 year ago • 9 comments

尝试测试限速功能,限制后使用任意功能发生崩溃,需删除control文件夹恢复 log:

time="2022-07-27T10:37:45+08:00" level=info msg="收到群()消息  梓: 设置默认限速为每5秒1次触发"
time="2022-07-27T10:37:45+08:00" level=info msg="发送群消息(): 设置默认限速为每5秒触发1次 (id=-1912094225)"
time="2022-07-27T10:37:59+08:00" level=info msg="收到群()消息 梓 : 运势"
unexpected fault address 0x12a05f210
fatal error: fault
[signal SIGSEGV: segmentation violation code=0x1 addr=0x12a05f210 pc=0x8fe5e9]

goroutine 4036 [running]:
runtime.throw({0xb9bbda?, 0xc0005238b0?})
	runtime/panic.go:992 +0x71 fp=0xc000523890 sp=0xc000523860 pc=0x434111
runtime.sigpanic()
	runtime/signal_unix.go:825 +0x305 fp=0xc0005238e0 sp=0xc000523890 pc=0x449585
github.com/FloatTech/zbputils/process.(*Once).Do(...)
	github.com/FloatTech/[email protected]/process/once.go:69
github.com/FloatTech/zbputils/file.GetLazyData({0xbaf151, 0x16}, 0x0)
	github.com/FloatTech/[email protected]/file/updater.go:42 +0xc9 fp=0xc000523c08 sp=0xc0005238e0 pc=0x8fe5e9
github.com/FloatTech/ZeroBot-Plugin/plugin/fortune.init.0.func2(0x4c23f6?)
	github.com/FloatTech/ZeroBot-Plugin/plugin/fortune/fortune.go:92 +0x3e fp=0xc000523cd0 sp=0xc000523c08 pc=0x998d5e
github.com/FloatTech/zbputils/ctxext.DoOnceOnSuccess[...].func1.1()
	github.com/FloatTech/[email protected]/ctxext/init.go:13 +0x2d fp=0xc000523cf0 sp=0xc000523cd0 pc=0x99ad8d
github.com/FloatTech/zbputils/process.(*Once).doSlow(0xc000194300, 0xc000523d88)
	github.com/FloatTech/[email protected]/process/once.go:90 +0x103 fp=0xc000523d68 sp=0xc000523cf0 pc=0x8fdc03
github.com/FloatTech/zbputils/process.(*Once).Do(...)
	github.com/FloatTech/[email protected]/process/once.go:71
github.com/FloatTech/zbputils/ctxext.DoOnceOnSuccess[...].func1()
	github.com/FloatTech/[email protected]/ctxext/init.go:12 +0x7e fp=0xc000523dc0 sp=0xc000523d68 pc=0x99ad1e
github.com/wdvxdr1123/ZeroBot.processEvent({0xc0000d4000, 0x18f, 0x200}, {0xcbfc40?, 0xc0002adc00})
	github.com/wdvxdr1123/[email protected]/bot.go:173 +0xacc fp=0xc000523fa8 sp=0xc000523dc0 pc=0x56252c
github.com/wdvxdr1123/ZeroBot/driver.(*WSClient).Listen.func1()
	github.com/wdvxdr1123/[email protected]/driver/websocket.go:143 +0x3b fp=0xc000523fe0 sp=0xc000523fa8 pc=0x705fbb
runtime.goexit()
	runtime/asm_amd64.s:1571 +0x1 fp=0xc000523fe8 sp=0xc000523fe0 pc=0x463521
created by github.com/wdvxdr1123/ZeroBot/driver.(*WSClient).Listen
	github.com/wdvxdr1123/[email protected]/driver/websocket.go:143 +0xe0f

goroutine 1 [IO wait]:
internal/poll.runtime_pollWait(0x7efc5861e658, 0x72)
	runtime/netpoll.go:302 +0x89
internal/poll.(*pollDesc).wait(0xc0002bbf80?, 0xc0002c8000?, 0x0)
	internal/poll/fd_poll_runtime.go:83 +0x32
internal/poll.(*pollDesc).waitRead(...)
	internal/poll/fd_poll_runtime.go:88
internal/poll.(*FD).Read(0xc0002bbf80, {0xc0002c8000, 0x1000, 0x1000})
	internal/poll/fd_unix.go:167 +0x25a
net.(*netFD).Read(0xc0002bbf80, {0xc0002c8000?, 0x0?, 0x10042e9db?})
	net/fd_posix.go:55 +0x29
net.(*conn).Read(0xc00000f330, {0xc0002c8000?, 0x416cc5?, 0x12234c0?})
	net/net.go:183 +0x45
bufio.(*Reader).fill(0xc00020d260)
	bufio/bufio.go:106 +0x103
bufio.(*Reader).Peek(0xc00020d260, 0x2)
	bufio/bufio.go:144 +0x5d
github.com/RomiChan/websocket.(*Conn).read(0xc0000c71e0, 0x0?)
	github.com/RomiChan/[email protected]/conn.go:369 +0x2c
github.com/RomiChan/websocket.(*Conn).advanceFrame(0xc0000c71e0)
	github.com/RomiChan/[email protected]/conn.go:811 +0x7b
github.com/RomiChan/websocket.(*Conn).NextReader(0xc0000c71e0)
	github.com/RomiChan/[email protected]/conn.go:1010 +0xc5
github.com/RomiChan/websocket.(*Conn).ReadMessage(0xc0000d4000?)
	github.com/RomiChan/[email protected]/conn.go:1094 +0x19
github.com/wdvxdr1123/ZeroBot/driver.(*WSClient).Listen(0xc0002adc00, 0xbfb0b0)
	github.com/wdvxdr1123/[email protected]/driver/websocket.go:116 +0x4f
github.com/wdvxdr1123/ZeroBot.RunAndBlock({{0xc0002bc780, 0x4, 0x4}, {0xb9a402, 0x1}, {0xc000095100, 0x1, 0x10}, {0xc0002b13b0, 0x1, ...}}, ...)
	github.com/wdvxdr1123/[email protected]/bot.go:64 +0xdd
main.main()
	github.com/FloatTech/ZeroBot-Plugin/main.go:258 +0x21d

goroutine 9 [select, 98 minutes]:
github.com/fumiama/cron.(*Cron).run(0xc000086be0)
	github.com/fumiama/[email protected]/cron.go:304 +0xb19
created by github.com/fumiama/cron.(*Cron).Start
	github.com/fumiama/[email protected]/cron.go:253 +0xca

goroutine 11 [select, 1162 minutes]:
database/sql.(*DB).connectionOpener(0xc00007bd40, {0xcc3d78, 0xc00014a340})
	database/sql/sql.go:1226 +0x8d
created by database/sql.OpenDB
	database/sql/sql.go:794 +0x18d

goroutine 10 [select, 2 minutes]:
github.com/FloatTech/ttl.(*Cache[...]).gc.func1()
	github.com/FloatTech/[email protected]/cache.go:46 +0x97
created by github.com/FloatTech/ttl.(*Cache[...]).gc
	github.com/FloatTech/[email protected]/cache.go:43 +0xbe

goroutine 12 [select, 2 minutes]:
github.com/FloatTech/ttl.(*Cache[...]).gc.func1()
	github.com/FloatTech/[email protected]/cache.go:46 +0x97
created by github.com/FloatTech/ttl.(*Cache[...]).gc
	github.com/FloatTech/[email protected]/cache.go:43 +0xbe

goroutine 13 [select, 2 minutes]:
github.com/wdvxdr1123/ZeroBot/extension/ttl.(*Cache[...]).gc.func1()
	github.com/wdvxdr1123/[email protected]/extension/ttl/cache.go:46 +0x97
created by github.com/wdvxdr1123/ZeroBot/extension/ttl.(*Cache[...]).gc
	github.com/wdvxdr1123/[email protected]/extension/ttl/cache.go:43 +0xbe

goroutine 18 [select, 2 minutes]:
github.com/wdvxdr1123/ZeroBot/extension/ttl.(*Cache[...]).gc.func1()
	github.com/wdvxdr1123/[email protected]/extension/ttl/cache.go:46 +0x97
created by github.com/wdvxdr1123/ZeroBot/extension/ttl.(*Cache[...]).gc
	github.com/wdvxdr1123/[email protected]/extension/ttl/cache.go:43 +0xbe

goroutine 19 [select, 1162 minutes]:
database/sql.(*DB).connectionOpener(0xc000170820, {0xcc3d78, 0xc00014aa00})
	database/sql/sql.go:1226 +0x8d
created by database/sql.OpenDB
	database/sql/sql.go:794 +0x18d

goroutine 20 [select, 2 minutes]:
github.com/FloatTech/ttl.(*Cache[...]).gc.func1()
	github.com/FloatTech/[email protected]/cache.go:46 +0x97
created by github.com/FloatTech/ttl.(*Cache[...]).gc
	github.com/FloatTech/[email protected]/cache.go:43 +0xbe

goroutine 2062 [select, 629 minutes]:
database/sql.(*DB).connectionOpener(0xc0002b21a0, {0xcc3d78, 0xc0002bca80})
	database/sql/sql.go:1226 +0x8d
created by database/sql.OpenDB
	database/sql/sql.go:794 +0x18d

goroutine 22 [select, 2 minutes]:
github.com/wdvxdr1123/ZeroBot/extension/ttl.(*Cache[...]).gc.func1()
	github.com/wdvxdr1123/[email protected]/extension/ttl/cache.go:46 +0x97
created by github.com/wdvxdr1123/ZeroBot/extension/ttl.(*Cache[...]).gc
	github.com/wdvxdr1123/[email protected]/extension/ttl/cache.go:43 +0xbe

goroutine 26 [select, 1162 minutes]:
database/sql.(*DB).connectionOpener(0xc0002b3ba0, {0xcc3d78, 0xc0002bc900})
	database/sql/sql.go:1226 +0x8d
created by database/sql.OpenDB
	database/sql/sql.go:794 +0x18d

goroutine 2063 [select, 2 minutes]:
github.com/FloatTech/ttl.(*Cache[...]).gc.func1()
	github.com/FloatTech/[email protected]/cache.go:46 +0x97
created by github.com/FloatTech/ttl.(*Cache[...]).gc
	github.com/FloatTech/[email protected]/cache.go:43 +0xbe

SakuraAzusa avatar Jul 27 '22 02:07 SakuraAzusa

用的是alfalse的限速吗, 那个好久没维护了吧

guohuiyuan avatar Jul 27 '22 14:07 guohuiyuan

用的是alfalse的限速吗, 那个好久没维护了吧

是的

SakuraAzusa avatar Jul 28 '22 00:07 SakuraAzusa

试试最新版,看看有没有解决

fumiama avatar Jul 28 '22 05:07 fumiama

试试最新版,看看有没有解决

actions版本设置限速无回应,同时/全局响应也无回应,单独在一个群/响应可正常使用所有功能,私聊设置会触发青云客,无报错

SakuraAzusa avatar Jul 28 '22 06:07 SakuraAzusa

确定正常 /响应 了吗,最近没有改响应有关代码,应该不会出问题才对。

fumiama avatar Jul 29 '22 07:07 fumiama

确认是正常 /响应 了,用的是最新版 #1125,以下是刚刚跑的log

======================[ZeroBot-Plugin]======================
* OneBot + ZeroBot + Golang
* Version 1.5.0-beta5 - 2022-07-22 15:39:17 +0800 CST
* Copyright © 2020 - 2022 FloatTech. All Rights Reserved.
* Project: https://github.com/FloatTech/ZeroBot-Plugin
----------------------[ZeroBot-公告栏]----------------------
由于tx更改登录鉴权, 近期gocqzbp闪退增多,
请及时处理以免对md5服务器产生过量请求, 导致IP被封.
============================================================

INFO[0001] [web] 本机不支持ipv6                              
INFO[0001] [file]已连接md5验证服务器                            
INFO[0002] [file]从镜像下载数据40624字节...                      
INFO[0002] [thesaurus]加载 116 条kimoi                     
INFO[0005] 开始尝试连接到Websocket服务器: ws://127.0.0.1:6700     
INFO[0005] 连接Websocket服务器: ws://127.0.0.1:6700 成功       
INFO[0006] [job]本地环回初始化完成                               
INFO[0009] [file]关闭到md5验证服务器的连接                         
INFO[0024] 收到群(**)消息 梓 : /全局响应           
INFO[0044] 收到群(**)消息 梓 : /响应             
INFO[0045] 发送群消息(**): 椛椛将开始在此工作啦~ (id=673575453) 
INFO[0074] 收到群(**)消息 梓 : 设置默认限速为每5秒1次触发  
INFO[0090] 收到群(**)消息 梓 : 设置默认限速为每1分钟5次触发 
INFO[0110] 收到群(**)消息 暗淡の白音 : [CQ:image,file=e08186a29d06498d52669a7fe07565f4.image,subType=0,url=https://gchat.qpic.cn/gchatpic_new/624573922/**-2785950563-E08186A29D06498D52669A7FE07565F4/0?term=2] 
INFO[0110] 收到群(**)消息 梓 : 运势              
INFO[0111] [file]已连接md5验证服务器                            
INFO[0111] [file]从镜像下载数据9522字节...                       
INFO[0112] [file]从镜像下载数据22114252字节...                   
INFO[0114] [file]关闭到md5验证服务器的连接                         
INFO[0150] [file]已连接md5验证服务器                            
INFO[0150] [file]从镜像下载数据28434695字节...                   
INFO[0153] [file]关闭到md5验证服务器的连接                         
INFO[0200] 发送群消息(**): [CQ:image,file=https://gchat.qpic.cn/gchatpic_new//0-0-A23B9D5B514FB71CF3388CF24CB9C338/0] (id=-1353033985) 
INFO[0227] 收到群(**)消息 梓 : /全局沉默           
INFO[0236] 收到群(**)消息 梓 : /沉默             
INFO[0237] 发送群消息(**): 椛椛将开始休息啦~ (id=-550460816) 

SakuraAzusa avatar Jul 29 '22 08:07 SakuraAzusa

应该是你不是SuperUser导致的

fumiama avatar Jul 30 '22 02:07 fumiama

我是超级用户的,V1.5.0-beta5版本使用全局响应是可以正常回复的,刚刚使用sudo启动也是同样结果 log:

root@SakuraAzusa:~/bottest# sudo ./zbp_amd64

======================[ZeroBot-Plugin]======================
* OneBot + ZeroBot + Golang
* Version 1.5.0-beta5 - 2022-07-22 15:39:17 +0800 CST
* Copyright © 2020 - 2022 FloatTech. All Rights Reserved.
* Project: https://github.com/FloatTech/ZeroBot-Plugin
----------------------[ZeroBot-公告栏]----------------------
由于tx更改登录鉴权, 近期gocqzbp闪退增多,
请及时处理以免对md5服务器产生过量请求, 导致IP被封.
============================================================

INFO[0001] [web] 本机不支持ipv6                              
INFO[0001] [file]已连接md5验证服务器                            
INFO[0001] [thesaurus]加载 116 条kimoi                     
INFO[0002] 开始尝试连接到Websocket服务器: ws://127.0.0.1:6700     
INFO[0002] 连接Websocket服务器: ws://127.0.0.1:6700 成功       
INFO[0004] [job]本地环回初始化完成                               
INFO[0007] [file]关闭到md5验证服务器的连接                         
INFO[0015] 收到群(**)消息 『      』梓 : /全局响应           
INFO[0030] 收到群(**)消息 『      』梓 : /响应             
INFO[0031] 发送群消息(**): 椛椛将开始在此工作啦~ (id=1178203082) 

SakuraAzusa avatar Jul 30 '22 03:07 SakuraAzusa

太怪了,我再看看

fumiama avatar Jul 30 '22 04:07 fumiama

呃,刚才又看了一眼你的启动命令,我说的su指的是给程序传入的SuperUser。程序本身应该是没问题了。

fumiama avatar Aug 16 '22 07:08 fumiama