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 352717 - gedit silently ignores saving errors when saving remote files
gedit silently ignores saving errors when saving remote files
Status: RESOLVED FIXED
Product: gedit
Classification: Applications
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Gedit maintainers
Gedit maintainers
Depends on:
Blocks:
 
 
Reported: 2006-08-24 18:49 UTC by Paolo Borelli
Modified: 2006-08-25 09:42 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch (2.19 KB, patch)
2006-08-24 18:53 UTC, Paolo Borelli
none Details | Review
Patch fixing the GError related problem (2.45 KB, patch)
2006-08-25 08:15 UTC, Paolo Maggi
none Details | Review
This patch should solve both warnings (6.66 KB, patch)
2006-08-25 09:30 UTC, Paolo Maggi
committed Details | Review

Description Paolo Borelli 2006-08-24 18:49:07 UTC
- open a file without write permissions with ssh 
- modify
- save

 -> file is not saved, but no error reported
Comment 1 Paolo Borelli 2006-08-24 18:53:36 UTC
Created attachment 71542 [details] [review]
patch

this patch fixes the issue: we need to use the vfs_xfer QUERY mode in order to get notified about the errors.

I am committing this patch, can you guys test it and confirm it works for you before closing? It's a delicate issue. Testing with webdav, ftp and other protocols I have not tested is particularly appreciated.
Comment 2 Paolo Maggi 2006-08-25 08:01:32 UTC
Comment on attachment 71542 [details] [review]
patch

Testing the patch I got an warning on the terminal:

| sys:1: Warning: GError set over the top of a previous GError or uninitialized memory.
| This indicates a bug in someone's code. You must ensure an error is NULL before it's set.
| The overwriting error message was: Operation interrupted
| sys:1: Warning: instance of invalid non-instantiatable type `(null)'
| sys:1: Warning: g_signal_emit_valist: assertion `G_TYPE_CHECK_INSTANCE (instance)' failed

I have still to investigate what is going on, but looking a the patch, I'm quite sure
the first warning is due to the fact async_xfer_error is called more then once.
Comment 3 Paolo Maggi 2006-08-25 08:15:14 UTC
Created attachment 71569 [details] [review]
Patch fixing the GError related problem

This patch solve the GError related warning.

The warning was due to the fact that async_xfer_error is called more than once as shown in the following trace I got (after applying my new patch that produces better traces):

[21.255000 (12.549795)] gedit-document-saver.c:1400 (gedit_document_saver_save)
[21.255107 (0.000107)] gedit-document-saver.c:1370 (save_remote_file)
[21.255348 (0.000241)] gedit-document-saver.c:1275 (save_remote_file_real)
[21.255476 (0.000128)] gedit-document-saver.c:198 (write_document_contents)
[21.255621 (0.000145)] gedit-document-saver.c:1331 (save_remote_file_real) Saved local copy, starting xfer
[21.379927 (0.124306)] gedit-document-saver.c:1245 (async_xfer_progress) xfer phase: 0
[21.379986 (0.000059)] gedit-document-saver.c:1246 (async_xfer_progress) xfer status: 0
[21.380008 (0.000022)] gedit-document-saver.c:1064 (async_xfer_ok)
[21.432256 (0.052248)] gedit-document-saver.c:1245 (async_xfer_progress) xfer phase: 1
[21.432314 (0.000058)] gedit-document-saver.c:1246 (async_xfer_progress) xfer status: 0
[21.432337 (0.000023)] gedit-document-saver.c:1064 (async_xfer_ok)
[21.433791 (0.001454)] gedit-document-saver.c:1245 (async_xfer_progress) xfer phase: 2
[21.433844 (0.000053)] gedit-document-saver.c:1246 (async_xfer_progress) xfer status: 0
[21.433866 (0.000022)] gedit-document-saver.c:1064 (async_xfer_ok)
[21.434182 (0.000316)] gedit-document-saver.c:1245 (async_xfer_progress) xfer phase: 2
[21.434216 (0.000034)] gedit-document-saver.c:1246 (async_xfer_progress) xfer status: 0
[21.434237 (0.000021)] gedit-document-saver.c:1064 (async_xfer_ok)
[21.435683 (0.001446)] gedit-document-saver.c:1245 (async_xfer_progress) xfer phase: 2
[21.435730 (0.000047)] gedit-document-saver.c:1246 (async_xfer_progress) xfer status: 1
[21.435785 (0.000055)] gedit-document-saver.c:1220 (async_xfer_error) Set the error: "Operation not permitted"
[21.436049 (0.000264)] gedit-document-saver.c:1245 (async_xfer_progress) xfer phase: 2
[21.436079 (0.000030)] gedit-document-saver.c:1246 (async_xfer_progress) xfer status: 1
[21.436119 (0.000040)] gedit-document-saver.c:1231 (async_xfer_error) Error already set.
The new (skipped) error is: "Operation interrupted"
[21.436319 (0.000200)] gedit-document-saver.c:1245 (async_xfer_progress) xfer phase: 16
[21.436347 (0.000028)] gedit-document-saver.c:1246 (async_xfer_progress) xfer status: 0
[21.436367 (0.000020)] gedit-document-saver.c:1064 (async_xfer_ok)
[21.443764 (0.007397)] gedit-document-saver.c:312 (save_completed_or_failed) save failed

I still have the following warning:

sys:1: Warning: instance with invalid (NULL) class pointer
sys:1: Warning: g_signal_emit_valist: assertion `G_TYPE_CHECK_INSTANCE (instance )' failed

Note that if I try to save twice, I only got the above warning the first time.
Comment 4 Paolo Maggi 2006-08-25 09:30:43 UTC
Created attachment 71575 [details] [review]
This patch should solve both warnings

Warning were due to the fact the "saving" signal was emitting from a finalized saver.
Comment 5 Paolo Maggi 2006-08-25 09:42:33 UTC
Fixed in the development version. The fix will be available in the next major release. Thank you for your bug report.