This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author tim.golden
Recipients amaury.forgeotdarc, kmk, tim.golden, trent
Date 2009-02-16.14:23:38
SpamBayes Score 1.6486812e-14
Marked as misclassified No
Message-id <1234794283.61.0.811071490993.issue2733@psf.upfronthosting.co.za>
In-reply-to
Content
OK, I can see why this is happening and in fact there are two levels of
problem. The trouble is that, in my ignorance, I can't work out exactly
why the existing code is doing what it's doing.

(References to mmapmodule.c at r69666)

Problem 1: At line 456, the CreateFileMapping call is made with 0 hi/lo
size regardless of the file handle. cf line 1358 where it correctly
specifies the size because of the possibility of a -1 file handle. So we
now specify hi/lo values in this call. Without this change we get error
87 (invalid parameter).

Problem 2: The call to SetFilePointer at line 451 passes the hi/lo size
DWORDs. The hi value is in fact an input/output param which receives the
value of the new file pointer if a not-NULL pointer is passed in. Which
it is. This means that the hi value is now different from what it
previously was and causes an error if passed into the CreateFileMapping
call referred to in (1) above. So we make a copy of the value and ignore
the returned value. Without this change we get error 8 (not enough memory).

I'm not entirely sure what the SetFilePointer call is achieving at this
point but I'll put together a patch and a test case and perhaps someone
who understands this better can comment on the matter.
History
Date User Action Args
2009-02-16 14:24:43tim.goldensetrecipients: + tim.golden, amaury.forgeotdarc, kmk, trent
2009-02-16 14:24:43tim.goldensetmessageid: <1234794283.61.0.811071490993.issue2733@psf.upfronthosting.co.za>
2009-02-16 14:23:40tim.goldenlinkissue2733 messages
2009-02-16 14:23:38tim.goldencreate