From: Johannes Sixt <j6t@kdbg.org>
To: Stepan Kasal <kasal@ucw.cz>
Cc: GIT Mailing-list <git@vger.kernel.org>,
msysGit <msysgit@googlegroups.com>,
Karsten Blees <blees@dcon.de>
Subject: Re: [PATCH v2 5/6] Win32: Thread-safe windows console output
Date: Fri, 13 Jun 2014 08:10:57 +0200 [thread overview]
Message-ID: <539A95F1.9030900@kdbg.org> (raw)
In-Reply-To: <1402127845-4862-6-git-send-email-kasal@ucw.cz>
Am 07.06.2014 09:57, schrieb Stepan Kasal:
> From: Karsten Blees <blees@dcon.de>
> Date: Sat, 14 Jan 2012 22:24:19 +0100
>
> Winansi.c has many static variables that are accessed and modified from
> the [v][f]printf / fputs functions overridden in the file. This may cause
> multi threaded git commands that print to the console to produce corrupted
> output or even crash.
>
> Additionally, winansi.c doesn't override all functions that can be used to
> print to the console (e.g. fwrite, write, fputc are missing), so that ANSI
> escapes don't work properly for some git commands (e.g. git-grep).
>
> Instead of doing ANSI emulation in just a few wrapped functions on top of
> the IO API, let's plug into the IO system and take advantage of the thread
> safety inherent to the IO system.
>
> Redirect stdout and stderr to a pipe if they point to the console. A
> background thread reads from the pipe, handles ANSI escape sequences and
> UTF-8 to UTF-16 conversion, then writes to the console.
There's something fishy with this patch. Please checkout and build
eac14f8909d9. Then run t5000-tar-tree.sh like so from a CMD prompt:
sh t5000-tar-tree.sh -v -i
Notice that in test 36 (invoke tar filter by extension) the tar file is
written to the console instead of the file. Hit Ctrl-C to interrupt the
test; do not remove the trash directory. You can verify the incorrect
behavior like this:
cd "t\trash directory.t5000-tar-tree"
..\..\git archive -o config-implicit.tar.foo HEAD
It writes the tar file to the console. When you build the parent commit,
and repeat these two commands, there is no unexpected console output.
The patch fcd428f4a952 (Win32: fix broken pipe detection) does not fix the
incorrect behavior.
I haven't dug (and won't dig) deeper than that.
-- Hannes
--
--
*** Please reply-to-all at all times ***
*** (do not pretend to know who is subscribed and who is not) ***
*** Please avoid top-posting. ***
The msysGit Wiki is here: https://github.com/msysgit/msysgit/wiki - Github accounts are free.
You received this message because you are subscribed to the Google
Groups "msysGit" group.
To post to this group, send email to msysgit@googlegroups.com
To unsubscribe from this group, send email to
msysgit+unsubscribe@googlegroups.com
For more options, and view previous threads, visit this group at
http://groups.google.com/group/msysgit?hl=en_US?hl=en
---
You received this message because you are subscribed to the Google Groups "msysGit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to msysgit+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
next prev parent reply other threads:[~2014-06-13 6:11 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-06 13:42 [PATCH 0/5] First part of Unicode console support for msysgit Stepan Kasal
2014-06-06 13:42 ` [PATCH 1/5] Support Unicode console output on Windows Stepan Kasal
2014-06-06 13:42 ` [PATCH 2/5] Detect console streams more reliably " Stepan Kasal
2014-06-06 13:42 ` [PATCH 3/5] Warn if the Windows console font doesn't support Unicode Stepan Kasal
2014-06-06 21:18 ` Peter Krefting
2014-06-07 7:02 ` Stepan Kasal
2014-06-06 13:42 ` [PATCH 4/5] Win32: move main macro to a function Stepan Kasal
2014-06-06 13:42 ` [PATCH 5/5] Win32: Thread-safe windows console output Stepan Kasal
2014-06-06 21:29 ` Peter Krefting
2014-06-06 22:03 ` Karsten Blees
2014-06-06 17:44 ` [PATCH 0/5] First part of Unicode console support for msysgit Karsten Blees
2014-06-06 18:39 ` Stepan Kasal
2014-06-07 7:57 ` [PATCH v2 0/6] " Stepan Kasal
2014-06-07 7:57 ` [PATCH v2 1/6] Support Unicode console output on Windows Stepan Kasal
2014-06-07 7:57 ` [PATCH v2 2/6] Detect console streams more reliably " Stepan Kasal
2014-06-07 7:57 ` [PATCH v2 3/6] Warn if the Windows console font doesn't support Unicode Stepan Kasal
2014-06-07 7:57 ` [PATCH v2 4/6] Win32: add Unicode conversion functions Stepan Kasal
2014-06-07 7:57 ` [PATCH v2 5/6] Win32: Thread-safe windows console output Stepan Kasal
2014-06-13 6:10 ` Johannes Sixt [this message]
2014-06-13 22:09 ` [PATCH 7/6] Win32: reliably detect console pipe handles Karsten Blees
2014-06-07 7:57 ` [PATCH v2 6/6] Win32: fix broken pipe detection Stepan Kasal
2014-06-06 20:48 ` Re: [PATCH 0/5] First part of Unicode console support for msysgit Stepan Kasal
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=539A95F1.9030900@kdbg.org \
--to=j6t@kdbg.org \
--cc=blees@dcon.de \
--cc=git@vger.kernel.org \
--cc=kasal@ucw.cz \
--cc=msysgit@googlegroups.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.