https://bz.apache.org/ooo/show_bug.cgi?id=126869

--- Comment #61 from John <[email protected]> ---
We have another "my file is full of ####" on the forum - see Another HashTagged
Document at https://forum.openoffice.org/en/forum/viewtopic.php?f=7&t=104869. 
I have asked him to give me full details of how it happened. 

We cannot explain any scenario in which these "files full of nulls" can be
created but they do get created so our understanding is incomplete. 

A normal file write is something like:

1 AOO clears some memory and fills it full of nulls in preparation for creating
and writing fred.odt (line 50 in deflater?).

2 AOO opens fred.odt on the disk ready to receive the file.  At this stage
fred.odt is zero bytes long.

3 AOO uses the cleared memory as working space and creates the zipped content
in the memory

4 AOO copies the created zipped content from memory into fred.odt.

Now, say the user issues a shutdown after 2 but before 3. We now know AOO does
not prevent the shutdown so the PC starts shutting down.

What happens during the shutdown?

Could the OS kill an AOO process and so cause AOO to miss step 3 and jump
straight from 2 to 4 and so write the nulls to fred.odt before shutdown
actually happens?   

Could the OS somehow take over and try to protect fred.odt which the OS knows
is open for writing? Does the OS quickly write the contents of memory - all
nulls - into fred.odt thinking it will save the file?

Could AOO have a routine which steps in and tries to protect the file and
quickly writes the content of memory - all nulls - to fred.odt?

-- 
You are receiving this mail because:
You are the assignee for the issue.

Reply via email to