PowerShell / PowerShell/PowerShell-Native

Running win32 application from shell "exits silently" but in reality crashes on load

未關閉
#31 5 則留言 1 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

主要語言
C++
星號
68
分支
46
平均合併
3 天 4 小時
30 天內合併 PR
1

描述

So I ran into an issue where an application unexpectedly would no longer launch when called directly from the shell, i.e. ".\appname.exe"

After troubleshooting for a bit with my trusty old friend Process Monitor, I could see the process opening and closing down again, looking at the Process Exit event, I saw the exit code of -1073741515 (aka. 0xC0000135, aka. STATUS_DLL_NOT_FOUND)

That was a quite easy fix, but it nagged me that I got no indication of the failure, in any other circumstance (running from cmd, double-clicking in explorer, run or even in powershell with Start-Process) a message would pop up stating a DLL was missing, and which one it was.

(I don't know if this issue extends to Linux/MacOS, or even if it can affect those platform)

Steps to reproduce


- First and foremost, a win32(native) application is needed with a linked library that's missing
- PS > .\path\to\executable.exe

Expected behavior

External System Error prompt

Actual behavior

No Output

Environment data

Name                           Value
----                           -----
PSVersion                      6.2.3
PSEdition                      Core
GitCommitId                    6.2.3
OS                             Microsoft Windows 10.0.18362
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

貢獻指南

開啟貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

研究方向

首先,使用缺少其連結 DLL 的原生可執行檔重現 Windows PowerShell 命令,然後檢查程序啟動如何處理該失敗。完成的標準是呼叫該可執行檔時回報一個能識別遺失 DLL 的 External System Error,而不是不產生任何輸出。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
powershell
領域
cli, operating-systems
Issue 類型
缺陷
難度
4/5
預估耗時
3-5 天
活躍度
停滯
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。