[olug] Argh!

Sam Tetherow tetherow at nol.org
Mon Dec 16 05:24:26 UTC 2002


You would have to check the source code for mozilla or gtfp but I would 
bet what the author does is open the file for writing when they go to 
save which will cause the file to be wiped.

As for full memory and swap, many things write to log files or syslog 
and most programmers do not take the time to handle this gracefully. 
 When say your /var partition fills up and syslog can no longer write to 
file the os will buffer the writes in memory in the vain hope that some 
disk space free up, when this doesn't occur, memory fills up, then swap 
space, once swap is full the writes start failing, as well as any new 
memory allocation.  Most programmers do not take the time to gracefully 
handle a failed alloc beyond printf(stderr, "cannot allocation 
memory\n"); exit;  But even those that do what is the proper behavior? 
 How will apache serve a file if it cannot allocate the memory to read 
the file?    How is mysql suppose to handle a request if it cannot 
malloc memory for the temporary buffers it needs to build the results set?

Nick Walter wrote:

>Opening a file read/write on a full partition and then writing to it will
>not cause any particular problem, unless the application attempts to grow
>the file by writing beyond the existing EOF.  The growing will fail, but
>even then the existing contents of the file will be unharmed.  I'm speaking
>from experience as I once had to debug an application I'd written that was
>running into exactly this problem.  If requested, I can provide a test
>scenario + source code to replicate this behavior.
>
>I'm also curious how having a full partition will impact memory/swap?  Is
>this another case of badly behaved applications or some naughty behavior of
>the Linux kernel that I've never encountered?
>
>Nick Walter
>
>
>----- Original Message -----
>From: "Sam Tetherow" <tetherow at nol.org>
>To: <olug at olug.org>
>Sent: Sunday, December 15, 2002 4:30 PM
>Subject: Re: [olug] Argh!
>
>
>  
>
>>Nick Walter wrote:
>>
>>    
>>
>>>I've filled up partitions in my time, even filled up / on a couple of
>>>occassions.  RH Linux always impressed me by not crashing or having
>>>      
>>>
>horrible
>  
>
>>>seizures when it happened.  I've seen other Unices do a lot lot worse in
>>>      
>>>
>the
>  
>
>>>same situation.
>>>
>>>      
>>>
>>Run it a little bit longer, horrible things will start to happen :).
>> Once mem and swap are full there isn't much you can do.
>>
>>    
>>
>>>The only thing I can think of is that Mozilla perhaps erases/re-writes
>>>      
>>>
>the
>  
>
>>>bookmarks when you edit them?  I'm 100% in agreement with Adam that
>>>      
>>>
>nothing
>  
>
>>>in Red Hat or Mandrake Linux will arbitrarily delete files just because a
>>>partition is full.  The only thing that should happen is some processes
>>>dying or freezing because they can't complete I/O.
>>>
>>>      
>>>
>>It is poorly written applications that cause this.  As the program
>>exists it opens the file to rewrite the data, when the open command is
>>given there is no error since you are not trying to write anything to
>>disk.  In doing so you have now managed to set the file marker at byte
>>zero in the file.  You now try to write but alas there is no room on the
>>disk so you get an error and the program will exit meanwhile leaving the
>>file marker at 0, effectively wiping the file.  The better way to do
>>this is to create a second file, write out the new data and then rename
>>the file with the old filename.
>>
>>    
>>
>>>Nick Walter
>>>
>>>----- Original Message -----
>>>From: "Adam Haeder" <adamh at omaha.org>
>>>To: <olug at olug.org>
>>>Sent: Saturday, December 14, 2002 8:30 PM
>>>Subject: RE: [olug] Argh!
>>>
>>>
>>>
>>>
>>>      
>>>
>>>>What do you mean wiped clean? Even if the partition fills up, there's no
>>>>process that says "better delete everything in Adam's home directory".
>>>>        
>>>>
>How
>  
>
>>>>did the data get deleted?
>>>>
>>>>-----Original Message-----
>>>>From: Adam Lassek [mailto:hayai2 at cox.net]
>>>>Sent: Saturday, December 14, 2002 9:22 PM
>>>>To: olug at olug.org
>>>>Subject: [olug] Argh!
>>>>
>>>>
>>>>This is one thing about Linux that has always pissed me off. The
>>>>partition my home directory was in filled up (not even sure how that
>>>>happened yet) and so every bookmark I've ever saved in Mozilla, gftp or
>>>>whatever has been completely wiped clean. Why does that even happen?
>>>>_______________________________________________
>>>>OLUG mailing list
>>>>OLUG at olug.org
>>>>http://lists.olug.org/mailman/listinfo/olug
>>>>
>>>>
>>>>
>>>>        
>>>>
>>>_______________________________________________
>>>OLUG mailing list
>>>OLUG at olug.org
>>>http://lists.olug.org/mailman/listinfo/olug
>>>
>>>
>>>      
>>>
>>
>>_______________________________________________
>>OLUG mailing list
>>OLUG at olug.org
>>http://lists.olug.org/mailman/listinfo/olug
>>
>>    
>>
>
>_______________________________________________
>OLUG mailing list
>OLUG at olug.org
>http://lists.olug.org/mailman/listinfo/olug
>  
>






More information about the OLUG mailing list