チケット #39146

mingw linker creates invalid PE files

登録: 2019-04-20 09:00 最終更新: 2019-05-21 06:48

報告者:
担当者:
(未割り当て)
チケットの種類:
状況:
完了
コンポーネント:
(未割り当て)
マイルストーン:
(未割り当て)
優先度:
5 - 中
重要度:
5 - 中
解決法:
直さない
ファイル:
なし
投票
点数: 0
No votes
0.0% (0/0)
0.0% (0/0)

詳細

When using git.exe on Windows as part of the Chromium project I tried to obtain details about the debug information (PDB files) associated with git.exe by using Visual Studio's dumpbin. This failed due to invalid fields in the git.exe PE file. Details can be found in this Visual Studio bug:

https://developercommunity.visualstudio.com/content/problem/386596/dumpbin-fails-on-gitexe-for-windows.html

Although Microsoft may update dumpbin to work around this bug in the git.exe binary as created by mingw it would be preferable if mingw would stop creating invalid PE files.

I obtained git.exe from https://github.com/git-for-windows/git/tree/v2.19.1.windows.1

チケットの履歴 (3 件中 3 件表示)

2019-04-20 09:00 更新者: brucedawson
  • 新しいチケット "mingw linker creates invalid PE files" が作成されました
2019-05-17 05:22 更新者: keith
  • 解決法なし から 直さない に更新されました
  • 状況オープン から 完了 に更新されました
コメント

I take issue with your assessment, and am closing this as "won't fix" — not that we could fix it anyway, because it is not our bug! My reasoning goes as follows:—

  1. Microsoft's dumpbin tool is hardly an effective yardstick for determination of the validity of PE-COFF executables.
  2. By your own admission, the git.exe about which you complain, can be loaded and executed successfully by Windows, and Microsoft's windbg can parse it; that, for me, is a more effective validation yardstick.
  3. This git.exe is a third party product, which we neither distribute, nor maintain; furthermore, there is no evidence that our tools play any part in its creation — on the contrary, there is strong evidence that they do not!

On this basis, I conclude that it is not git.exe which is at fault, but rather dumpbin which is defective; only Microsoft can fix that.

2019-05-21 06:48 更新者: brucedawson
コメント

I'm not sure why you took offense at the bug report. I was just trying to point out a problem that I had noticed, that's all.

there is no evidence that our tools play any part in its creation

This is a crucial question, I agree. I am verifying whether git.exe is built using the mingw toolchain. I thought that it was but I cannot find confirmation at the moment.

The Windows loader successfully runs git.exe, which is nice, but that doesn't mean that it is a valid PE file, it just means that WIndows can find enough correct information to load it. dumpbin looks at different fields and reports that some of these are wrong. In a comment from Microsoft on the bug (since deleted, so I put it back up) they said:

"The executable contains invalid values in PE file header. As shown below, the "file pointer to symbol table" is 0x62200, while the file size is only 40,728 bytes. 62200 file pointer to symbol table 7C2 number of symbols The PE seems fine if we ignore those two fields."

So, Microsoft has told us *exactly* which fields are wrong, and what is wrong with them. They will be fixing dumpbin to handle these incorrect PE files, but they are still incorrect. If they are produced by the mingw linker

TL;DR - the git.exe binary has at least one invalid field, the "file pointer to symbol table". If git.exe is produced by the mingw linker then this bug is valid. If not, then not. I'll update this bug when I know more.

添付ファイルリスト

添付ファイルはありません

編集

このチケットにコメントを追加するには、ログインが必要です » ログインする