Fix #81145: copy() and stream_copy_to_stream() fail for +4GB files#7158
Fix #81145: copy() and stream_copy_to_stream() fail for +4GB files#7158cmb69 wants to merge 5 commits intophp:PHP-7.4from
Conversation
When mapping the file, we need to pass the proper `dwFileOffsetHigh` instead of `0`.
How slow are we talking here? On Linux the test case takes 2s, is it much slower on Windows? |
Takes ~50sec for me. Lets see on CI. (see also https://bugs.php.net/bug.php?id=80695) |
|
Well, seems perf depends: Linux (16s) vs Windows (9s). Anyway, the test makes sense. |
|
FWIW we didn't add a test for https://bugs.php.net/bug.php?id=80523 either |
Co-authored-by: Nikita Popov <nikita.ppv@gmail.com>
|
Test fails on 32-bit Linux:
|
We can't copy files > 4GB there, anyway.
|
Ah, thanks! Need to skip there. |
|
@divinity76, PHP currently only supports some 32bit and 64bit architectures. To support other architectures, would require many more changes, so adapting this test as well shouldn't be hard (there are already ~200 other tests with basically the same SKIPIF clause). |
When mapping the file, we need to pass the proper
dwFileOffsetHighinstead of
0.I'm not sure about adding a regression test. That would be terribly slow, but given that I missed this issue when fixing bug 79423 it might make sense to have one.