英文:
Windows calculator app crashes with WerFault inconsistently when launched from a Service using CreateProcessAsUserW()
问题
Windows服务是用Go语言编写的,并尝试使用CreateProcessAsUserW()
在用户上下文中创建一个计算器进程。
代码的灵感来自于这个Gist:
https://gist.github.com/LiamHaworth/1ac37f7fb6018293fc43f86993db24fc#file-native-go
大部分情况下,计算器应用程序会在活动用户中启动;然而,有时应用程序启动失败,但CreateProcessAsUserW()
没有返回任何错误。
使用Procmon进行检查发现,在启动计算器应用程序时,应用程序崩溃并采集WerFault转储。不幸的是,我在事件日志中没有看到详细的转储信息。
ProcMon中观察到的WerFault崩溃
使用CreateProcessAsUserW
启动的3个类似计算器应用程序启动的详细堆栈跟踪-前两个成功,第三个失败
这个错误的性质相当随机,这使得应用程序不可靠。我对如何从这里进行调试感到困惑,非常感谢您的帮助。
英文:
The Windows Service is written in Go, and attempts to create a calculator process in user context using CreateProcessAsUserW()
.
The code for it is inspired from this Gist:
https://gist.github.com/LiamHaworth/1ac37f7fb6018293fc43f86993db24fc#file-native-go
Most of the time, the calculator app launches in the active user; however, sometimes the app launch fails, but CreateProcessAsUserW()
doesn't return any error.
Inspection with Procmon reveals that, while launching the calculator app, the app crashes and resorts to collecting WerFault dumps. Unfortunately, I don't see the detailed dumps in the event-logs.
WerFault crash observed in ProcMon
Detailed Stack trace of 3 similiar calculator app launches using CreateProcessAsUserW
- First two succeeded and third one in box failed
This error is quiet random in nature, which doesn't make the app be reliable. I am quite clueless on what/how to debug from here, and would greatly appreciate the help.
答案1
得分: 0
错误似乎是由于错误的编译环境导致的,其中一个使用x64创建的二进制文件在arm64上运行。感谢大家的意见。
英文:
The error seems to have occured because of wrong compilation environments where a binary created with x64 was run on arm64.Thanks all for your inputs
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论