After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 403140 - gedit doesn't close files when canceling opening (and blocks CDROM eject)
gedit doesn't close files when canceling opening (and blocks CDROM eject)
Status: RESOLVED FIXED
Product: gedit
Classification: Applications
Component: general
2.17.x
Other Linux
: Normal normal
: ---
Assigned To: Gedit maintainers
Gedit maintainers
Depends on:
Blocks:
 
 
Reported: 2007-02-01 09:55 UTC by Sebastien Bacher
Modified: 2007-02-06 13:38 UTC
See Also:
GNOME target: ---
GNOME version: 2.17/2.18


Attachments
proposed patch (430 bytes, patch)
2007-02-06 09:17 UTC, Paolo Borelli
none Details | Review

Description Sebastien Bacher 2007-02-01 09:55:15 UTC
That bug has been described on https://launchpad.net/ubuntu/+source/gedit/+bug/82539

"Binary package hint: gedit

Ubuntu 6.10, x86, gedit 2.16.1

gedit doesn't close binary files properly. I tried to open (drag and drop) files from mounted CDROM in gedit. gedit warned me that it cannot detect character encoding, it offered some character sets. I selected CANCEL. Latter I found that file is still open in gedit when I was unable to umount CDROM. I used gedit to check files on CDROM, I was looking for some text files to read, I was not interested in binary files.

$ lsof /dev/cdrw
COMMAND PID USER FD TYPE DEVICE SIZE NODE NAME
gedit 29196 oem 16r REG 22,64 10648 1871 /media/cdrom1/isolinux.bin
gedit 29196 oem 17r REG 22,64 2048 1863 /media/cdrom1/boot.cat
gedit 29196 oem 18r REG 22,64 10648 1871 /media/cdrom1/isolinux.bin

$ ps aux | grep 29196 | grep -v grep
oem 29196 0.1 1.5 66404 23696 ? S 20:20 0:04 gedit

Steps to replicate:
1) open some regular text in gedit; this step is needed to have gedit copy up and running
2) put CDROM with some Linux to your CDROM
3) Ubuntu should mount CDROM
4) start new copy of gedit from menu, we will use this new gedit for our demo
5) open CDROM folder and 'drag and drop' some binary file to gedit
6) gedit should display message that it "cannot detect character encoding"
7) select CANCEL
8) I expect that gedit will release binary file after CANCEL but it seems that file is still open. Test with lsof tool."
Comment 1 Paolo Borelli 2007-02-06 09:17:07 UTC
Created attachment 81988 [details] [review]
proposed patch

This should fix the issue, but I do not have a cd (or a removable volume) handy here, can you guys test it and if ok apply it?

If ok it should also go in 2.16
Comment 2 Sebastien Bacher 2007-02-06 13:33:17 UTC
The patch applied to the feisty package fixes the problem 
Comment 3 Paolo Borelli 2007-02-06 13:38:52 UTC
Thanks. I tested too and committed both on HEAD and 2.16