Windows Calculator application crashes due to WerFault inconsistency when launched from a service using CreateProcessAsUserW()

PHPz
Release: 2024-02-05 22:51:07
forward
1166 people have browsed it

使用 CreateProcessAsUserW() 从服务启动时,Windows 计算器应用程序会因 WerFault 不一致而崩溃

Question content

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.


Correct answer


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!

source:stackoverflow.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!