diff options
author | Tamar Christina <tamar@zhox.com> | 2016-05-19 21:48:53 +0200 |
---|---|---|
committer | Tamar Christina <tamar@zhox.com> | 2016-05-19 21:50:18 +0200 |
commit | 1ee47c1bfa35c7be435adaec5c1fa9ec92cc776d (patch) | |
tree | 847fa95c9660bab533ede96135a43d799fadeb6d /libraries/base/tests/IO/T12010/test.T | |
parent | a88bb1b1518389817583290acaebfd6454aa3cec (diff) | |
download | haskell-1ee47c1bfa35c7be435adaec5c1fa9ec92cc776d.tar.gz |
Use the correct return type for Windows' send()/recv() (Fix #12010)
Summary:
They return signed 32 bit ints on Windows, even on a 64 bit OS, rather than
Linux's 64 bit ssize_t. This means when recv() returned -1 to signal an error we
thought it was 4294967295. It was converted to an int, -1 and the buffer was
memcpy'd which caused a segfault. Other bad stuff happened with send()s.
See also note CSsize in System.Posix.Internals.
Add a test for #12010
Test Plan:
- GHC testsuite (T12010)
- http-conduit test (https://github.com/snoyberg/http-client/issues/191)
Reviewers: austin, hvr, bgamari, Phyx
Reviewed By: Phyx
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D2170
GHC Trac Issues: #12010
Diffstat (limited to 'libraries/base/tests/IO/T12010/test.T')
-rw-r--r-- | libraries/base/tests/IO/T12010/test.T | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/libraries/base/tests/IO/T12010/test.T b/libraries/base/tests/IO/T12010/test.T new file mode 100644 index 0000000000..178814fff3 --- /dev/null +++ b/libraries/base/tests/IO/T12010/test.T @@ -0,0 +1,8 @@ +test('T12010', + [ + extra_clean(['cbits/initWinSock.o', 'T12010.hi', 'T12010.hs']), + only_ways(['threaded1']), + extra_ways(['threaded1']), + cmd_prefix('WAY_FLAGS="' + ' '.join(config.way_flags('T12010')['threaded1']) + '"')], + run_command, + ['$MAKE -s --no-print-directory T12010']) |