Closed lifenjoiner closed 6 years ago
我没有 Windows 7,验证需要 @mrhso 的协助。
??? 这个函数当然是死循环啊,listen 不死循环怎么 listen??
第一次运行本来就会吃 CPU,要么等他载入完要么手动重新部署了再运行
并不是在部署
WeaselServer 有可能会部署。在服务启动时将会执行一次维护,如果检测到需要更新当前文件就会部署。代码在这里: https://github.com/rime/weasel/blob/28cdd09692f77e471784bf85ff7a19bc48e113f4/RimeWithWeasel/RimeWithWeasel.cpp#L59-L62 然后在 librime 中加载部署模块: https://github.com/rime/librime/blob/6f6056a7b1bcf9053ca6d6e39d2f8e5cb6c8690f/src/rime_api.cc#L99-L120
看来,还是不信啊……那调试时一直异常呢?
安装的时候,我是看着的,WeaselDeployer.exe
先运行,部署完,WeaselServer
启动,要是build 39
,CPU 就一直 ›20%;build 37
就不会。
再者,手动结束掉进程,手动部署一遍后,再启动WeaselServer
,还是一样。
“死循环”嘛,只是个事实,没有任何感情色彩……
我调试到的是一直 try pipe = _ConnectServerPipe(pname);
失败……
我能提供的暂时也就这么多了……不然,就看别人有没有吧。
来个比较有力的截图,部署5分钟以上(没有结束),正常吗?
哎,手*又操作了一次,还得重启电脑……
既然是 try 失败,需要提供 catch 住的异常号,debugger 都可以看到异常地址。应该是个 DWORD
值。
另外,OS 是否有特殊设置,比如 Windows Server 会有对于文件权限的特殊限制。
在与 NamedPipe
相关的地方有异常,那么是否能够进行输入?
没有人不信有问题,只是觉得你的表述方式很有意思。
我是每个Build都会试,可惜不懂代码没办法提供帮助。有问题也不知道怎么描述比较准确。目前两台win10系统(系统版本一样,一台机一笔记本,安装的Build版本也是相同的)在全新安装阶段有差别,一台无任何问题正常运行安装程序,一台就会先弹出一个未知程序的窗口,点击继续才能开始安装。
@nameoverflow 我哪里用词有不当吗?有的话,请指出来,你不说我也不知道……
我反馈都是尽量多地提供自己认为有用、能帮助定位问题的信息。当然,个人水平有限,也不可能完全预先提供你想要的信息。
解释几点:
从版本号来定位,猜测基本就是build 39的代码覆盖的平台不够全面…… 现在没有win7,明天有空再试试多了解一下……
我调试到的是一直 try pipe = _ConnectServerPipe(pname); 失败……
从这一段代码(第 316 行开始的死循环):
https://github.com/rime/weasel/blob/28cdd09692f77e471784bf85ff7a19bc48e113f4/WeaselIPCServer/WeaselServerImpl.cpp#L316-L329
定位到这里:
https://github.com/rime/weasel/blob/28cdd09692f77e471784bf85ff7a19bc48e113f4/WeaselIPC/PipeChannel.cpp#L118-L133
这里 _ThrowLastError
来自这个宏定义:
https://github.com/rime/weasel/blob/28cdd09692f77e471784bf85ff7a19bc48e113f4/WeaselIPC/PipeChannel.cpp#L9
你的截图中有这样一条指令:
00220450 call dword ptr ds:[<&GetLastError>]
我需要你定位到这里,提供 GetLastError()
的返回值。
我一向非常重视能够使用调试器收集更多信息的用户的反馈。我最初的回复是因为当时匆忙瞥了一眼,只解释了是否有部署行为的问题,没有不相信你说存在异常的情况。希望大家收拾好情绪,专注于解决问题。
谢谢 @Prcuvu 提示。 我还是很愿意来测试反馈问题的。尽管大家思路不同,求同存异就能做得更好。
看截图:
对应的代码更改不多:
个人认为应该是这里了,至于为什么ConvertStringSecurityDescriptorToSecurityDescriptorW
没有成功,还要进一步研究……
继续……
参考: Security Descriptor String Format https://msdn.microsoft.com/en-us/library/windows/desktop/aa379570(v=vs.85).aspx
D:dacl_flags(string_ace1)(string_ace2)... (string_acen)
S:sacl_flags(string_ace1)(string_ace2)... (string_acen)
ACE Strings
https://msdn.microsoft.com/en-us/library/windows/desktop/aa374928(v=vs.85).aspx
ace_type;ace_flags;rights;object_guid;inherit_object_guid;account_sid;(resource_attribute)
SID Strings (account_sid) https://msdn.microsoft.com/en-us/library/windows/desktop/aa379602(v=vs.85).aspx
核实
LW
SY
WD
AC
可知AC
是不对的,应该是DC
吧?
终于知道,触发这个问题的原因是我这里是域用户,而对应的SID Strings
不对。
打了个二进制补丁,通过。
看来应该设成 WD
:SDDL_EVERYONE
……
L"S:(ML;;NW;;;LW)D:(A;;FA;;;SY)(A;;FA;;;WD
)(A;;FA;;;AC
)",
已经有WD
了啊。
AC
是不存在的,但是为什么其它情况下不引发错误呢?不了解ConvertStringSecurityDescriptorToSecurityDescriptor
的内部机制……
明白了。我们需要在这里做一个版本自适应。
@Prcuvu 我觉得只是写错了而已( 需要再研究一下 M$ 这个奇怪的 security descriptor。
可知AC是不对的,应该是DC吧?
我觉得只是写错了而已
并没有错,只是那篇文档比较旧了。请参考这篇文档:[MS-DTYP]: Syntax
我在 Windows XP 上测试了一下,依然无法创建 named pipe。
这个AC
确实是版本问题……MS的文档并没有标出来,有点坑!
Win 7 的SDK头文件里没有:
看到 @Prcuvu 已经解决了,很棒! 等明天,确认一下是否“没有DC,有WD,域用户时正常”……
Windows 8.1 SDK 就有了。 对比各个版本的 Windows Platform SDK,才能明白不同版本支持哪些设置。
确认一下是否“没有DC,有WD,域用户时正常”
正常。
你们年轻人 不错 有两下子 题 我看不懂 你们谈笑风生
已经 解决了 不须 看懂 看不懂 也没关系 还是可以 谈笑风生
对各位表示(提问题的 @lifenjoiner 和解决问题的 @Prcuvu and @nameoverflow )表示表示赞👍和感谢😊 另外,我在MacOS, Linux, Windows上都已经用上了Rime,就差Android没有合适的版本了,可有推荐?
@zhaozg Trime 啊
@nameoverflow 同文试过的,版本跟不上Rime的更新
Windows 8.1 SDK 就有了。 对比各个版本的 Windows Platform SDK,才能明白不同版本支持哪些设置。
我现在应该是遇到这个问题了,在win7中,每次重启完电脑后,weasel无法正常使用,输入时直接输出英文,看任务管理器中的进程,没有WeaselServer.exe,此时手动找到weaselServer.exe运行一下,后台多了WeaselServer进程,输入法就正常了。这个问题该怎么解决呢?
验证过了,win 10 下是没问题;英文 win 7 下有此问题: https://github.com/rime/weasel/commit/16c163a41d0afc9824723009ba8b9b9ba37b1c72#commitcomment-28230787
master build 37 也没有问题。 @nameoverflow 并不是在部署,部署是
WeaselDeployer.exe
啊。动态调试,一直异常在: 偏移:
定位到死循环:
void PipeServer::Listen(ServerHandler const &handler)
https://github.com/rime/weasel/blob/16c163a41d0afc9824723009ba8b9b9ba37b1c72/WeaselIPCServer/WeaselServerImpl.cpp#L320没有多少人跟进测试最新的 build 啊~