-
Notifications
You must be signed in to change notification settings - Fork 555
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
windows sysopen() fails to open file larger than 2**32 bytes #12227
Comments
From villek@matrixscience.comThis is a bug report for perl from villek@matrixscience.com, When I try to sysopen() a file larger than 2**32 bytes on The same problem persists on Windows Server 2003 and Server 2008 It's easy to reproduce (the first command creates an empty file of C:\Users\villek>perl -e "open(my C:\Users\villek>perl -MFcntl -e "sysopen(my $fh, 'test.file', O_RDWR C:\Users\villek>perl -e "open(my Expected result: the second and third command should open the file Perl Info
|
From villek@matrixscience.comI have run the test case on the following Windows platforms and XP Pro x64 SP2, ActivePerl 5.14.2 (64-bit) XP Pro x64 SP2, ActivePerl 5.10.1 (64-bit) XP Pro x32 SP3, ActivePerl 5.14.2 (32-bit) XP Pro x32 SP3, ActivePerl 5.12.4 (32-bit) XP Pro x32 SP3, ActivePerl 5.10.1 (32-bit) XP Pro x32 SP3, ActivePerl 5.8.9 (32-bit) Server 2003 R2 SP2 x64, ActivePerl 5.14.2 (32-bit) Server 2003 R2 SP2 x64, ActivePerl 5.10.1 (64-bit) Server 2003 R2 SP2 x64, ActivePerl 5.8.8 (32-bit) Server 2008 Standard SP1 x32, ActivePerl 5.12.4 (32-bit) 7 Ultimate x64, ActivePerl 5.14.2 (64-bit) 7 Ultimate x64, ActivePerl 5.12.4 (32-bit) 7 Ultimate x64, ActivePerl 5.12.4 (64-bit) 7 Ultimate x64, ActivePerl 5.10.1 (32-bit) 7 Ultimate x64, ActivePerl 5.10.1 (64-bit) Linux versions are fine: Debian 6.0.5 x64, Perl 5.10.1 (64-bit) CentOS 4.6 x64, Perl 5.14.0 (64-bit) CentOS 4.6 x64, Perl 5.12.0 (64-bit) CentOS 4.6 x64, Perl 5.10.0 (64-bit) CentOS 4.6 x64, Perl 5.8.7 (64-bit) Strangely, in production code on Windows Server 2008, sysopen() fails |
From [Unknown Contact. See original ticket]I have run the test case on the following Windows platforms and XP Pro x64 SP2, ActivePerl 5.14.2 (64-bit) XP Pro x64 SP2, ActivePerl 5.10.1 (64-bit) XP Pro x32 SP3, ActivePerl 5.14.2 (32-bit) XP Pro x32 SP3, ActivePerl 5.12.4 (32-bit) XP Pro x32 SP3, ActivePerl 5.10.1 (32-bit) XP Pro x32 SP3, ActivePerl 5.8.9 (32-bit) Server 2003 R2 SP2 x64, ActivePerl 5.14.2 (32-bit) Server 2003 R2 SP2 x64, ActivePerl 5.10.1 (64-bit) Server 2003 R2 SP2 x64, ActivePerl 5.8.8 (32-bit) Server 2008 Standard SP1 x32, ActivePerl 5.12.4 (32-bit) 7 Ultimate x64, ActivePerl 5.14.2 (64-bit) 7 Ultimate x64, ActivePerl 5.12.4 (32-bit) 7 Ultimate x64, ActivePerl 5.12.4 (64-bit) 7 Ultimate x64, ActivePerl 5.10.1 (32-bit) 7 Ultimate x64, ActivePerl 5.10.1 (64-bit) Linux versions are fine: Debian 6.0.5 x64, Perl 5.10.1 (64-bit) CentOS 4.6 x64, Perl 5.14.0 (64-bit) CentOS 4.6 x64, Perl 5.12.0 (64-bit) CentOS 4.6 x64, Perl 5.10.0 (64-bit) CentOS 4.6 x64, Perl 5.8.7 (64-bit) Strangely, in production code on Windows Server 2008, sysopen() fails |
villek@matrixscience.com - Status changed from 'new' to 'open' |
From tchrist@perl.comWhat open flags are you using? Is this a platform that --tom |
From villek@matrixscience.comOn Fri Jun 29 06:58:30 2012, tom christiansen wrote:
I retried with a few different sets of flags on Windows 7 x64, ActivePerl 5.14.2 (64-bit) C:\Users\villek>perl -MFcntl -e "sysopen(my C:\Users\villek>perl -MFcntl -e "sysopen(my C:\Users\villek>perl -MFcntl -e "sysopen(my C:\Users\villek>perl -MFcntl -e "sysopen(my C:\Users\villek>perl -MFcntl -e "sysopen(my C:\Users\villek>perl -MFcntl -e "sysopen(my So apparently it's restricted to only O_RDWR -- I suppose that's good news. O_LARGEFILE isn't available: C:\Users\villek>perl -MFcntl -e "sysopen(my $fh, 'test.file', O_RDWR | O_LARGEFILE) or die Regards, |
From villek@matrixscience.comI should also point out that everything works fine when test.file is C:\Users\villek>perl -e "open(my C:\Users\villek>perl -MFcntl -e "sysopen(my $fh, 'test.file', O_RDWR) or C:\Users\villek>perl -MFcntl -e "sysopen(my $fh, 'test.file', O_RDWR | And in fact there is something entirely different happening when the C:\Users\villek>perl -e "open(my C:\Users\villek>dir test.file 02/07/2012 10:10 4,294,967,296 test.file C:\Users\villek>perl -MFcntl -e "sysopen(my $fh, 'test.file', O_RDWR) or C:\Users\villek>perl -MFcntl -e "sysopen(my $fh, 'test.file', O_RDWR | C:\Users\villek>perl -MFcntl -e "sysopen(my $fh, 'test.file', O_RDONLY) Regards, |
From @bulk88On Mon Jul 02 02:12:57 2012, villek wrote:
Here is what I got with a x64 Perl with msvcr90.dll version 9.00.30729.1
The script run is my $db = Win32::API->new('kernel32.dll', 'DebugBreak', '', ''); I will not copy paste the CRT code here. In _tsopen_nolock a CreateFileA Args to SetFilePointer are SetFilePointer returns 0x00000000FFFFFFFF (actually 0xFFFFFFFF), which So it is either a bug or limitation in MS CRT's open(). I haven't done In the past the way Win32 Perl has dealt with CRT bugs is to -- |
Can anyone with windows say if this works on newer windows with a file > 2**32 bytes? |
I didn't realise this bug is still open. (I'm the one who originally reported it.) Results from today using Strawberry Perl 5.32 on Windows Server 2019. Commands are run in cmd.exe.
Tests from bug description:
Tests from the 2 July 2012 comment:
The faults are exactly the same as described 10 years ago. And, as pointed out back then, behaviour is OK when file size is 2**32-1:
And when file size is 2**32, behaviour is faulty in the same way as 10 years ago:
|
blead:
(blead built with MSVC from VS 2019) |
Migrated from rt.perl.org#113864 (status was 'open')
Searchable as RT113864$
The text was updated successfully, but these errors were encountered: