-
Notifications
You must be signed in to change notification settings - Fork 27
fail - always read stdout and stderr from forked commands #13
Comments
It would be real helpful if you could investigate further, i.e. compile Git-Cheetah (using the msysGit net installer) with debug messages that show where it hangs.
Patches welcome. |
Of course. I just need to get the next release of ComposerSetup out and am waiting on a response on the msysGit mailing list to finish off: https://groups.google.com/forum/#!topic/msysgit/P7a2MVF0ok8
No problem, but I couldn't see the point of patching something that doesn't work at this stage. |
Thanks for the bump, I responded to that mail. BTW I did not realize that you are a contributor because I completely forgot to add you to the GitHub team! Sorry! This is fixed now. |
@johnstevenson is this addressed by #14? |
No, it still hangs. Sorry, I haven't had a chance to look at this yet. |
@johnstevenson even after pulling |
Sadly, yes. Tested with master at da97444 |
Bummer. I actually got a chance to test this myself and I can reproduce. Darn. I'm out of Git time budget this week (thanks to some non-fun administrativa yesterday). |
Could you please give #15 a try? |
Sorry, but it still hangs - I haven't had the chance to debug it yet. More worryingly, it crashes Explorer/Far Manager when you click on the Git Bash entry. Note that I have built the dll with Visual Studio and it crashes calling |
Whoa. It does not do that here. (I built with gcc.) Do you have any idea what parameters To be precise, for me it only fixed things in Explorer if I killed the Explorer and restarted it. The usual |
To be clear, how does "killing Explorer and restarting it" fix anything? If Explorer is hanging, blocking on some call or another expecting some I/O or something, I believe that's the whole point of the issue. Those of us who do use the Explorer context menu find that unacceptable. For me, it's a pain, but there's a workaround. Would be nice if it worked through context menu as well, but can be dealt with other ways. Thank you... |
It fixes Explorer's failure to pick up an updated Cheetah. |
Okay. Well, I am not a Git Cheetah much less shell extension Subject Matter Expert. But something tells me as an extension, Git Cheetah is to blame, not Explorer. |
@mwpowellhtx I take it you did not build the code from this pull request. |
I'm just reporting the bug. It sounds like it's already been fixed. You should discuss that issue with the authors of the fix. |
@mwpowellhtx you claimed that you wanted to be an official contributor. Contributors contribute code, test fixes and help others with their issues. BTW I am in contact with the author of the fix. The author is yours truly. |
I was under the impression there was not already a fix available. What I proposed was counting the cost, not committing whether I would. But since there already is fix, I expect you are testing your own code. That is all. |
Calling The function has been passed the
|
@mwpowellhtx will you be contributing something else than words, too? Of course you must test the fix on your side, otherwise you risk that your problem is not fixed. It is a bit sad that this does not go without saying. |
@johnstevenson whoops. you're right, I just force-pushed a new version; could you please give this one a try, too? |
Okay, we are not crashing Explorer now by calling Git Bash. We are still causing Far Manager to hang forever, if you try and switch branches for example. This all seems extraordinarily complicated - if we want to invoke Git Bash from the context-menu why can't we use a simple ShellExecute? |
@johnstevenson in the short run, it would help fix things, I agree, but in the long run we have an incredible technical debt: Git-Cheetah is supposed to be cross-platform. I will have a look at the switching branches problem next week if nobody beats me to it. |
@johnstevenson I invested half of today's Git time budget to try to reproduce the failure you described, but I failed! FarManager does not hang here if I switch branches. It does exactly what I want it to do, and it is actually very fast doing it. To recapitulate what I did:
Since I have a 64-bit VM and a 32-bit Far Manager running inside, I did not pass the To make sure everything is still groovy here, I also ran If this still does not work for you, I really need to ask you to look deeper into the issue because I have no way to reproduce the problem here anymore (at least not after my most recent update to the |
I am in the process of setting up a new dev box, so could you zip and email On 25 March 2014 13:19, dscho notifications@github.com wrote:
|
Thanks. You will be pleased to know that this was a vs compile issue. Your Strangely, my vs 32 and 64-bit dlls also work fine on Win 8.1 64 (in both Sorry to have used up your time on this (though I have spent quite a bit |
Thank you so much @johnstevenson! I do appreciate all the help you provided, and I would like to ask for a little more: do you think you can dig deeper into the MSVC problem? I am really, really curious what goes wrong there (even if I am unlikely to compile Cheetah with anything but gcc anytime soon). |
Don't worry, I do not need appreciation! I just couldn't resist a little banter regarding your, understandably, precious git time. I am part way through an output-redirection implementation in a Win32 stylee, just to prove to myself that it is/is not a case of Far manager waiting for an unclosed/unreadable pipe. So we will see what that will bring. Otherwise I am at a bit of a loss as to why this happens. |
As I had half expected it is an output redirection issue (possibly due to a bad CRT implementation). Using Win32 handles rather than C file-descriptors cures the problem with an MSVC build - ie Far Manager does not hang on Vista 32. https://github.com/johnstevenson/Git-Cheetah/tree/winexec I can only assume that the reason the normal (ie using C file-descriptors) MSVC builds work on Windows 8.1 is that the OS must intervene in some way and tidy up the handles. Of course, this is only a wild guess. I have also tested building on VS2012 and VS2013 in case the CRT had changed, but to no avail. What a shame, because using VS is a quick way to get up and running to test and debug the extension. At least, that is how I got involved. |
@johnstevenson this is really good stuff! And I think we can get this into a real nice shape and include it in Git-Cheetah. As you know, I am interested in maintaining the cross-platform nature of Git-Cheetah, but that is easy! All we need to do is modify your code slightly to offer a drop-in replacement for the function What do you think? |
Just in case you're okay with that plan, I started working on it: master...winexec (but got interrupted; will continue later). |
Yes I am fine with it - thanks for setting up and re-formatting. Have you got any code guidelines - tabs or spaces, function names etc? How is this going to work? I want to make a slight improvement to the code, so I guess a PR is the best way? |
Forget the above (a plan to use This does not happen on VS2012. |
Good point you remind me of: I wanted to ask whether you can make sure it compiles on VS, and works, still... Regarding the Line 1 in fb6e62f
If you're okay with it, I would push this branch (with just one addition I just made to make it link with |
Oh, as to coding style, I tried to follow https://github.com/msysgit/git/blob/master/Documentation/CodingGuidelines, but not too strictly. I do care about tabs instead of spaces because having mixed indentation makes rebasing and merging a major PITA. Likewise, I think it makes sense to keep with the convention of putting the opening curly brackets on the end of the same line as the |
It looks lovely! Actually it did subsequently build without the #pragma line (huh!) but it would be good to keep to avoid the warning (and make the Intelli bit work). Compiles on VS 2010 and works with Far Manager on Vista 32. Haven't tested 64-bit. Incidentally, you can drop the I changed the code in |
Merged! Your |
Oh yeah, I should close this ticket, too ;-) |
Eeek! I am not freeing Line 43 in fb6e62f
Thanks for the code guidelines. I did look there but was once told off by one of the msysgit guys for using spaces in a file that had 80% spaces and 20% tabs! So I was not sure. You can happily remove my braces from single-line code-blocks if you wish. |
Yeah, for a long-running shell extension, this can cause problems. Would you care for fixing this in a pull request, please? I ran out of Git time today...
I hope it was not me. If it was, I apologize and hope that you will be happy to learn that I am much nicer now.
As I said, I am not a stickler for that because it does not cause merge conflicts. Most of the time ;-) |
No it wasn't you (and it was only a minor, if somewhat baffling, reprimand). You have always been very pleasant - although you do have an annoying knack of getting me to do stuff !! I have actually learned a lot, so thanks. |
Awesome work, thanks! |
@johnstevenson if that is the only thing you find annoying with me, I can live with that :-) |
This PR #11 fails and hangs Far Manager when a Git menu command is clicked. Tested on Vista (x86).
So the problem must be with the pipes/redirected output since it works pre PR, albeit reporting spurious error messages. Maybe it is waiting on a duplicated handle that should have been closed? Perhaps it combines stdout and stderr.
Incidentally, this will not actually compile in Visual Studio because the
*debug
variable is not declared at the beginning of theexec_program_v
function which MSVC requires for .c files.The text was updated successfully, but these errors were encountered: