#256 GFileMonitor and g_object_ref

closed-postponed
General (289)
7
2009-01-25
2009-01-19
No

Hi, this morning i updated to latest version from svn (revision 3487).
Sometimes immediately when i save current or after 3-5 minutes after last save file Geany ask me :
"The file 'somefile' on the disk is more recent than the current buffer. Do you want to reload buffer?"
I`m not sure whether this is bug in Geany, bug in GFileMonitor or some strange new feauture but this is really confusing.
Also, in debug window i see :
10:03:34: CRITICAL : g_object_ref: assertion `G_IS_OBJECT (object)' failed
10:03:34: CRITICAL : g_object_ref: assertion `G_IS_OBJECT (object)' failed
10:03:34: CRITICAL : gdk_window_get_parent: assertion `GDK_IS_WINDOW
but i think this messages is not connected with FileMonitor bug.

If this is not bug, please excuse me, and accept my apologies. :)

OS : Ubuntu 8.10
INFO: Geany 0.16 (svn >= r3487), GTK+ 2.14.4, GLib 2.18.2

Discussion

  • Colomban Wendling

    Hi,

    Same for me but the critical warnings. But for me the message appears about 10~ seconds after I saved the file, and not every times. For now it is unfortunately more annoying than anything else.

    Using Geany SVN r3489 under Debian GNU/Linux (GTK+ 2.12.11, GLib 2.16.6)

    Regards,
    Colomban W.

     
  • Atanas Beloborodov

    Yep, i almost lost my work for today, becouse after reloading file, Ctrl+z keybind does not work anymore :D
    I`m totally newbie in Gtk and C things, but i will try to fix or disable this moniotoring for now :/

     
  • Enrico Tröger

    Enrico Tröger - 2009-01-19

    First of all, please don't complain too much, you are using a SVN version aka development version. And the code from r3484 (the GIO stuff) wasn't even 24hours old when you reported this. So, calm down, thanks.

    Back to the topic:
    you both don't say which version of GVFS you are running and whether you have FAM or Gamin running. Also interesting would be which files you opened, when exactly Geany says they were changed and on what filesystems these files are located.

    I have written and tested the code on Debian with GTK 2.14.7, GLib 2.18.4, GVFS 1.0.3 ad Gamin (tried also with FAM).
    Additionally, I just tested the code on an emulated Ubuntu 8.10 installation and there it works also.

    So, I'm not yet sure what's causing your problems but I want to get them fixed :).

    I know this sounds poor but are you sure you have a clean build? Did you try 'make distclean' and re-ran ./autogen.sh (assuming you use autotools to build the code)?

    A great help would be to start Geany in gdb and run it with: r --g-fatal-warnings
    gdb will then stop the program when the first critical warning appears, then type 'bt' and then paste it to nopaste.geany.org or attach it to this report.

    Admittedly, the code still has bugs but these are rather unoffending compared to the reported issues.

     
  • Enrico Tröger

    Enrico Tröger - 2009-01-19
    • priority: 5 --> 7
    • assigned_to: nobody --> eht16
     
  • Nobody/Anonymous

    Hi,

    I wasn't "complaining too much", I know I use a unstable release, I would just add my comments to this, mostly to approve that this is true for me too. I never meant you were wrong when commiting it or anything like that; and I'm happy of the GIO adds since I think GIO is a really cool library with cool features I think useful (like this one). Sorry if I seemed angry or so, I wouldn't and wasn't :).

    Well, on the topic:
    I really dunno which version of GVFS I really use, but I see gnome-vfs-daemon running, and libgnomevfs2 I've installed is 2.22.0, under Debian Lenny (Testing); and I've not the gvfs package itself (I'll try with soon but I don't think it'll fix).
    For a deamon like gamin or fam, I've gamin installed (0.1.9) but I don't see it running. But I'm not really aware of how these two thinks works, perhaps I miss something.

    Rebuilding all doesn't fix the problem (even if it seems to appear rarely, but still appear).
    I've not run Geany within GDB since as reported I have no warnings, and I think nask0's warnings are not related to this.

    Regards,
    Colomban W.

     
  • Colomban Wendling

    Hi again, and sorry for not being logged last time (I have login problems on SF.net, seems).

    I've done some tries to find when the problems occurs or not, and it seems to occur more if I do something immediately after saving, such as continuing typing, switching window… hum, when I made kinda overhead on my machine. And it occurs really soon after saving, about 1 or two seconds, not more after all.
    Isn't there a timeout to not be notified of the change when saving? For me it seems to be something like that Geany is notified of its own saving. Is this possible or am I completely offtopic?

    Hope it could help.

    Regards,
    Colomban W.

     
  • Enrico Tröger

    Enrico Tröger - 2009-01-19

    > I wasn't "complaining too much", I know I use a unstable release, I would
    and please don't take me too serious sometimes, I really forgot to add a smiley. :).

    > I really dunno which version of GVFS I really use, but I see
    > gnome-vfs-daemon running, and libgnomevfs2 I've installed is 2.22.0, under
    > Debian Lenny (Testing); and I've not the gvfs package itself (I'll try with
    > soon but I don't think it'll fix).

    Hm, GVFS is the key of all the GIO topic. And GVFS is the sucessor of gnome-vfs. To easily find out what's installed run:
    dpkg -l | grep gvfs

    Furthermore, the code in Geany assumes that the package gvfs as well as gvfs-fuse are installed, without all the code is pretty pointless.

    > For a deamon like gamin or fam, I've gamin installed (0.1.9) but I don't
    > see it running.

    ps -ef | grep gam
    should give something like
    /usr/lib/gamin/gam_server

    > Isn't there a timeout to not be notified of the change when saving? For me
    > it seems to be something like that Geany is notified of its own saving. Is

    No, there is no timeout at all anymore. That's the whole point of the GIO based file monitoring: we don't poll the files anymore instead we get notified by GIO that the file was changed/deleted/created and GIO gets these information by FAM, Gamin or polling. FAM and Gamin use (if available) the kernel inotify mechanism or polling as fallback.
    But as I said earlier, it's not yet 100% functional.

    So, with the GIO-based code the timeout setting in the prefs dialog is only used when no FAM or Gamin is available. It's not yet documented but will follow.

    I still don't know which files you have opened. Anything remote or local? Any special filesystem?

     
  • Colomban Wendling

    >Hm, GVFS is the key of all the GIO topic. And GVFS is the sucessor of
    >gnome-vfs.
    I've installed GVFS and true, I can now access remote files with GIO (g_file_*()), nice :).
    But it changes nothing to this problem, and Geany is still unable to open arbitrary remote files (not mounted in any VFS) such a file on an HTTP server, telling me that "The URI '[…]' could not be resolved to a local path. This means that the URI is invalid or that you don't have gvfs-fuse installed."; but i have gvfs and gvfs-fuse installed (and seems to work with g_file_new_for_uri()).
    Is there any thing to do to use GVFS or I just need to mount the remote location in some way?

    About gamin: It wasn't running, and start it doesn't change anything (even when restarting Geany).

    If I need to restart something to get GVFS working everywhere, just tell me.

    > No, there is no timeout at all anymore.
    Hum, dunno if you understood what I would say:
    I meant that when Geany saves the buffer, the file gets changed; then GIO should forward the notification to all listeners, even Geany. No? If yes, then how Geany could know if the notification was generated by its own save of the file or by an external change? Perhaps I'm wrong and GIO authors or you have already fixed this kind of problems in some way, I just suppose it can cause confusing.

    >I still don't know which files you have opened. Anything remote or local?
    >Any special filesystem?
    Oops, sorry. No, nothing special for me, only local files on an EXT3 filesystem.

    Thanks for the time you spend on this :)

    Regards,
    Colomban W.

     
  • Enrico Tröger

    Enrico Tröger - 2009-01-19

    > arbitrary remote files (not mounted in any VFS) such a file on an HTTP
    > server, telling me that "The URI '[…]' could not be resolved to a local
    > path. This means that the URI is invalid or that you don't have gvfs-fuse
    > installed."; but i have gvfs and gvfs-fuse installed (and seems to work
    > with g_file_new_for_uri()).

    Completely unrelated to Geany.
    HTTP usually doesn't support write operations, right? So how do you want to write files to it or even mount it?
    Instead, use dav:// assuming your server supports it. Then you can mount it as usual and after having mounted it, you can open and edit files on it.

    Regarding the original problem: I'll revise my code tomorrow and see whether I can find and fix anything.

    > If I need to restart something to get GVFS working everywhere, just tell me.
    Usually you don't need to start anything. All necessary GVFS apps and daemons are launched by DBus once needed provided a proper DBus setup but that should be valid when using Gnome.

    > should forward the notification to all listeners, even Geany. No? If yes,
    > then how Geany could know if the notification was generated by its own save
    > of the file or by an external change? Perhaps I'm wrong and GIO authors or

    Yes, that's the way. And when we save the file in Geany, we set an ignore flag to ignore the next 'file has changed' signal. And there probably begin the problems.
    Also, this works only if the file was actually only changed which happens when saving with Geany. When you save the file with Gedit, it (probably) won't work because Gedit first saves the file into a temp file, then move it to the real file. So, the real file is never 'changed' but 'created'. And the 'created' notification is currently ignored at all.
    This doesn't really explain your problems, I think. But is one of the things I meant when saying 'not yet 100% functional'. Let me give it another try tomorrow and in the meantime just revert to before r3484 :).

    > Oops, sorry. No, nothing special for me, only local files on an EXT3 filesystem.

    Too bad, I hoped there was something real exotic which would explain the behaviour :).

    P.S.: quoting in the tracker is awful. Moving to the mailing list?

     
  • Enrico Tröger

    Enrico Tröger - 2009-01-25
    • status: open --> closed-postponed
     
  • Enrico Tröger

    Enrico Tröger - 2009-01-25

    The GIO based file monitoring has been disabled for now in SVN, the original problem has been fixed, so this report is more or less invalid now.

     

Log in to post a comment.