diff options
author | Tamar Christina <tamar@zhox.com> | 2017-09-25 20:21:39 +0100 |
---|---|---|
committer | Tamar Christina <tamar@zhox.com> | 2017-09-25 20:21:39 +0100 |
commit | 2b2595e03d328f8c49afe55f765635c03dc81865 (patch) | |
tree | 335245c895012a22e07c4394f830859e2afeb6cc /aclocal.m4 | |
parent | 3804a7eb44c01ca91501e726b76b590c193ea126 (diff) | |
download | haskell-2b2595e03d328f8c49afe55f765635c03dc81865.tar.gz |
Ensure text mode when calling debug functions
Summary:
Something seems to be changing stderr into binary mode,
so when the `traceIO` is called, the C code that ultimately
calls `vfprintf` is using a binary mode handle.
This causes newlines not to be encoded properly.
The patch ensures we're in text mode when writing the debug
messages (% interleaving as it's not thread safe at all) and restores
the previous mode when done.
I'm slightly concerned about the performance implications of writing
large dumps out in text mode, but I think the current behavior is not
intended as I cannot see any of the printing code setting the mode of
the std handles.
Test Plan: ./validate
Reviewers: austin, bgamari, erikd, simonmar
Reviewed By: bgamari
Subscribers: rwbarton, thomie
GHC Trac Issues: #14188
Differential Revision: https://phabricator.haskell.org/D4018
Diffstat (limited to 'aclocal.m4')
0 files changed, 0 insertions, 0 deletions