VirtualBox

Opened 13 years ago

Last modified 3 years ago

#8761 assigned defect

Silent failure to delete files on Shared Folders — at Version 20

Reported by: Edmar (Macrovita) Owned by: Frank Batschulat (Oracle)
Component: shared folders Version: VirtualBox 4.0.6
Keywords: Cc:
Guest type: Linux Host type: Windows

Description (last modified by Frank Batschulat (Oracle))

When running bonnie++ bechmark on Linux guest (Fedora 14) in a shared folder under Windows XP host, the benchmark fails due to "directory not empty" at the end.

The benchmark creates thousands of small files, and then deletes them. The problem is that after all deletions are done (and no error is reported), the benchmark directory is not empty.

Running the same benchmark on the same guest, but on a Linux native folder (VDI disk), the benchmark runs OK. No files left over.

VirtualBox 4.0.6 (the problem also occurred on VirtualBox 4.0.4, I just hadn't reported it yet, sorry)
Host: Windows XP Professional SP3
Guest: Fedora 14 kernel 2.6.35.11-83.fc14.i686
bonnie++-1.96-1.fc13.i686

Terminal session:

# cd /media/sf_some_shared_folder
# bonnie++ -u root -n 3 -s 0
Using uid:0, gid:0.
Create files in sequential order...done.
Stat files in sequential order...done.
Delete files in sequential order...Bonnie: drastic I/O error (rmdir): Directory not empty
Cleaning up test directory after error.
# ls
Bonnie.1733
# ls Bonnie.1733/ | wc -l
1106
# for i in `seq 1 5`; do bonnie++ -u root -n 3 -s 0; done
Using uid:0, gid:0.
Create files in sequential order...done.
Stat files in sequential order...done.
Delete files in sequential order...Bonnie: drastic I/O error (rmdir): Directory not empty
Cleaning up test directory after error.
...[snip, cut 4x repeated output]...
# for dir in `ls -d Bonnie*`; do \
    echo -n "files left over in $dir: "; \
    ls $dir | wc -l; done
files left over in Bonnie.1733: 1106
files left over in Bonnie.1743: 1111
files left over in Bonnie.1744: 1102
files left over in Bonnie.1745: 1102
files left over in Bonnie.1746: 1102
files left over in Bonnie.1747: 1108
# rm -rf Bonnie.*
# ls

Notes:

  • bonnie++ option [-n 3] creates 3 * 1024 files
  • The command [rm -rf Bonnie.*] successfully deletes all left over files. That said, as stated above the benchmark runs OK on native Linux guest disk instead of shared folder, so it seems the problem is not in bonnie++ code.
  • There's no error / no message appearing at VBox.log for the running VM right before, during or after the benchmark. See attached file VBox-20110421-1939.log.

BTM3505 (self reference, please ignore)

Change History (20)

by Edmar (Macrovita), 13 years ago

Attachment: VBox-20110421-1939.log added

comment:1 by frankieandshadow, 12 years ago

I think I have what is probably the same problem in a different guise.

I am deleting (from a script) a folder on a SHARED DRIVE (host Windows 7, guest Debian) of some moderately large and many files in a tree three levels deep, with "rm -r path". It randomly gives errors 'rm: cannot remove '<intermediate directory>': Directory not empty' and because of that ultimately fails to delete the top level folder. I think it is trying to do the delete on the directory, but the recursive delete on the contents has not completed.

I think there is a similar situation that mv on a large-ish directory on a shared folder completes some time after the mv returns.

comment:2 by nickblah, 12 years ago

I believe I'm also seeing the same issue with a shared folder. OS X Lion Host, CentOS 6.2 guest, VirtualBox 4.1.16. Basically recursive deletes seem to fail if the directory has enough contents. Even though "rm" reports having deleted certain files, they still remain on the shared folder file system, so deleting the parent folder fails. Repeated recursive delete commands will eventually delete the whole folder, but that's not ideal and not very practical when using 3rd party tools that expect recursive deletes to work the first time.

Here's an example using PHP PEAR's Pyrus installer:

$ php pyrus.phar ./vendor/pear install pear/Auth
Pyrus version 2.0.0a4 SHA-1: 72271D92C3AA1FA96DF9606CD538868544609A52
Using PEAR installation found at /vagrant_sites/my_site/main/releases/main/vendor/pear
Downloading pear.php.net/Auth
Mime-type: application/octet-stream
Pyrus\AtomicFileTransaction\MultiException: Warning: not all backup directories have been removed====>] 100% (54/54 kb)
 Pyrus\IOException: Unable to fully remove /vagrant_sites/my_site/main/releases/main/vendor/pear/.old-php
  Pyrus\IOException: Unable to fully remove /vagrant_sites/my_site/main/releases/main/vendor/pear/.old-data
   Pyrus\IOException: Unable to fully remove /vagrant_sites/my_site/main/releases/main/vendor/pear/.old-docs
    Pyrus\IOException: Unable to fully remove /vagrant_sites/my_site/main/releases/main/vendor/pear/.old-tests

If I then manually delete the ".old-*" directories it's complaining about, the following happens:

$ rm -Rv vendor/pear/.old-*
removed `vendor/pear/.old-data/MDB2/LICENSE'
rm: cannot remove `vendor/pear/.old-data/MDB2': Directory not empty
removed `vendor/pear/.old-data/MDB2_Driver_oci8/package_oci8.xml'
rm: cannot remove `vendor/pear/.old-data/MDB2_Driver_oci8': Directory not empty
removed `vendor/pear/.old-data/PEAR/package.dtd'
removed `vendor/pear/.old-data/PEAR/template.spec'
rm: cannot remove `vendor/pear/.old-data/PEAR': Directory not empty
removed `vendor/pear/.old-data/Structures_Graph/LICENSE'
removed directory: `vendor/pear/.old-data/Structures_Graph'
removed `vendor/pear/.old-docs/Archive_Tar/docs/Archive_Tar.txt'
removed directory: `vendor/pear/.old-docs/Archive_Tar/docs'
rm: cannot remove `vendor/pear/.old-docs/Archive_Tar': Directory not empty
removed `vendor/pear/.old-docs/MDB2/docs/CONTRIBUTORS'
removed `vendor/pear/.old-docs/MDB2/docs/datatypes.html'
removed `vendor/pear/.old-docs/MDB2/docs/examples/example.php'
removed `vendor/pear/.old-docs/MDB2/docs/examples/example_php5.php'
removed `vendor/pear/.old-docs/MDB2/docs/examples/metapear_test_db.schema'
removed directory: `vendor/pear/.old-docs/MDB2/docs/examples'
removed `vendor/pear/.old-docs/MDB2/docs/MAINTAINERS'
removed `vendor/pear/.old-docs/MDB2/docs/README'
removed `vendor/pear/.old-docs/MDB2/docs/STATUS'
removed `vendor/pear/.old-docs/MDB2/docs/TODO'
removed directory: `vendor/pear/.old-docs/MDB2/docs'
rm: cannot remove `vendor/pear/.old-docs/MDB2': Directory not empty
removed `vendor/pear/.old-docs/PEAR/INSTALL'
removed `vendor/pear/.old-docs/PEAR/LICENSE'
removed `vendor/pear/.old-docs/PEAR/README'
rm: cannot remove `vendor/pear/.old-docs/PEAR': Directory not empty
removed `vendor/pear/.old-docs/Structures_Graph/docs/generate.sh'
removed `vendor/pear/.old-docs/Structures_Graph/docs/html/classtrees_Structures_Graph.html'
removed `vendor/pear/.old-docs/Structures_Graph/docs/html/elementindex.html'
removed `vendor/pear/.old-docs/Structures_Graph/docs/html/elementindex_Structures_Graph.html'
removed `vendor/pear/.old-docs/Structures_Graph/docs/html/errors.html'
removed `vendor/pear/.old-docs/Structures_Graph/docs/html/index.html'
removed `vendor/pear/.old-docs/Structures_Graph/docs/html/li_Structures_Graph.html'
removed `vendor/pear/.old-docs/Structures_Graph/docs/html/media/banner.css'
removed `vendor/pear/.old-docs/Structures_Graph/docs/html/media/stylesheet.css'
removed directory: `vendor/pear/.old-docs/Structures_Graph/docs/html/media'
removed `vendor/pear/.old-docs/Structures_Graph/docs/html/packages.html'
removed `vendor/pear/.old-docs/Structures_Graph/docs/html/Structures_Graph/_Structures_Graph_Manipulator_AcyclicTest_php.html'
removed `vendor/pear/.old-docs/Structures_Graph/docs/html/Structures_Graph/_Structures_Graph_Manipulator_TopologicalSorter_php.html'
removed `vendor/pear/.old-docs/Structures_Graph/docs/html/Structures_Graph/_Structures_Graph_Node_php.html'
removed `vendor/pear/.old-docs/Structures_Graph/docs/html/Structures_Graph/_Structures_Graph_php.html'
removed `vendor/pear/.old-docs/Structures_Graph/docs/html/Structures_Graph/Structures_Graph.html'
removed `vendor/pear/.old-docs/Structures_Graph/docs/html/Structures_Graph/Structures_Graph_Manipulator_AcyclicTest.html'
removed `vendor/pear/.old-docs/Structures_Graph/docs/html/Structures_Graph/Structures_Graph_Manipulator_TopologicalSorter.html'
removed `vendor/pear/.old-docs/Structures_Graph/docs/html/Structures_Graph/Structures_Graph_Node.html'
removed `vendor/pear/.old-docs/Structures_Graph/docs/html/Structures_Graph/tutorial_Structures_Graph.pkg.html'
removed directory: `vendor/pear/.old-docs/Structures_Graph/docs/html/Structures_Graph'
removed `vendor/pear/.old-docs/Structures_Graph/docs/html/todolist.html'
removed directory: `vendor/pear/.old-docs/Structures_Graph/docs/html'
removed `vendor/pear/.old-docs/Structures_Graph/docs/tutorials/Structures_Graph/Structures_Graph.pkg'
removed directory: `vendor/pear/.old-docs/Structures_Graph/docs/tutorials/Structures_Graph'
removed directory: `vendor/pear/.old-docs/Structures_Graph/docs/tutorials'
removed directory: `vendor/pear/.old-docs/Structures_Graph/docs'
rm: cannot remove `vendor/pear/.old-docs/Structures_Graph': Directory not empty
removed `vendor/pear/.old-docs/XML_Util/XML/examples/example.php'
removed `vendor/pear/.old-docs/XML_Util/XML/examples/example2.php'
removed directory: `vendor/pear/.old-docs/XML_Util/XML/examples'
removed directory: `vendor/pear/.old-docs/XML_Util/XML'
removed directory: `vendor/pear/.old-docs/XML_Util'
removed `vendor/pear/.old-php/Archive/Tar.php'
rm: cannot remove `vendor/pear/.old-php/Archive': Directory not empty
removed `vendor/pear/.old-php/Console/Getopt.php'
rm: cannot remove `vendor/pear/.old-php/Console': Directory not empty
removed `vendor/pear/.old-php/MDB2/Date.php'
removed `vendor/pear/.old-php/MDB2/Driver/Datatype/Common.php'
removed `vendor/pear/.old-php/MDB2/Driver/Datatype/oci8.php'
removed directory: `vendor/pear/.old-php/MDB2/Driver/Datatype'
removed `vendor/pear/.old-php/MDB2/Driver/Function/Common.php'
removed `vendor/pear/.old-php/MDB2/Driver/Function/oci8.php'
removed directory: `vendor/pear/.old-php/MDB2/Driver/Function'
removed `vendor/pear/.old-php/MDB2/Driver/Manager/Common.php'
removed `vendor/pear/.old-php/MDB2/Driver/Manager/oci8.php'
removed directory: `vendor/pear/.old-php/MDB2/Driver/Manager'
removed `vendor/pear/.old-php/MDB2/Driver/Native/Common.php'
removed `vendor/pear/.old-php/MDB2/Driver/Native/oci8.php'
removed directory: `vendor/pear/.old-php/MDB2/Driver/Native'
removed `vendor/pear/.old-php/MDB2/Driver/oci8.php'
removed `vendor/pear/.old-php/MDB2/Driver/Reverse/Common.php'
removed `vendor/pear/.old-php/MDB2/Driver/Reverse/oci8.php'
removed directory: `vendor/pear/.old-php/MDB2/Driver/Reverse'
removed directory: `vendor/pear/.old-php/MDB2/Driver'
removed `vendor/pear/.old-php/MDB2/Extended.php'
removed `vendor/pear/.old-php/MDB2/Iterator.php'
removed `vendor/pear/.old-php/MDB2/LOB.php'
rm: cannot remove `vendor/pear/.old-php/MDB2': Directory not empty
removed `vendor/pear/.old-php/MDB2.php'
removed `vendor/pear/.old-php/OS/Guess.php'
rm: cannot remove `vendor/pear/.old-php/OS': Directory not empty
removed `vendor/pear/.old-php/PEAR/Autoloader.php'
removed `vendor/pear/.old-php/PEAR/Builder.php'
removed `vendor/pear/.old-php/PEAR/ChannelFile/Parser.php'
removed directory: `vendor/pear/.old-php/PEAR/ChannelFile'
removed `vendor/pear/.old-php/PEAR/ChannelFile.php'
removed `vendor/pear/.old-php/PEAR/Command/Auth.php'
removed `vendor/pear/.old-php/PEAR/Command/Auth.xml'
removed `vendor/pear/.old-php/PEAR/Command/Build.php'
removed `vendor/pear/.old-php/PEAR/Command/Build.xml'
removed `vendor/pear/.old-php/PEAR/Command/Channels.php'
removed `vendor/pear/.old-php/PEAR/Command/Channels.xml'
removed `vendor/pear/.old-php/PEAR/Command/Common.php'
removed `vendor/pear/.old-php/PEAR/Command/Config.php'
removed `vendor/pear/.old-php/PEAR/Command/Config.xml'
removed `vendor/pear/.old-php/PEAR/Command/Install.php'
removed `vendor/pear/.old-php/PEAR/Command/Install.xml'
removed `vendor/pear/.old-php/PEAR/Command/Mirror.php'
removed `vendor/pear/.old-php/PEAR/Command/Mirror.xml'
removed `vendor/pear/.old-php/PEAR/Command/Package.php'
removed `vendor/pear/.old-php/PEAR/Command/Package.xml'
removed `vendor/pear/.old-php/PEAR/Command/Pickle.php'
removed `vendor/pear/.old-php/PEAR/Command/Pickle.xml'
removed `vendor/pear/.old-php/PEAR/Command/Registry.php'
removed `vendor/pear/.old-php/PEAR/Command/Registry.xml'
removed `vendor/pear/.old-php/PEAR/Command/Remote.php'
removed `vendor/pear/.old-php/PEAR/Command/Remote.xml'
removed `vendor/pear/.old-php/PEAR/Command/Test.php'
removed `vendor/pear/.old-php/PEAR/Command/Test.xml'
removed directory: `vendor/pear/.old-php/PEAR/Command'
removed `vendor/pear/.old-php/PEAR/Command.php'
removed `vendor/pear/.old-php/PEAR/Common.php'
removed `vendor/pear/.old-php/PEAR/Config.php'
removed `vendor/pear/.old-php/PEAR/Dependency2.php'
removed `vendor/pear/.old-php/PEAR/DependencyDB.php'
removed `vendor/pear/.old-php/PEAR/Downloader/Package.php'
removed directory: `vendor/pear/.old-php/PEAR/Downloader'
removed `vendor/pear/.old-php/PEAR/Downloader.php'
removed `vendor/pear/.old-php/PEAR/ErrorStack.php'
removed `vendor/pear/.old-php/PEAR/Exception.php'
removed `vendor/pear/.old-php/PEAR/FixPHP5PEARWarnings.php'
removed `vendor/pear/.old-php/PEAR/Frontend/CLI.php'
removed directory: `vendor/pear/.old-php/PEAR/Frontend'
removed `vendor/pear/.old-php/PEAR/Frontend.php'
removed `vendor/pear/.old-php/PEAR/Installer/Role/Cfg.php'
removed `vendor/pear/.old-php/PEAR/Installer/Role/Cfg.xml'
removed `vendor/pear/.old-php/PEAR/Installer/Role/Common.php'
removed `vendor/pear/.old-php/PEAR/Installer/Role/Data.php'
removed `vendor/pear/.old-php/PEAR/Installer/Role/Data.xml'
removed `vendor/pear/.old-php/PEAR/Installer/Role/Doc.php'
removed `vendor/pear/.old-php/PEAR/Installer/Role/Doc.xml'
removed `vendor/pear/.old-php/PEAR/Installer/Role/Ext.php'
removed `vendor/pear/.old-php/PEAR/Installer/Role/Ext.xml'
removed `vendor/pear/.old-php/PEAR/Installer/Role/Php.php'
removed `vendor/pear/.old-php/PEAR/Installer/Role/Php.xml'
removed `vendor/pear/.old-php/PEAR/Installer/Role/Script.php'
removed `vendor/pear/.old-php/PEAR/Installer/Role/Script.xml'
removed `vendor/pear/.old-php/PEAR/Installer/Role/Src.php'
removed `vendor/pear/.old-php/PEAR/Installer/Role/Src.xml'
removed `vendor/pear/.old-php/PEAR/Installer/Role/Test.php'
removed `vendor/pear/.old-php/PEAR/Installer/Role/Test.xml'
removed `vendor/pear/.old-php/PEAR/Installer/Role/Www.php'
removed `vendor/pear/.old-php/PEAR/Installer/Role/Www.xml'
removed directory: `vendor/pear/.old-php/PEAR/Installer/Role'
removed `vendor/pear/.old-php/PEAR/Installer/Role.php'
removed directory: `vendor/pear/.old-php/PEAR/Installer'
removed `vendor/pear/.old-php/PEAR/Installer.php'
removed `vendor/pear/.old-php/PEAR/PackageFile/Generator/v1.php'
removed `vendor/pear/.old-php/PEAR/PackageFile/Generator/v2.php'
removed directory: `vendor/pear/.old-php/PEAR/PackageFile/Generator'
removed `vendor/pear/.old-php/PEAR/PackageFile/Parser/v1.php'
removed `vendor/pear/.old-php/PEAR/PackageFile/Parser/v2.php'
removed directory: `vendor/pear/.old-php/PEAR/PackageFile/Parser'
removed `vendor/pear/.old-php/PEAR/PackageFile/v1.php'
removed `vendor/pear/.old-php/PEAR/PackageFile/v2/rw.php'
removed `vendor/pear/.old-php/PEAR/PackageFile/v2/Validator.php'
removed directory: `vendor/pear/.old-php/PEAR/PackageFile/v2'
removed `vendor/pear/.old-php/PEAR/PackageFile/v2.php'
removed directory: `vendor/pear/.old-php/PEAR/PackageFile'
removed `vendor/pear/.old-php/PEAR/PackageFile.php'
removed `vendor/pear/.old-php/PEAR/Packager.php'
removed `vendor/pear/.old-php/PEAR/Registry.php'
removed `vendor/pear/.old-php/PEAR/REST/10.php'
removed `vendor/pear/.old-php/PEAR/REST/11.php'
removed `vendor/pear/.old-php/PEAR/REST/13.php'
removed directory: `vendor/pear/.old-php/PEAR/REST'
removed `vendor/pear/.old-php/PEAR/REST.php'
removed `vendor/pear/.old-php/PEAR/RunTest.php'
removed `vendor/pear/.old-php/PEAR/Task/Common.php'
removed `vendor/pear/.old-php/PEAR/Task/Postinstallscript/rw.php'
removed directory: `vendor/pear/.old-php/PEAR/Task/Postinstallscript'
removed `vendor/pear/.old-php/PEAR/Task/Postinstallscript.php'
removed `vendor/pear/.old-php/PEAR/Task/Replace/rw.php'
removed directory: `vendor/pear/.old-php/PEAR/Task/Replace'
removed `vendor/pear/.old-php/PEAR/Task/Replace.php'
removed `vendor/pear/.old-php/PEAR/Task/Unixeol/rw.php'
removed directory: `vendor/pear/.old-php/PEAR/Task/Unixeol'
removed `vendor/pear/.old-php/PEAR/Task/Unixeol.php'
removed `vendor/pear/.old-php/PEAR/Task/Windowseol/rw.php'
removed directory: `vendor/pear/.old-php/PEAR/Task/Windowseol'
removed `vendor/pear/.old-php/PEAR/Task/Windowseol.php'
removed directory: `vendor/pear/.old-php/PEAR/Task'
removed `vendor/pear/.old-php/PEAR/Validate.php'
removed `vendor/pear/.old-php/PEAR/Validator/PECL.php'
removed directory: `vendor/pear/.old-php/PEAR/Validator'
removed `vendor/pear/.old-php/PEAR/XMLParser.php'
rm: cannot remove `vendor/pear/.old-php/PEAR': Directory not empty
removed `vendor/pear/.old-php/PEAR.php'
removed `vendor/pear/.old-php/PEAR5.php'
removed `vendor/pear/.old-php/pearcmd.php'
removed `vendor/pear/.old-php/peclcmd.php'
removed `vendor/pear/.old-php/Structures/Graph/Manipulator/AcyclicTest.php'
removed `vendor/pear/.old-php/Structures/Graph/Manipulator/TopologicalSorter.php'
removed directory: `vendor/pear/.old-php/Structures/Graph/Manipulator'
removed `vendor/pear/.old-php/Structures/Graph/Node.php'
removed directory: `vendor/pear/.old-php/Structures/Graph'
removed `vendor/pear/.old-php/Structures/Graph.php'
rm: cannot remove `vendor/pear/.old-php/Structures': Directory not empty
removed `vendor/pear/.old-php/System.php'
removed `vendor/pear/.old-php/XML/Util.php'
removed directory: `vendor/pear/.old-php/XML'
removed `vendor/pear/.old-tests/MDB2/tests/basic.phpt'
removed `vendor/pear/.old-tests/MDB2/tests/clitest.php'
removed `vendor/pear/.old-tests/MDB2/tests/config.php'
removed `vendor/pear/.old-tests/MDB2/tests/Console_TestListener.php'
removed `vendor/pear/.old-tests/MDB2/tests/driver_test.schema.xml'
removed `vendor/pear/.old-tests/MDB2/tests/HTML_TestListener.php'
removed `vendor/pear/.old-tests/MDB2/tests/import.schema.php'
removed `vendor/pear/.old-tests/MDB2/tests/MDB2_api_testcase.php'
removed `vendor/pear/.old-tests/MDB2/tests/MDB2_bugs_testcase.php'
removed `vendor/pear/.old-tests/MDB2/tests/MDB2_Connect_Test.php'
removed `vendor/pear/.old-tests/MDB2/tests/MDB2_datatype_testcase.php'
removed `vendor/pear/.old-tests/MDB2/tests/MDB2_extended_testcase.php'
removed `vendor/pear/.old-tests/MDB2/tests/MDB2_function_testcase.php'
removed `vendor/pear/.old-tests/MDB2/tests/MDB2_internals_testcase.php'
removed `vendor/pear/.old-tests/MDB2/tests/MDB2_manager_testcase.php'
removed `vendor/pear/.old-tests/MDB2/tests/MDB2_native_testcase.php'
removed `vendor/pear/.old-tests/MDB2/tests/MDB2_nonstandard.php'
removed `vendor/pear/.old-tests/MDB2/tests/MDB2_nonstandard_ibase.php'
removed `vendor/pear/.old-tests/MDB2/tests/MDB2_nonstandard_mssql.php'
removed `vendor/pear/.old-tests/MDB2/tests/MDB2_nonstandard_mysql.php'
removed `vendor/pear/.old-tests/MDB2/tests/MDB2_nonstandard_mysqli.php'
removed `vendor/pear/.old-tests/MDB2/tests/MDB2_nonstandard_oci8.php'
removed `vendor/pear/.old-tests/MDB2/tests/MDB2_nonstandard_pgsql.php'
removed `vendor/pear/.old-tests/MDB2/tests/MDB2_nonstandard_sqlite.php'
removed `vendor/pear/.old-tests/MDB2/tests/MDB2_reverse_testcase.php'
removed `vendor/pear/.old-tests/MDB2/tests/MDB2_testcase.php'
removed `vendor/pear/.old-tests/MDB2/tests/MDB2_usage_testcase.php'
removed `vendor/pear/.old-tests/MDB2/tests/README'
removed `vendor/pear/.old-tests/MDB2/tests/test.php'
removed `vendor/pear/.old-tests/MDB2/tests/test_setup.php.dist'
removed `vendor/pear/.old-tests/MDB2/tests/testchoose.php'
removed `vendor/pear/.old-tests/MDB2/tests/tests.css'
removed `vendor/pear/.old-tests/MDB2/tests/testUtils.php'
removed directory: `vendor/pear/.old-tests/MDB2/tests'
rm: cannot remove `vendor/pear/.old-tests/MDB2': Directory not empty
removed `vendor/pear/.old-tests/MDB2_Driver_oci8/tests/MDB2_nonstandard_oci8.php'
removed directory: `vendor/pear/.old-tests/MDB2_Driver_oci8/tests'
rm: cannot remove `vendor/pear/.old-tests/MDB2_Driver_oci8': Directory not empty
removed `vendor/pear/.old-tests/Structures_Graph/tests/AllTests.php'
removed `vendor/pear/.old-tests/Structures_Graph/tests/testCase/BasicGraph.php'
removed directory: `vendor/pear/.old-tests/Structures_Graph/tests/testCase'
removed directory: `vendor/pear/.old-tests/Structures_Graph/tests'
rm: cannot remove `vendor/pear/.old-tests/Structures_Graph': Directory not empty
removed `vendor/pear/.old-tests/XML_Util/XML/tests/AllTests.php'
removed `vendor/pear/.old-tests/XML_Util/XML/tests/testBasic_apiVersion.phpt'
removed `vendor/pear/.old-tests/XML_Util/XML/tests/testBasic_attributesToString.phpt'
removed `vendor/pear/.old-tests/XML_Util/XML/tests/testBasic_collapseEmptyTags.phpt'
removed `vendor/pear/.old-tests/XML_Util/XML/tests/testBasic_createCDataSection.phpt'
removed `vendor/pear/.old-tests/XML_Util/XML/tests/testBasic_createComment.phpt'
removed `vendor/pear/.old-tests/XML_Util/XML/tests/testBasic_createEndElement.phpt'
removed `vendor/pear/.old-tests/XML_Util/XML/tests/testBasic_createStartElement.phpt'
removed `vendor/pear/.old-tests/XML_Util/XML/tests/testBasic_createTag.phpt'
removed `vendor/pear/.old-tests/XML_Util/XML/tests/testBasic_createTagFromArray.phpt'
removed `vendor/pear/.old-tests/XML_Util/XML/tests/testBasic_getDocTypeDeclaration.phpt'
removed `vendor/pear/.old-tests/XML_Util/XML/tests/testBasic_getXmlDeclaration.phpt'
removed `vendor/pear/.old-tests/XML_Util/XML/tests/testBasic_isValidName.phpt'
removed `vendor/pear/.old-tests/XML_Util/XML/tests/testBasic_raiseError.phpt'
removed `vendor/pear/.old-tests/XML_Util/XML/tests/testBasic_replaceEntities.phpt'
removed `vendor/pear/.old-tests/XML_Util/XML/tests/testBasic_reverseEntities.phpt'
removed `vendor/pear/.old-tests/XML_Util/XML/tests/testBasic_splitQualifiedName.phpt'
removed `vendor/pear/.old-tests/XML_Util/XML/tests/testBug_4950.phpt'
removed `vendor/pear/.old-tests/XML_Util/XML/tests/testBug_5392.phpt'
removed directory: `vendor/pear/.old-tests/XML_Util/XML/tests'
removed directory: `vendor/pear/.old-tests/XML_Util/XML'
removed directory: `vendor/pear/.old-tests/XML_Util'

As an example of a failed delete, note in that output these lines:

removed `vendor/pear/.old-tests/MDB2_Driver_oci8/tests/MDB2_nonstandard_oci8.php'
removed directory: `vendor/pear/.old-tests/MDB2_Driver_oci8/tests'
rm: cannot remove `vendor/pear/.old-tests/MDB2_Driver_oci8': Directory not empty

But if I check that directory, MDB2_nonstandard_oci8.php and the tests directory still remain on disk, despite rm thinkinging it had successfully deleted them:

$ ls -l vendor/pear/.old-tests/MDB2_Driver_oci8/
total 0
drwxrwxrwx. 1 vagrant vagrant 102 Jun  2 09:32 tests
[vagrant@my_site main]$ ls -l vendor/pear/.old-tests/MDB2_Driver_oci8/tests/
total 8
-rwxrwxrwx. 1 vagrant vagrant 4457 Jun  2 09:32 MDB2_nonstandard_oci8.php

Using the force -f parameter on rm doesn't seem to make any difference. But like I said, after running the recursive delete command 1 or 2 more times all the files and folder will eventually get deleted and it will succeed.

Last edited 12 years ago by nickblah (previous) (diff)

comment:3 by pixeltreiber, 11 years ago

I have the same Problem here when deleting the cache of a Symfony2 Application. I use a shared folder and try to delete the cache in the guest. Host: Windows 7 Professional 64Bit

Guest: CentOS 6.3 Linux devel.local 2.6.32-279.19.1.el6.x86_64 #1 SMP Wed Dec 19 07:05:20 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux

Virtualbox Version 4.2.6 r82870

comment:4 by snance, 11 years ago

I'm having the same issue, specifically using Symfony2's cache:clear (php).

# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 12.04.2 LTS
Release:        12.04
Codename:       precise

# ls /opt/
VBoxGuestAdditions-4.2.8

# app/console cache:clear
Clearing the cache for the dev environment with debug true

  [ErrorException]
  Warning: rmdir(/home/repx/www/app/cache/dev_old/jms_security): Directory not empty in /home/repx/www/vendor/symfony/symfony
  /src/Symfony/Component/Filesystem/Filesystem.php line 133

comment:5 by gregory.0xf0, 10 years ago

I'm seeing this same problem under Linux, specifically: Ubuntu 13.04 x86_64.

Guest: CentOS 4.8 (output of uname -a: Linux localhost.localdomain 2.6.9-89.EL #1 Mon Jun 22 12:19:40 EDT 2009 i686 i686 i386 GNU/Linux)

Virtualbox version: 4.2.10_Ubuntur84101

This can be easily reproduced in a shared folder (here in /share) by running the following:

$ mkdir -p /share/blah
$ touch /share/blah/{1..169}
$ rm -rf /share/blah  
rm: cannot remove directory `/share/blah': Directory not empty
$ ls -ln /share/blah                                                          
total 0
-rw-rw-r--  1 500 501 0 Jan  6 18:04 113

I can consistently reproduce this when attempting to delete the folder with >=169 items and it appear to never happen with <169 items. The file left is always "113" when 169 items are created.

Running mkdir -p /share/blah && touch /share/blah/{1..169} && strace rm -rf /share/blah contains an unlink() call for every file except 113. It looks like some unlink calls are being dropped when working with shared folders that contain larger than 168 entries for some reason...

Last edited 10 years ago by gregory.0xf0 (previous) (diff)

comment:6 by kburtch, 10 years ago

Problem still exists in VirtualBox 4.3.4.

Host is Solaris 11.1 on an Oracle X3-2 (SUN FIRE X4170 M3).

Client is Red Hat Enterprise Linux Server release 6.4 (Santiago).

[kburtch@testbox ~]$ bonnie++ -d /media/sf_hostshare/
Writing a byte at a time...done
Writing intelligently...done
Rewriting...done
Reading a byte at a time...done
Reading intelligently...done
start 'em...done...done...done...done...done...
Create files in sequential order...done.
Stat files in sequential order...done.
Delete files in sequential order...Bonnie: drastic I/O error (rmdir): File exists
Cleaning up test directory after error.

This is repeatable (I've yet to get bonnie++ to complete when writing to the shared folder).

comment:7 by Moulino, 10 years ago

Problem still exists in VirtualBox 4.3.18.

Host is Windows 7 64 bits - Client is Debian 3.2.57-3 x86_64

rm -rf  /var/www/test/app/cache/dev_old/doctrine
rm: cannot remove `/var/www/test/app/cache/dev_old/doctrine': Directory not empty

comment:8 by anyqax, 8 years ago

Still exists in Version 5.0.14 r105127. Host Microsoft Windows 8.1 Pro [6.3.9600] Guest Linux 3.13.0-77-generic #121-Ubuntu

php app/console cache:clear
Clearing the cache for the dev environment with debug true

[Symfony\Component\Filesystem\Exception\IOException]
Failed to remove directory "/vagrant/root/app/cache/dev_old/doctrine".

comment:9 by Marijn, 8 years ago

We have the same problem with a Debian 8x64 client and a ubuntu 14.04-x64 one. It occurs with a Windows 10 host, but also with a Mac OSX host.

The problem does NOT occur with a Debian 7x64 client. Maybe someone knows a workaround? It is a major problem for us.

> php app/console cache:clear --env=prod
Clearing the cache for the prod environment with debug false


[Symfony\Component\Filesystem\Exception\IOException]
Failed to remove directory "/vagrant/app/cache/pro~/locking".

comment:10 by Salnikov, 8 years ago

Still exists in Version 5.0.14 r105127 MacOS + VirtualBox (CentOS7)

comment:11 by Marijn, 6 years ago

The problem still exists in VirtualBox 5.2.8. Seems to be the same as #15149 and #15897

comment:12 by virtuoze, 5 years ago

Still in ubuntu packages Ubuntu 18.04.1 LTS: Version 5.2.18_Ubuntu

comment:13 by binary1230, 5 years ago

Just hit this bug with:

guest: Ubuntu 18.04.1 LTS w/guest additions

host: Windows 10

Virtualbox version: 5.2.28 r 130011 (was also happening on 5.2.22)

shared folder type: vboxfs

I documented our efforts here: https://github.com/magfest/reggie-formula/issues/16

We were experiencing the same error with our python 'pip' installation. It had made a temp dir and tried to remove it, and even though according to the linux guest all the files were deleted, linux wouldn't remove the directory.

The broken dir buggy behavior could be repro'd like this:

(env) vagrant@localhost:~/dir$ rm -rf subdir/
rm: cannot remove 'subdir': Directory not empty
(env) vagrant@localhost:~/dir$ ls -alltr subdir/
drwxrwxrwx 1 vagrant vagrant 4096 Apr 27  2019 ..
drwxrwxrwx 1 vagrant vagrant 4096 Apr 27  2019 .

The folks at the meteor community hit this as well: https://github.com/meteor/meteor/issues/1337

On that thread, user 'glasser' came up with a very simple repro script:

#!/bin/bash

set -e -x

rm -rf a0 a1 a2
mkdir -p a0/subdir a1/subdir
echo HI >a0/subdir/file
echo HI >a1/subdir/file
mv a1 a2
mv a0 a1
rm a1/subdir/file
cat a2/subdir/file

expected result: prints 'HI'

actual result on vboxfs: 'cat: a2/subdir/file: No such file or directory'

This seems to happen when an application (like an installer) is modifying a lot of files very quickly, so perhaps this is some kind of race condition?

Regardless this is a really nasty bug. Any updates on any kind of fix, or status on what the technical limitations of getting it fixed are? Thanks!

Last edited 5 years ago by binary1230 (previous) (diff)

comment:14 by binary1230, 5 years ago

I'm working on a more slimmed down repro using as few syscalls as possible. That's now up here: https://github.com/binary1230/virtualbox-bug-7861-repro

That uses vagrant+virtualbox+vboxfs to setup a VM that demonstrates the bug. It should make getting to the bottom of this a lot easier hopefully.

the rename() syscall is where everything starts to go bad and probably where we need to dig in.

If I have time I will try and debug virtualbox/vboxfs myself if this is an easy fix, or provide more info.

comment:15 by binary1230, 4 years ago

I have some better repro code, and a hint about where this might be going wrong (currently have a kernel debug environment going and looking at this).

The short version is:

After running the repro code, it creates two directories on the guest which: Expected: these two directories should be independent from each other Actual: the two directories erroneously act like hard links (i.e. when you make a change in one dir)

On the HOST os, the directories are independent. On the GUEST, they are linked.

Curiously, clearing the kernel's inode+dentry cache with this command clears up the issue: echo 2 > /proc/sys/vm/drop_caches

I'm not really a kernel developer but it seems like this bug has something to do with the linux kernel serving up buggy data from the inode or dentry cache. Perhaps something to do with the lookup_hash functions in the vboxsf module.

I'm about to verify if this still happens with latest (6.1.8) virtualbox

I'll keep going. Anyone @Oracle, got any hints?

comment:16 by binary1230, 4 years ago

A more concise repro for this is:

(will upload the C code for this in a bit)

# run this to set it up. do it in a vboxfs mounted directory
rm -rf a0 a1 a2   # cleanup previous run
mkdir -p a0/subdir a1/subdir    # setup the directories

# we're setup. run this C code to trigger the bug
rename("a1", "a2");
rename("a0", "a1");

# --------------------
# bug is triggered
# --------------------

# now, after this is run, the a1/subdir and a2/subdir are erroneously 'hard linked'
echo "should only be in a1" > a1/subdir/file.txt
cat a2/subdir/file.txt   # THIS FILE SHOULDN'T EXIST, BUT IT DOES.

# one method to fix, clear the inode dentry cache
echo 2 > /proc/sys/vm/drop_caches

# now the error condition is fixed, and this command from before does what we expect (shows an error)
cat a2/subdir/file.txt  # should give you an error

comment:17 by binary1230, 4 years ago

just confirmed after compiling, this is still bugged in 6.1.8

comment:19 by Frank Batschulat (Oracle), 4 years ago

Owner: set to Frank Batschulat (Oracle)
Status: newaccepted

comment:20 by Frank Batschulat (Oracle), 4 years ago

Description: modified (diff)

see also:

#18776 Vagrant shared folders unable to install Package Management Plugins (Composer, PHP)
#19086 rm / rmdir not working correctly in shared folders

Note: See TracTickets for help on using tickets.

© 2023 Oracle
ContactPrivacy policyTerms of Use