Home >Backend Development >Golang >Windows Calculator application crashes due to WerFault inconsistency when launched from a service using CreateProcessAsUserW()
The Windows service is written in Go and trying to create a calculator in the user context using CreateProcessAsUserW()
process.
Its code is inspired by this gist:
https://gist.github.com/LiamHaworth/1ac37f7fb6018293fc43f86993db24fc#file-native-go
Most of the time, the Calculator application starts in the active user; however, sometimes the application fails to start without CreateProcessAsUserW()
returning no error.
Inspection using Procmon revealed that upon launching the Calculator application, the application crashed and resorted to collecting a WerFault dump. Unfortunately, I don't see a detailed dump in the event log.
WerFault crash observed in ProcMon
Detailed stack traces of launching 3 similar calculator applications using CreateProcessAsUserW
- the first two succeed, the third fails
This error is random in nature and does not make the application reliable. I'm very clueless on what/how to debug from here and would really appreciate any help.
The error appears to occur due to a wrong compilation environment, where binaries created with x64 are run on arm64. Thanks for everyone’s input
The above is the detailed content of Windows Calculator application crashes due to WerFault inconsistency when launched from a service using CreateProcessAsUserW(). For more information, please follow other related articles on the PHP Chinese website!