Debian Bug report logs - #594162
[vboxsf] Cannot rename an open file

Package: virtualbox-guest-utils; Maintainer for virtualbox-guest-utils is Debian Virtualbox Team <team+debian-virtualbox@tracker.debian.org>; Source for virtualbox-guest-utils is src:virtualbox (PTS, buildd, popcon).

Reported by: Matthijs Melchior <mmelchior@xs4all.nl>

Date: Sun, 22 Aug 2010 16:51:01 UTC

Severity: normal

Reply or subscribe to this bug.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, Debian GNOME Maintainers <pkg-gnome-maintainers@lists.alioth.debian.org>:
Bug#593964; Package gedit. (Sun, 22 Aug 2010 16:51:04 GMT) (full text, mbox, link).


Acknowledgement sent to Matthijs Melchior <mmelchior@xs4all.nl>:
New Bug report received and forwarded. Copy sent to Debian GNOME Maintainers <pkg-gnome-maintainers@lists.alioth.debian.org>. (Sun, 22 Aug 2010 16:51:04 GMT) (full text, mbox, link).


Message #5 received at submit@bugs.debian.org (full text, mbox, reply):

From: Matthijs Melchior <mmelchior@xs4all.nl>
To: submit@bugs.debian.org, Matthijs Melchior <mmelchior@xs4all.nl>
Subject: gedit: save error on NTFS in VBox with shared folders
Date: Sun, 22 Aug 2010 18:46:07 +0200
Package: gedit
Version: 2.30.3-1
Severity: normal

*** Please type your report below this line ***

This bug occures with gedit running in Debian Linux in VirtualBox on 
WinXP with an NTFS filesystem.

Editing a file on the host filesysten and saving it gives the following 
error in a red bar on the screen:

Could not save the file /C/Temp/test-gedit.
Unexpected error: Error renaming temporary file: Text file busy

** (gedit:20691): WARNING **: Hit unhandled case 0 (Error renaming 
temporary file: Text file busy) in parse_error.

The condensed strace output for this error is as follows:

20724 open("/C/Temp/test-gedit", O_RDWR|O_CREAT|O_LARGEFILE, 0666 
<unfinished ...>
20724 <... open resumed> )              = 25
20724 open("/C/Temp/.goutputstream-P3PXHV", 
O_WRONLY|O_CREAT|O_EXCL|O_LARGEFILE, 0666 <unfinished ...>
20724 <... open resumed> )              = 26
20724 write(26, "hallo\nhallo\nhallo\n\n\n", 20 <unfinished ...>
20724 <... write resumed> )             = 20
20724 unlink("/C/Temp/test-gedit~" <unfinished ...>
20724 <... unlink resumed> )            = 0
20724 link("/C/Temp/test-gedit", "/C/Temp/test-gedit~") = -1 EPERM 
(Operation not permitted)
20724 rename("/C/Temp/test-gedit", "/C/Temp/test-gedit~" <unfinished ...>
20724 <... rename resumed> )            = 0
20724 rename("/C/Temp/.goutputstream-P3PXHV", "/C/Temp/test-gedit" 
<unfinished ...>
20724 <... rename resumed> )            = -1 ETXTBSY (Text file busy)
20724 close(26 <unfinished ...>

This suggests the reason for the problem:
The .goutputstream-P3PXHV file is being renamed before it is closed.
I believe this is a problem on NTFS...


This also suggests a workaround: make sure the 'Create backup copy' 
editor mode is checked,
                 and do the save twice (ignoring the error on the first...)

Please change gedit and/or glib to aviod this error.

-- Package-specific info:
Active plugins:
  - quickopen
  - codecomment
  - commander
  - smartspaces
  - spell
  - drawspaces
  - bracketcompletion
  - docinfo
  - modelines
  - externaltools
  - time
  - filebrowser
  - terminal
  - multiedit

No plugin installed in $HOME.

Module versions:
  - glib                  2.24.1
  - gtk+                  2.20.1
  - gtksourceview         2.10.3
  - pygobject             2.21.1
  - pygtk                 2.17.0
  - pygtksourceview       2.10.1
  - enchant               1.6.0
  - iso-codes             3.19

Python module versions:
  - python                2.6.6rc1+
  - pygtk                 2.17.0 (GTK+ 2.20.1)


-- System Information:
Debian Release: squeeze/sid
  APT prefers testing
  APT policy: (500, 'testing'), (1, 'experimental')
Architecture: i386 (i686)

Kernel: Linux 2.6.32-5-686 (SMP w/4 CPU cores)
Locale: LANG=en_US.utf8, LC_CTYPE=en_US.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages gedit depends on:
ii  gconf2                      2.28.1-3     GNOME configuration 
database syste
ii  gedit-common                2.30.3-1     official text editor of the 
GNOME
ii  iso-codes                   3.19-1       ISO language, territory, 
currency,
ii  libatk1.0-0                 1.30.0-1     The ATK accessibility toolkit
ii  libc6                       2.11.2-2     Embedded GNU C Library: 
Shared lib
ii  libcairo2                   1.8.10-4     The Cairo 2D vector 
graphics libra
ii  libenchant1c2a              1.6.0-1      a wrapper library for 
various spel
ii  libgconf2-4                 2.28.1-3     GNOME configuration 
database syste
ii  libglib2.0-0                2.24.1-1     The GLib library of C routines
ii  libgtk2.0-0                 2.20.1-1     The GTK+ graphical user 
interface
ii  libgtksourceview2.0-0       2.10.3-1     shared libraries for the 
GTK+ synt
ii  libice6                     2:1.0.6-1    X11 Inter-Client Exchange 
library
ii  libpango1.0-0               1.28.1-1     Layout and rendering of 
internatio
ii  libpython2.6                2.6.6~rc1-1  Shared Python runtime 
library (ver
ii  libsm6                      2:1.1.1-1    X11 Session Management library
ii  libx11-6                    2:1.3.3-3    X11 client-side library
ii  libxml2                     2.7.7.dfsg-4 GNOME XML library
ii  python                      2.6.5-11     interactive high-level 
object-orie
ii  python-gobject              2.21.1-2     Python bindings for the 
GObject li
ii  python-gtk2                 2.17.0-4     Python bindings for the 
GTK+ widge
ii  python-gtksourceview2       2.10.1-1     Python bindings for the 
GtkSourceV
ii  python-support              1.0.9        automated rebuilding 
support for P

Versions of packages gedit recommends:
ii  python-gnome2                 2.28.1-1   Python bindings for the 
GNOME desk
ii  zenity                        2.30.0-1   Display graphical dialog 
boxes fro

gedit suggests no packages.

-- no debconf information





Information forwarded to debian-bugs-dist@lists.debian.org, Debian GNOME Maintainers <pkg-gnome-maintainers@lists.alioth.debian.org>:
Bug#593964; Package gedit. (Mon, 23 Aug 2010 08:45:03 GMT) (full text, mbox, link).


Acknowledgement sent to 593964@bugs.debian.org:
Extra info received and forwarded to list. Copy sent to Debian GNOME Maintainers <pkg-gnome-maintainers@lists.alioth.debian.org>. (Mon, 23 Aug 2010 08:45:03 GMT) (full text, mbox, link).


Message #10 received at 593964@bugs.debian.org (full text, mbox, reply):

From: Josselin Mouette <joss@debian.org>
To: Matthijs Melchior <mmelchior@xs4all.nl>, 593964@bugs.debian.org
Subject: Re: Bug#593964: gedit: save error on NTFS in VBox with shared folders
Date: Mon, 23 Aug 2010 10:41:36 +0200
Le dimanche 22 août 2010 à 18:46 +0200, Matthijs Melchior a écrit :
> Could not save the file /C/Temp/test-gedit.
> Unexpected error: Error renaming temporary file: Text file busy

> 20724 rename("/C/Temp/.goutputstream-P3PXHV", "/C/Temp/test-gedit" 
> <unfinished ...>
> 20724 <... rename resumed> )            = -1 ETXTBSY (Text file busy)
> 20724 close(26 <unfinished ...>
> 
> This suggests the reason for the problem:
> The .goutputstream-P3PXHV file is being renamed before it is closed.
> I believe this is a problem on NTFS...

> Please change gedit and/or glib to aviod this error.

I’m afraid that renaming the file before closing it is the appropriate
behavior. I don’t think we should change this behavior because of one
broken filesystem implementation.

What kind of filesystem is /C in VirtualBox, anyway? I guess it is not
directly mounted as NTFS.

Cheers,
-- 
 .''`.
: :' :     “You would need to ask a lawyer if you don't know
`. `'       that a handshake of course makes a valid contract.”
  `-        --  J???rg Schilling





Information forwarded to debian-bugs-dist@lists.debian.org, Debian GNOME Maintainers <pkg-gnome-maintainers@lists.alioth.debian.org>:
Bug#593964; Package gedit. (Mon, 23 Aug 2010 21:21:10 GMT) (full text, mbox, link).


Acknowledgement sent to Matthijs Melchior <mmelchior@xs4all.nl>:
Extra info received and forwarded to list. Copy sent to Debian GNOME Maintainers <pkg-gnome-maintainers@lists.alioth.debian.org>. (Mon, 23 Aug 2010 21:21:10 GMT) (full text, mbox, link).


Message #15 received at 593964@bugs.debian.org (full text, mbox, reply):

From: Matthijs Melchior <mmelchior@xs4all.nl>
To: 593964@bugs.debian.org
Subject: Re: Bug#593964: gedit: save error on NTFS in VBox with shared folders
Date: Mon, 23 Aug 2010 23:17:09 +0200
On 08/23/2010 10:41 AM, Josselin Mouette wrote:
> Le dimanche 22 août 2010 à 18:46 +0200, Matthijs Melchior a écrit :
>    
>> Could not save the file /C/Temp/test-gedit.
>> Unexpected error: Error renaming temporary file: Text file busy
>>      
>    
>> 20724 rename("/C/Temp/.goutputstream-P3PXHV", "/C/Temp/test-gedit"
>> <unfinished ...>
>> 20724<... rename resumed>  )            = -1 ETXTBSY (Text file busy)
>> 20724 close(26<unfinished ...>
>>
>> This suggests the reason for the problem:
>> The .goutputstream-P3PXHV file is being renamed before it is closed.
>> I believe this is a problem on NTFS...
>>      
>    
>> Please change gedit and/or glib to aviod this error.
>>      
> I’m afraid that renaming the file before closing it is the appropriate
> behavior. I don’t think we should change this behavior because of one
> broken filesystem implementation.
>
> What kind of filesystem is /C in VirtualBox, anyway? I guess it is not
> directly mounted as NTFS.
>
> Cheers,
>    

It is a VBox shared folder:
$ df -hT /C
Filesystem    Type    Size  Used Avail Use% Mounted on
C_DRIVE     vboxsf    233G   46G  188G  20% /C

The error can be handled more graceful:
After the ETXTBSY error, the file can be saved to its original name
(which has been moved away to its backup name already) and after that
is successful remove the temporary file. This is not an efficient way
to save a file, but it does not change behavior on sane filesystems
and is expected work on the VBox shared folders...

-- 
Thanks for your attention.

	Matthijs Melchior.






Information forwarded to debian-bugs-dist@lists.debian.org, Debian GNOME Maintainers <pkg-gnome-maintainers@lists.alioth.debian.org>:
Bug#593964; Package gedit. (Tue, 24 Aug 2010 07:51:09 GMT) (full text, mbox, link).


Acknowledgement sent to Josselin Mouette <joss@debian.org>:
Extra info received and forwarded to list. Copy sent to Debian GNOME Maintainers <pkg-gnome-maintainers@lists.alioth.debian.org>. (Tue, 24 Aug 2010 07:51:09 GMT) (full text, mbox, link).


Message #20 received at 593964@bugs.debian.org (full text, mbox, reply):

From: Josselin Mouette <joss@debian.org>
To: Matthijs Melchior <mmelchior@xs4all.nl>, 593964@bugs.debian.org
Cc: pkg-virtualbox-devel@lists.alioth.debian.org
Subject: Re: Bug#593964: gedit: save error on NTFS in VBox with shared folders
Date: Tue, 24 Aug 2010 09:47:55 +0200
clone 593964 -1
retitle 593964 [glocalfileoutputstream] Fallback for filesystems that don’t support renames on open files
severity 593964 wishlist
reassign 593964 libglib2.0-0
retitle -1 [vboxsf] Cannot rename an open file
reassign -1 virtualbox-ose-guest-utils
thanks

Le lundi 23 août 2010 à 23:17 +0200, Matthijs Melchior a écrit :
> >> Could not save the file /C/Temp/test-gedit.
> >> Unexpected error: Error renaming temporary file: Text file busy
> >    
> >> 20724 rename("/C/Temp/.goutputstream-P3PXHV", "/C/Temp/test-gedit"
> >> <unfinished ...>
> >> 20724<... rename resumed>  )            = -1 ETXTBSY (Text file busy)
> >> 20724 close(26<unfinished ...>
> >>
> >> This suggests the reason for the problem:
> >> The .goutputstream-P3PXHV file is being renamed before it is closed.
> >> I believe this is a problem on NTFS...

> It is a VBox shared folder:
> $ df -hT /C
> Filesystem    Type    Size  Used Avail Use% Mounted on
> C_DRIVE     vboxsf    233G   46G  188G  20% /C
> 
> The error can be handled more graceful:
> After the ETXTBSY error, the file can be saved to its original name
> (which has been moved away to its backup name already) and after that
> is successful remove the temporary file. This is not an efficient way
> to save a file, but it does not change behavior on sane filesystems
> and is expected work on the VBox shared folders...

Feel free to raise the issue to upstream developers. I personally
consider this is an issue in the vboxsf implementation.

Note that SUSv3 allows rename() to fail when the directory is busy, but
not when the file itself is busy. The ETXTBUSY error code is for another
case which is irrelevant on Linux: “The file to be renamed is a pure
procedure (shared text) file that is being executed.”

Cheers,
-- 
 .''`.
: :' :     “You would need to ask a lawyer if you don't know
`. `'       that a handshake of course makes a valid contract.”
  `-        --  J???rg Schilling





Bug 593964 cloned as bug 594162. Request was from Josselin Mouette <joss@debian.org> to control@bugs.debian.org. (Tue, 24 Aug 2010 07:51:10 GMT) (full text, mbox, link).


Changed Bug title to '[vboxsf] Cannot rename an open file' from 'gedit: save error on NTFS in VBox with shared folders' Request was from Josselin Mouette <joss@debian.org> to control@bugs.debian.org. (Tue, 24 Aug 2010 07:51:14 GMT) (full text, mbox, link).


Bug reassigned from package 'gedit' to 'virtualbox-ose-guest-utils'. Request was from Josselin Mouette <joss@debian.org> to control@bugs.debian.org. (Tue, 24 Aug 2010 07:51:15 GMT) (full text, mbox, link).


Bug No longer marked as found in versions gedit/2.30.3-1. Request was from Josselin Mouette <joss@debian.org> to control@bugs.debian.org. (Tue, 24 Aug 2010 07:51:16 GMT) (full text, mbox, link).


Bug reassigned from package 'virtualbox-ose-guest-utils' to 'virtualbox-guest-utils'. Request was from Andreas Beckmann <anbe@debian.org> to control@bugs.debian.org. (Wed, 03 Apr 2019 07:36:52 GMT) (full text, mbox, link).


Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Wed Sep 25 02:48:08 2024; Machine Name: bembo

Debian Bug tracking system

Debbugs is free software and licensed under the terms of the GNU Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.