Since a recent ubuntu update I get this when starting Geany.
`(geany:3522): GLib-ERROR **: Creating pipes for GWakeup: Too many open files`
If I disable git-changebar, it does start just fine.
@b4n any idea?
@b4n Sorry, git-changebar was an innocent victim.
@techee projectorganizer keeps file descriptors open to lots of directores (my project base directory has many subdiretories). One something tries to open one more file descriptor everything falls down. Why does projectorganizer keep so many fds?
The limit seems to be 1024 on my system, for processes started by my local non-root user. projectorganizer uses more than 1000 of them.
@kugel- check that you don't have a loop in your filesystem, even a soft link will make it go in a loop.
@techee I'm thinking [this line](https://github.com/geany/geany-plugins/blob/59118d86ef8853943dec74c9f6d6fad9...) should check for soft links, or is it intended to follow them? If it is intended to follow links then it should check the realpath of the directory has not been seen before to avoid loops.
I wonder why projectorganizer keeps FDs to all that dirs/files open.
As it descends the directory tree it opens each directory and as it reads the entries recursively opens each one thats a directory. So as it opens each child directory, each parent directory is still open since it hasn't finished reading the entries in it yet. So if you get a loop in the filesystem it will simply run out of FDs.
In the non-crashing case, after Geany finished starting, the file descriptors are still open.
I don't see loops when examining /proc/$(pidof geany)/fd
In the non-crashing case, after Geany finished starting, the file descriptors are still open.
I don't see any FDs that point to project files after opening.
Perhaps the limit is hit during traversal, and the code doesn't clean up properly?
I have to check. This shouldn't happen, there's no need to keep the fd's open for the directories - probably something isn't closed properly.
@elextr The plugin detects symlink loops and avoids them. It stores all visited paths to a hash table and if the paths start repeating, it stops the recursion.
@techee but the constructed path gets longer and longer so it won't compare equal, you need to compare realpath()s. Look at what happens in bash if you have the wd in the prompt, as you cd via a symlink the prompt gets longer and longer :)
@elextr Have you checked the code? I do exactly that with tm_get_real_path():
https://github.com/geany/geany-plugins/blob/master/projectorganizer/src/prjo...
And of course I've tested that when implementing it so I'm pretty sure it works alright.
@techee ok, I see, inside the recursive call and after you have opened it. I would have put the test [here](https://github.com/geany/geany-plugins/blob/109166cc6993570127383a87348cf8f6...) but anyway.
Closed #604.
github-comments@lists.geany.org