run-command: be helpful when Git LFS fails on Windows 7#5042
Conversation
There was a problem hiding this comment.
Thank you so much for tackling this challenge! I really appreciate the effort here, and I've learned a ton from doing a review about both the Windows and MS-DOS executable file formats and Go's own linker and file format internals.
I had a few suggestions only; out of them all, the main thing I wondered about was whether the get_go_version() function could accidentally read past the end of the data in its p while trying to parse the various pieces of the Go header and version string, etc., if the input data was bad or malicious or whatever.
So I tried to write up and test some code which might check for that condition and a few others; I ran a variety of experiments with bad input data, but I won't claim I did a completely exhaustive set of checks.
I have also set up a Windows 7 SP1 VM, and see the problem with the current Git for Windows distribution this PR aims to work around, but I haven't yet tried compiling enough of Git to get this PR's changes (with or without my suggestions) running in the VM and testable. I hope to get to that soon.
Thanks again very much for all the investigation and work to try to help out our Git LFS users on old Windows systems! 🙇
|
@chrisd8088 thank you for your review! I will reply to your concerns in the threads, except for this one:
FWIW you could simply download the PR build artifacts and overwrite |
Ah, thanks -- I've done that before for Git LFS build artifacts. (There's a bit of work getting them onto the VM, but it's doable.) |
1fe2fa9 to
c99be51
Compare
|
@chrisd8088 wow, what a thorough review! I do not see a lot of such high-quality reviews on the Git mailing list, and I am delighted. Thank you so, so much. I force-pushed an update that addresses your comments as well as the bug where 32-bit Could you have a final look over the diff before I merge the PR? |
chrisd8088
left a comment
There was a problem hiding this comment.
Glad to help! It's been fun doing some C coding again; I know it's a language with flaws, but I miss reading and writing it.
Speaking of the flaws of C, though, I think the current version of this code may still read past the end of p in one specific case, which I tried to outline in my latest comments.
Git LFS is now built with Go 1.21 which no longer supports Windows 7. However, Git for Windows still wants to support Windows 7. Ideally, Git LFS would re-introduce Windows 7 support until Git for Windows drops support for Windows 7, but that's not going to happen: git-for-windows#4996 (comment) The next best thing we can do is to let the users know what is happening, and how to get out of their fix, at least. This is not quite as easy as it would first seem because programs compiled with Go 1.21 or newer will simply throw an exception and fail with an Access Violation on Windows 7. The only way I found to address this is to replicate the logic from Go's very own `version` command (which can determine the Go version with which a given executable was built) to detect the situation, and in that case offer a helpful error message. This addresses git-for-windows#4996. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
c99be51 to
3324d3b
Compare
|
/add relnote bug Git LFS v3.5.x and newer no longer support Windows 7. Instead of a helpful error message, it now simply crashes on that Windows version, leaving the user with the error message "panic before malloc heap initialized". This has been addressed: In addition to the unhelpful error message, Git is now saying what is going on and how to get out of the situation. The workflow run was started |
Git LFS v3.5.x and newer no longer support Windows 7. Instead of a helpful error message, it now simply [crashes](git-for-windows/git#4996) on that Windows version, leaving the user with the error message "panic before malloc heap initialized". This has been [addressed](git-for-windows/git#5042): In addition to the unhelpful error message, Git is now saying what is going on and how to get out of the situation. Signed-off-by: gitforwindowshelper[bot] <gitforwindowshelper-bot@users.noreply.github.com>
Git LFS is now built with Go 1.21 which no longer supports Windows 7. However, Git for Windows still wants to support Windows 7. Ideally, Git LFS would re-introduce Windows 7 support until Git for Windows drops support for Windows 7, but that's [not going to happen](#4996 (comment)). The next best thing we can do is to let the users know what is happening, and how to get out of their fix, at least. This is not quite as easy as it would first seem because programs compiled with Go 1.21 or newer will simply throw an exception and fail with an Access Violation on Windows 7. The only way I found to address this is to replicate the logic from Go's very own `version` command (which can determine the Go version with which a given executable was built) to detect the situation, and in that case offer a helpful error message. This addresses #4996. /cc @chrisd8088
Git LFS is now built with Go 1.21 which no longer supports Windows 7. However, Git for Windows still wants to support Windows 7. Ideally, Git LFS would re-introduce Windows 7 support until Git for Windows drops support for Windows 7, but that's [not going to happen](#4996 (comment)). The next best thing we can do is to let the users know what is happening, and how to get out of their fix, at least. This is not quite as easy as it would first seem because programs compiled with Go 1.21 or newer will simply throw an exception and fail with an Access Violation on Windows 7. The only way I found to address this is to replicate the logic from Go's very own `version` command (which can determine the Go version with which a given executable was built) to detect the situation, and in that case offer a helpful error message. This addresses #4996. /cc @chrisd8088
Git LFS is now built with Go 1.21 which no longer supports Windows 7. However, Git for Windows still wants to support Windows 7. Ideally, Git LFS would re-introduce Windows 7 support until Git for Windows drops support for Windows 7, but that's [not going to happen](#4996 (comment)). The next best thing we can do is to let the users know what is happening, and how to get out of their fix, at least. This is not quite as easy as it would first seem because programs compiled with Go 1.21 or newer will simply throw an exception and fail with an Access Violation on Windows 7. The only way I found to address this is to replicate the logic from Go's very own `version` command (which can determine the Go version with which a given executable was built) to detect the situation, and in that case offer a helpful error message. This addresses #4996. /cc @chrisd8088
Git LFS is now built with Go 1.21 which no longer supports Windows 7. However, Git for Windows still wants to support Windows 7. Ideally, Git LFS would re-introduce Windows 7 support until Git for Windows drops support for Windows 7, but that's [not going to happen](#4996 (comment)). The next best thing we can do is to let the users know what is happening, and how to get out of their fix, at least. This is not quite as easy as it would first seem because programs compiled with Go 1.21 or newer will simply throw an exception and fail with an Access Violation on Windows 7. The only way I found to address this is to replicate the logic from Go's very own `version` command (which can determine the Go version with which a given executable was built) to detect the situation, and in that case offer a helpful error message. This addresses #4996. /cc @chrisd8088
Git LFS is now built with Go 1.21 which no longer supports Windows 7. However, Git for Windows still wants to support Windows 7. Ideally, Git LFS would re-introduce Windows 7 support until Git for Windows drops support for Windows 7, but that's [not going to happen](#4996 (comment)). The next best thing we can do is to let the users know what is happening, and how to get out of their fix, at least. This is not quite as easy as it would first seem because programs compiled with Go 1.21 or newer will simply throw an exception and fail with an Access Violation on Windows 7. The only way I found to address this is to replicate the logic from Go's very own `version` command (which can determine the Go version with which a given executable was built) to detect the situation, and in that case offer a helpful error message. This addresses #4996. /cc @chrisd8088
Git LFS is now built with Go 1.21 which no longer supports Windows 7. However, Git for Windows still wants to support Windows 7. Ideally, Git LFS would re-introduce Windows 7 support until Git for Windows drops support for Windows 7, but that's [not going to happen](#4996 (comment)). The next best thing we can do is to let the users know what is happening, and how to get out of their fix, at least. This is not quite as easy as it would first seem because programs compiled with Go 1.21 or newer will simply throw an exception and fail with an Access Violation on Windows 7. The only way I found to address this is to replicate the logic from Go's very own `version` command (which can determine the Go version with which a given executable was built) to detect the situation, and in that case offer a helpful error message. This addresses #4996. /cc @chrisd8088
Git LFS is now built with Go 1.21 which no longer supports Windows 7. However, Git for Windows still wants to support Windows 7. Ideally, Git LFS would re-introduce Windows 7 support until Git for Windows drops support for Windows 7, but that's [not going to happen](#4996 (comment)). The next best thing we can do is to let the users know what is happening, and how to get out of their fix, at least. This is not quite as easy as it would first seem because programs compiled with Go 1.21 or newer will simply throw an exception and fail with an Access Violation on Windows 7. The only way I found to address this is to replicate the logic from Go's very own `version` command (which can determine the Go version with which a given executable was built) to detect the situation, and in that case offer a helpful error message. This addresses #4996. /cc @chrisd8088
Git LFS is now built with Go 1.21 which no longer supports Windows 7. However, Git for Windows still wants to support Windows 7. Ideally, Git LFS would re-introduce Windows 7 support until Git for Windows drops support for Windows 7, but that's [not going to happen](#4996 (comment)). The next best thing we can do is to let the users know what is happening, and how to get out of their fix, at least. This is not quite as easy as it would first seem because programs compiled with Go 1.21 or newer will simply throw an exception and fail with an Access Violation on Windows 7. The only way I found to address this is to replicate the logic from Go's very own `version` command (which can determine the Go version with which a given executable was built) to detect the situation, and in that case offer a helpful error message. This addresses #4996. /cc @chrisd8088
Git LFS is now built with Go 1.21 which no longer supports Windows 7. However, Git for Windows still wants to support Windows 7. Ideally, Git LFS would re-introduce Windows 7 support until Git for Windows drops support for Windows 7, but that's [not going to happen](#4996 (comment)). The next best thing we can do is to let the users know what is happening, and how to get out of their fix, at least. This is not quite as easy as it would first seem because programs compiled with Go 1.21 or newer will simply throw an exception and fail with an Access Violation on Windows 7. The only way I found to address this is to replicate the logic from Go's very own `version` command (which can determine the Go version with which a given executable was built) to detect the situation, and in that case offer a helpful error message. This addresses #4996. /cc @chrisd8088
Git LFS is now built with Go 1.21 which no longer supports Windows 7. However, Git for Windows still wants to support Windows 7. Ideally, Git LFS would re-introduce Windows 7 support until Git for Windows drops support for Windows 7, but that's [not going to happen](#4996 (comment)). The next best thing we can do is to let the users know what is happening, and how to get out of their fix, at least. This is not quite as easy as it would first seem because programs compiled with Go 1.21 or newer will simply throw an exception and fail with an Access Violation on Windows 7. The only way I found to address this is to replicate the logic from Go's very own `version` command (which can determine the Go version with which a given executable was built) to detect the situation, and in that case offer a helpful error message. This addresses #4996. /cc @chrisd8088
Git LFS is now built with Go 1.21 which no longer supports Windows 7. However, Git for Windows still wants to support Windows 7. Ideally, Git LFS would re-introduce Windows 7 support until Git for Windows drops support for Windows 7, but that's [not going to happen](#4996 (comment)). The next best thing we can do is to let the users know what is happening, and how to get out of their fix, at least. This is not quite as easy as it would first seem because programs compiled with Go 1.21 or newer will simply throw an exception and fail with an Access Violation on Windows 7. The only way I found to address this is to replicate the logic from Go's very own `version` command (which can determine the Go version with which a given executable was built) to detect the situation, and in that case offer a helpful error message. This addresses #4996. /cc @chrisd8088
Git for Windows dropped Windows 7 support a long time ago. There is a patch (introduced in #5042 and in #5059) to detect when Git LFS failed to start because of lack of Windows 7 support (which was lost somewhat surprisingly, via a Go upgrade that slipped that change in), and to provid a helpful message to the user in that instance. Since Git for Windows itself does not support Windows 7 anymore, that patch is no longer necessary, either.
Git for Windows dropped Windows 7 support a long time ago. There is a patch (introduced in #5042 and in #5059) to detect when Git LFS failed to start because of lack of Windows 7 support (which was lost somewhat surprisingly, via a Go upgrade that slipped that change in), and to provid a helpful message to the user in that instance. Since Git for Windows itself does not support Windows 7 anymore, that patch is no longer necessary, either.
Git for Windows dropped Windows 7 support a long time ago. There is a patch (introduced in #5042 and in #5059) to detect when Git LFS failed to start because of lack of Windows 7 support (which was lost somewhat surprisingly, via a Go upgrade that slipped that change in), and to provid a helpful message to the user in that instance. Since Git for Windows itself does not support Windows 7 anymore, that patch is no longer necessary, either.
Git for Windows dropped Windows 7 support a long time ago. There is a patch (introduced in #5042 and in #5059) to detect when Git LFS failed to start because of lack of Windows 7 support (which was lost somewhat surprisingly, via a Go upgrade that slipped that change in), and to provid a helpful message to the user in that instance. Since Git for Windows itself does not support Windows 7 anymore, that patch is no longer necessary, either.
Git for Windows dropped Windows 7 support a long time ago. There is a patch (introduced in #5042 and in #5059) to detect when Git LFS failed to start because of lack of Windows 7 support (which was lost somewhat surprisingly, via a Go upgrade that slipped that change in), and to provid a helpful message to the user in that instance. Since Git for Windows itself does not support Windows 7 anymore, that patch is no longer necessary, either.
Git for Windows dropped Windows 7 support a long time ago. There is a patch (introduced in #5042 and in #5059) to detect when Git LFS failed to start because of lack of Windows 7 support (which was lost somewhat surprisingly, via a Go upgrade that slipped that change in), and to provid a helpful message to the user in that instance. Since Git for Windows itself does not support Windows 7 anymore, that patch is no longer necessary, either.
Git for Windows dropped Windows 7 support a long time ago. There is a patch (introduced in #5042 and in #5059) to detect when Git LFS failed to start because of lack of Windows 7 support (which was lost somewhat surprisingly, via a Go upgrade that slipped that change in), and to provid a helpful message to the user in that instance. Since Git for Windows itself does not support Windows 7 anymore, that patch is no longer necessary, either.
Git for Windows dropped Windows 7 support a long time ago. There is a patch (introduced in #5042 and in #5059) to detect when Git LFS failed to start because of lack of Windows 7 support (which was lost somewhat surprisingly, via a Go upgrade that slipped that change in), and to provid a helpful message to the user in that instance. Since Git for Windows itself does not support Windows 7 anymore, that patch is no longer necessary, either.
Git for Windows dropped Windows 7 support a long time ago. There is a patch (introduced in #5042 and in #5059) to detect when Git LFS failed to start because of lack of Windows 7 support (which was lost somewhat surprisingly, via a Go upgrade that slipped that change in), and to provid a helpful message to the user in that instance. Since Git for Windows itself does not support Windows 7 anymore, that patch is no longer necessary, either.
Git for Windows dropped Windows 7 support a long time ago. There is a patch (introduced in #5042 and in #5059) to detect when Git LFS failed to start because of lack of Windows 7 support (which was lost somewhat surprisingly, via a Go upgrade that slipped that change in), and to provid a helpful message to the user in that instance. Since Git for Windows itself does not support Windows 7 anymore, that patch is no longer necessary, either.
Git for Windows dropped Windows 7 support a long time ago. There is a patch (introduced in #5042 and in #5059) to detect when Git LFS failed to start because of lack of Windows 7 support (which was lost somewhat surprisingly, via a Go upgrade that slipped that change in), and to provid a helpful message to the user in that instance. Since Git for Windows itself does not support Windows 7 anymore, that patch is no longer necessary, either.
Git for Windows dropped Windows 7 support a long time ago. There is a patch (introduced in #5042 and in #5059) to detect when Git LFS failed to start because of lack of Windows 7 support (which was lost somewhat surprisingly, via a Go upgrade that slipped that change in), and to provid a helpful message to the user in that instance. Since Git for Windows itself does not support Windows 7 anymore, that patch is no longer necessary, either.
Git for Windows dropped Windows 7 support a long time ago. There is a patch (introduced in #5042 and in #5059) to detect when Git LFS failed to start because of lack of Windows 7 support (which was lost somewhat surprisingly, via a Go upgrade that slipped that change in), and to provid a helpful message to the user in that instance. Since Git for Windows itself does not support Windows 7 anymore, that patch is no longer necessary, either.
Git for Windows dropped Windows 7 support a long time ago. There is a patch (introduced in #5042 and in #5059) to detect when Git LFS failed to start because of lack of Windows 7 support (which was lost somewhat surprisingly, via a Go upgrade that slipped that change in), and to provid a helpful message to the user in that instance. Since Git for Windows itself does not support Windows 7 anymore, that patch is no longer necessary, either.
Git for Windows dropped Windows 7 support a long time ago. There is a patch (introduced in #5042 and in #5059) to detect when Git LFS failed to start because of lack of Windows 7 support (which was lost somewhat surprisingly, via a Go upgrade that slipped that change in), and to provid a helpful message to the user in that instance. Since Git for Windows itself does not support Windows 7 anymore, that patch is no longer necessary, either.
Git for Windows dropped Windows 7 support a long time ago. There is a patch (introduced in #5042 and in #5059) to detect when Git LFS failed to start because of lack of Windows 7 support (which was lost somewhat surprisingly, via a Go upgrade that slipped that change in), and to provid a helpful message to the user in that instance. Since Git for Windows itself does not support Windows 7 anymore, that patch is no longer necessary, either.
Git for Windows dropped Windows 7 support a long time ago. There is a patch (introduced in #5042 and in #5059) to detect when Git LFS failed to start because of lack of Windows 7 support (which was lost somewhat surprisingly, via a Go upgrade that slipped that change in), and to provid a helpful message to the user in that instance. Since Git for Windows itself does not support Windows 7 anymore, that patch is no longer necessary, either.
Git for Windows dropped Windows 7 support a long time ago. There is a patch (introduced in #5042 and in #5059) to detect when Git LFS failed to start because of lack of Windows 7 support (which was lost somewhat surprisingly, via a Go upgrade that slipped that change in), and to provid a helpful message to the user in that instance. Since Git for Windows itself does not support Windows 7 anymore, that patch is no longer necessary, either.
Git for Windows dropped Windows 7 support a long time ago. There is a patch (introduced in #5042 and in #5059) to detect when Git LFS failed to start because of lack of Windows 7 support (which was lost somewhat surprisingly, via a Go upgrade that slipped that change in), and to provid a helpful message to the user in that instance. Since Git for Windows itself does not support Windows 7 anymore, that patch is no longer necessary, either.
Git for Windows dropped Windows 7 support a long time ago. There is a patch (introduced in #5042 and in #5059) to detect when Git LFS failed to start because of lack of Windows 7 support (which was lost somewhat surprisingly, via a Go upgrade that slipped that change in), and to provid a helpful message to the user in that instance. Since Git for Windows itself does not support Windows 7 anymore, that patch is no longer necessary, either.
Git for Windows dropped Windows 7 support a long time ago. There is a patch (introduced in #5042 and in #5059) to detect when Git LFS failed to start because of lack of Windows 7 support (which was lost somewhat surprisingly, via a Go upgrade that slipped that change in), and to provid a helpful message to the user in that instance. Since Git for Windows itself does not support Windows 7 anymore, that patch is no longer necessary, either.
Git for Windows dropped Windows 7 support a long time ago. There is a patch (introduced in #5042 and in #5059) to detect when Git LFS failed to start because of lack of Windows 7 support (which was lost somewhat surprisingly, via a Go upgrade that slipped that change in), and to provid a helpful message to the user in that instance. Since Git for Windows itself does not support Windows 7 anymore, that patch is no longer necessary, either.
Git for Windows dropped Windows 7 support a long time ago. There is a patch (introduced in #5042 and in #5059) to detect when Git LFS failed to start because of lack of Windows 7 support (which was lost somewhat surprisingly, via a Go upgrade that slipped that change in), and to provid a helpful message to the user in that instance. Since Git for Windows itself does not support Windows 7 anymore, that patch is no longer necessary, either.
Git for Windows dropped Windows 7 support a long time ago. There is a patch (introduced in #5042 and in #5059) to detect when Git LFS failed to start because of lack of Windows 7 support (which was lost somewhat surprisingly, via a Go upgrade that slipped that change in), and to provid a helpful message to the user in that instance. Since Git for Windows itself does not support Windows 7 anymore, that patch is no longer necessary, either.
Git for Windows dropped Windows 7 support a long time ago. There is a patch (introduced in #5042 and in #5059) to detect when Git LFS failed to start because of lack of Windows 7 support (which was lost somewhat surprisingly, via a Go upgrade that slipped that change in), and to provid a helpful message to the user in that instance. Since Git for Windows itself does not support Windows 7 anymore, that patch is no longer necessary, either.
Git for Windows dropped Windows 7 support a long time ago. There is a patch (introduced in #5042 and in #5059) to detect when Git LFS failed to start because of lack of Windows 7 support (which was lost somewhat surprisingly, via a Go upgrade that slipped that change in), and to provid a helpful message to the user in that instance. Since Git for Windows itself does not support Windows 7 anymore, that patch is no longer necessary, either.
Git for Windows dropped Windows 7 support a long time ago. There is a patch (introduced in #5042 and in #5059) to detect when Git LFS failed to start because of lack of Windows 7 support (which was lost somewhat surprisingly, via a Go upgrade that slipped that change in), and to provid a helpful message to the user in that instance. Since Git for Windows itself does not support Windows 7 anymore, that patch is no longer necessary, either.
Git for Windows dropped Windows 7 support a long time ago. There is a patch (introduced in #5042 and in #5059) to detect when Git LFS failed to start because of lack of Windows 7 support (which was lost somewhat surprisingly, via a Go upgrade that slipped that change in), and to provid a helpful message to the user in that instance. Since Git for Windows itself does not support Windows 7 anymore, that patch is no longer necessary, either.
Git for Windows dropped Windows 7 support a long time ago. There is a patch (introduced in #5042 and in #5059) to detect when Git LFS failed to start because of lack of Windows 7 support (which was lost somewhat surprisingly, via a Go upgrade that slipped that change in), and to provid a helpful message to the user in that instance. Since Git for Windows itself does not support Windows 7 anymore, that patch is no longer necessary, either.
Git for Windows dropped Windows 7 support a long time ago. There is a patch (introduced in #5042 and in #5059) to detect when Git LFS failed to start because of lack of Windows 7 support (which was lost somewhat surprisingly, via a Go upgrade that slipped that change in), and to provid a helpful message to the user in that instance. Since Git for Windows itself does not support Windows 7 anymore, that patch is no longer necessary, either.

Git LFS is now built with Go 1.21 which no longer supports Windows 7. However, Git for Windows still wants to support Windows 7.
Ideally, Git LFS would re-introduce Windows 7 support until Git for Windows drops support for Windows 7, but that's not going to happen.
The next best thing we can do is to let the users know what is happening, and how to get out of their fix, at least.
This is not quite as easy as it would first seem because programs compiled with Go 1.21 or newer will simply throw an exception and fail with an Access Violation on Windows 7.
The only way I found to address this is to replicate the logic from Go's very own
versioncommand (which can determine the Go version with which a given executable was built) to detect the situation, and in that case offer a helpful error message.This addresses #4996.
/cc @chrisd8088