Windows calculator app crashes with WerFault inconsistently when launched from a Service using CreateProcessAsUserW()

huangapple go评论101阅读模式
英文:

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崩溃

Windows calculator app crashes with WerFault inconsistently when launched from a Service using CreateProcessAsUserW()

使用CreateProcessAsUserW启动的3个类似计算器应用程序启动的详细堆栈跟踪-前两个成功,第三个失败

Windows calculator app crashes with WerFault inconsistently when launched from a Service using CreateProcessAsUserW()

这个错误的性质相当随机,这使得应用程序不可靠。我对如何从这里进行调试感到困惑,非常感谢您的帮助。

英文:

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

Windows calculator app crashes with WerFault inconsistently when launched from a Service using CreateProcessAsUserW()

Detailed Stack trace of 3 similiar calculator app launches using CreateProcessAsUserW - First two succeeded and third one in box failed

Windows calculator app crashes with WerFault inconsistently when launched from a Service using CreateProcessAsUserW()

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

huangapple
  • 本文由 发表于 2023年2月22日 01:00:02
  • 转载请务必保留本文链接:https://go.coder-hub.com/75523640.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定