joe9 / cwfs_partial_line Goto Github PK
View Code? Open in Web Editor NEWshow the cwfs partial line bug
show the cwfs partial line bug
Fix: when reading a file being written by pwrite's, loop back to the offset where the null is found This test takes around 300MB space in /tmp/ ; mk clean; mk all ; rm /tmp/test.file /tmp/test.readcontents; touch /tmp/test.file; ./6.reader10 /tmp/test.file /tmp/test.readcontents & echo 'echo kill>/proc/'$apid'/note'; ./6.pwriter10 /tmp/test.file rm -f *.[0568qv] *.a[0568qv] y.tab.? lex.yy.c y.debug y.output [0568qv].??* writer10 reader10 brdstr10 pwriter10 $CLEANFILES 6c -FTVw writer10.c 6c -FTVw reader10.c 6c -FTVw brdstr10.c 6c -FTVw pwriter10.c 6l -o 6.writer10 writer10.6 6l -o 6.reader10 reader10.6 6l -o 6.pwriter10 pwriter10.6 6l -o 6.brdstr10 brdstr10.6 echo kill>/proc/27518709/note iters=53806 n=198 strlen(buf)=176 iters=73726 n=220 strlen(buf)=198 iters=75675 n=220 strlen(buf)=198 iters=77713 n=220 strlen(buf)=198 iters=79835 n=165 strlen(buf)=143 iters=86161 n=242 strlen(buf)=220 iters=88697 n=198 strlen(buf)=176 iters=89770 n=198 strlen(buf)=176 iters=92099 n=231 strlen(buf)=209 iters=93517 n=231 strlen(buf)=209 iters=96050 n=220 strlen(buf)=198 iters=96640 n=198 strlen(buf)=176 iters=100242 n=209 strlen(buf)=187 iters=100430 n=165 strlen(buf)=143 iters=100491 n=198 strlen(buf)=176 iters=101726 n=220 strlen(buf)=198 iters=102100 n=198 strlen(buf)=176 iters=105591 n=209 strlen(buf)=187 iters=113191 n=198 strlen(buf)=176 iters=118188 n=231 strlen(buf)=209 iters=118528 n=220 strlen(buf)=198 iters=118915 n=198 strlen(buf)=176 iters=119760 n=209 strlen(buf)=198 iters=121908 n=209 strlen(buf)=187 iters=121914 n=253 strlen(buf)=231 iters=124651 n=198 strlen(buf)=176 iters=129985 n=220 strlen(buf)=198 iters=130163 n=209 strlen(buf)=187 iters=239103 n=198 strlen(buf)=176 iters=246343 n=198 strlen(buf)=176 iters=258089 n=176 strlen(buf)=154 ; to see the nulls in the written file /tmp/test.readcontents sed '/iters=53806/q' /tmp/test.readcontents >/tmp/test.clean ls -ltr /tmp/test.clean # to figure out the size of the file ; dd -bs 1 -skip 14782056 -if test.readcontents | xd -c 0000000 1 2 3 4 5 6 7 8 9 \n . i t e r s 0000010 = 5 3 8 0 6 i n p u t o f f 0000020 s e t = 1 0 4 7 7 9 4 0 o u t 0000030 p u t o f f s e t = 1 4 7 8 2 0000040 0 6 7 , n = 1 9 8 s t r l e 0000050 n ( b u f ) = 1 7 6 \n . 0 1 2 3 0000060 4 5 6 7 8 9 \n 0 1 2 3 4 5 6 7 8 0000070 9 \n 0 1 2 3 4 5 6 7 8 9 \n 0 1 2 0000080 3 4 5 6 7 8 9 \n 0 1 2 3 4 5 6 7 0000090 8 9 \n 0 1 2 3 4 5 6 7 8 9 \n 0 1 00000a0 2 3 4 5 6 7 8 9 \n 0 1 2 3 4 5 6 00000b0 7 8 9 \n 0 1 2 3 4 5 6 7 8 9 \n 0 00000c0 1 2 3 4 5 6 7 8 9 \n 0 1 2 3 4 5 00000d0 6 7 8 9 \n 0 1 2 3 4 5 6 7 8 9 \n 00000e0 0 1 2 3 4 5 6 7 8 9 \n 0 1 2 3 4 00000f0 5 6 7 8 9 \n 0 1 2 3 4 5 6 7 8 9 0000100 \n 0 1 2 3 4 5 6 7 8 9 \n 00 00 00 00 0000110 00 00 00 00 00 00 00 0 1 2 3 4 5 6 7 8 0000120 9 \n . i t e r s = 5 3 8 0 7 i 0000130 n p u t o f f s e t = 1 0 4 7 0000140 8 5 0 1 o u t p u t o f f s 0000150 e t = 1 4 7 8 2 3 4 7 , n = 5 0000160 6 1 s t r l e n ( b u f ) = 5 0000170 6 1 \n . 0 1 2 3 4 5 6 7 8 9 \n 0 0000180 1 2 3 4 5 6 7 8 9 \n 0 1 2 3 4 5 0000190 6 7 8 9 \n 0 1 2 3 4 5 6 7 8 9 \n 00001a0 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4 5 6 7 8 9 \n 0 1 2 3 4 5 6 7 0000360 8 9 \n 0 1 2 3 4 5 6 7 8 9 \n 0 1 0000370 2 3 4 5 6 7 8 9 \n 0 1 2 3 4 5 6 0000380 7 8 9 \n 0 1 2 3 4 5 6 7 8 9 \n 0 0000390 1 2 3 4 5 6 7 8 9 \n 0 1 2 3 4 5 00003a0 6 7 8 9 \n . i t e r s = 5 3 8 0 00003b0 8 i n p u t o f f s e t = 1
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.