Message133837
| Author |
sdaoden |
| Recipients |
ixokai, nadeem.vawda, ned.deily, neologix, pitrou, sdaoden, skrah, vstinner |
| Date |
2011年04月15日.15:20:53 |
| SpamBayes Score |
1.9473312e-13 |
| Marked as misclassified |
No |
| Message-id |
<20110415152034.GA384@sherwood.local> |
| In-reply-to |
| Content |
I was able to spend more time on that this afternoon.
'Got an unkillable diff(1) along the way which required me to
force a cold reboot. Well.
I attach a C version (11277.mmap.c) which i've used for testing.
The file 11277.zsum32.c is a quick-and-dirty C program to
calculate CRC-32 and Adler-32 checksums (i had none for the
latter and maybe you want to test some more, so); it requires zlib.
I also attach 11277.1.diff which updates test/test_zlib.py, though
this is rather useless, because that still results in a bus error.
This is the real interesting thing however, because the C version
actually works quite well for the chosen value, and the resulting
files are identical, as zsum32 shows:
Adler-32 <14b9018b> CRC-32 <c6e340bf> -- test_python_413/@test_413_tmp
Adler-32 <14b9018b> CRC-32 <c6e340bf> -- c-mmap-testfile
I thought
os.fsync(f.fileno())
does the trick because it does it in C (hi, Charles-Francois),
but no.
So what do i come up with?
Nothing. A quick look into 11277.mmap.c will show you this:
/* *Final* sizes (string written after lseek(2): "abcd") */
...
/* Tested good */
//0x100000000 - PAGESIZE - 5,
//0x100000000 - 4,
//0x100000000 - 3,
//0x100000000 - 1,
0x100000000 + PAGESIZE + 4,
//0x100000000 + PAGESIZE + 5,
/* Tested bad */
//0x100000000,
//0x100000000 + PAGESIZE,
//0x100000000 + PAGESIZE + 1,
//0x100000000 + PAGESIZE + 3,
Hm!
Now i have to go but maybe i can do some more testing tomorrow to
answer the question why test_zlib.py fails even though there is
the fsync() and even though the values work in C.
Any comments? |
|