NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

kern/41057: creating a file on tmpfs can work strangely



>Number:         41057
>Category:       kern
>Synopsis:       creating a file on tmpfs can work strangely
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Mar 22 12:05:01 +0000 2009
>Originator:     Alan Barrett
>Release:        NetBSD 5.99.8
>Organization:
Not much
>Environment:
System: NetBSD 5.99.8 i386
>Description:
        Sometimes, creating and wrigint to a file on tmpfs
        apepars to work, but deleting the file fails.
>How-To-Repeat:
        Run teh following python program.  It works fine if the system
        is idle, but under load it sometimes raises exceptions.

#!/usr/bin/env python2.4

import os
import sys
import tempfile

def create_use_delete_one_file():
    """Create a file, write to it, and delete it.
    """
    (handle, name) = tempfile.mkstemp(prefix = os.path.basename(sys.argv[0]))
    os.close(handle)
    open(name, "w").write("stuff")
    try:
        assert os.path.exists(name)
        os.remove(name)
        assert not os.path.exists(name)
    except KeyboardInterrupt:
        raise
    except:
        pass

if __name__ == "__main__":
    i = 0
    while True:
        i += 1
        sys.stderr.write(".")
        create_use_delete_one_file()

>Fix:
        Unknown



Home | Main Index | Thread Index | Old Index