I'm on 1.34.1 . Win10
When double clicked on any geany associated file (let's say txt), or when other tools "push" some files to external editor (mine is geany) every time a new instance pops-up. It started to behave like this Today without any errors or warnings. Important is that when double click on text file it used to open in 1/10 of blink of an eye. Now it takes about 2 seconds to open. I've tried to re-install already.
I've run it with verbose, but there is not enough to debug for me
![geany-cmd](https://user-images.githubusercontent.com/7257442/53801982-8b578d00-3f38-11e...)
procexp of two running geanys
![geanys](https://user-images.githubusercontent.com/7257442/53801710-d0c78a80-3f37-11e...)
_Originally posted by @volcik in https://github.com/geany/geany/issues/641#issuecomment-469643957_
I have also done the same with all plugins disabled
@volcik I'm pretty much sure your problem is related to the mentioned(in #641) TCP port being used or in some other way unusable. In the PR mentioned above, I added some more logging and another flag to bind to the TCP port which should better suit our use case here.
If you want to try, I put binaries with the above changes on https://download.geany.org/snapshots/geany_win32_issue_641.zip (just copy geany.exe libgeany-0.dll from archive to your bin/ folder in your Geany installation and restart Geany). You should find some error messages at the top of Help->Debug Messages if there are errors.
Thanks, I've downloaded the ZIP
Used open with on Desktop ETH.txt - 1st instance has opened, and its Debug is :
23:23:28: Geany WARNING : Failed to bind IPC socket (127.0.0.1:49876): 10013: An attempt was made to access a socket in a way forbidden by its access permissions. 23:23:28: Geany INFO : Geany 1.35 (git >= b8cdfddf), English_United Kingdom.1252 23:23:28: Geany INFO : GTK 2.24.32, GLib 2.58.1 23:23:28: Geany INFO : System data dir: C:\Programs\Geany\data 23:23:28: Geany INFO : User config dir: C:\Users\tomasz.janicki\AppData\Roaming\geany 23:23:28: Geany INFO : System plugin path: C:\Programs\Geany\lib\geany 23:23:28: Geany INFO : Added filetype Arduino (61). 23:23:28: Geany INFO : Added filetype Clojure (62). 23:23:28: Geany INFO : Added filetype CUDA (63). 23:23:28: Geany INFO : Added filetype Cython (64). 23:23:28: Geany INFO : Added filetype Genie (65). 23:23:28: Geany INFO : Added filetype Graphviz (66). 23:23:28: Geany INFO : Added filetype JSON (67). 23:23:28: Geany INFO : Added filetype Scala (68). 23:23:28: Geany INFO : Added filetype vdi (69). 23:23:28: Geany INFO : Added filetype vds (70). 23:23:28: Geany WARNING : IPC socket could not be created, see Help->Debug Messages for details. 23:23:28: SpellCheck DEBUG : Initializing Enchant library version 2.2.3 23:23:28: SpellCheck WARNING : Stored language ('en_GB') could not be loaded. 23:23:28: Geany INFO : Loaded: C:\Programs\Geany\lib\geany\spellcheck.dll (Spell Check) 23:23:28: Geany INFO : C:\Users\tomasz.janicki\Desktop\ETHx.txt : None (UTF-8)
Used open with on Desktop PC.txt - 2nd instance has opened, and its Debug is:
23:24:00: Geany INFO : Geany 1.35 (git >= b8cdfddf), English_United Kingdom.1252 23:24:00: Geany INFO : GTK 2.24.32, GLib 2.58.1 23:24:00: Geany INFO : System data dir: C:\Programs\Geany\data 23:24:00: Geany INFO : User config dir: C:\Users\tomasz.janicki\AppData\Roaming\geany 23:24:00: Geany INFO : System plugin path: C:\Programs\Geany\lib\geany 23:24:00: Geany INFO : Added filetype Arduino (61). 23:24:00: Geany INFO : Added filetype Clojure (62). 23:24:00: Geany INFO : Added filetype CUDA (63). 23:24:00: Geany INFO : Added filetype Cython (64). 23:24:00: Geany INFO : Added filetype Genie (65). 23:24:00: Geany INFO : Added filetype Graphviz (66). 23:24:00: Geany INFO : Added filetype JSON (67). 23:24:00: Geany INFO : Added filetype Scala (68). 23:24:00: Geany INFO : Added filetype vdi (69). 23:24:00: Geany INFO : Added filetype vds (70). 23:24:00: Geany WARNING : IPC socket could not be created, see Help->Debug Messages for details. 23:24:00: SpellCheck DEBUG : Initializing Enchant library version 2.2.3 23:24:00: SpellCheck WARNING : Stored language ('en_GB') could not be loaded. 23:24:00: Geany INFO : Loaded: C:\Programs\Geany\lib\geany\spellcheck.dll (Spell Check) 23:24:00: Geany INFO : C:\Users\tomasz.janicki\Desktop\ETHx.txt : None (UTF-8) 23:24:00: Geany INFO : C:\Users\tomasz.janicki\Desktop\PCs.txt : None (UTF-8)
Opened third from Desktop, config.xlaunch, third instance openened its Debug is:
23:24:45: Geany INFO : Geany 1.35 (git >= b8cdfddf), English_United Kingdom.1252 23:24:45: Geany INFO : GTK 2.24.32, GLib 2.58.1 23:24:45: Geany INFO : System data dir: C:\Programs\Geany\data 23:24:45: Geany INFO : User config dir: C:\Users\tomasz.janicki\AppData\Roaming\geany 23:24:46: Geany INFO : System plugin path: C:\Programs\Geany\lib\geany 23:24:46: Geany INFO : Added filetype Arduino (61). 23:24:46: Geany INFO : Added filetype Clojure (62). 23:24:46: Geany INFO : Added filetype CUDA (63). 23:24:46: Geany INFO : Added filetype Cython (64). 23:24:46: Geany INFO : Added filetype Genie (65). 23:24:46: Geany INFO : Added filetype Graphviz (66). 23:24:46: Geany INFO : Added filetype JSON (67). 23:24:46: Geany INFO : Added filetype Scala (68). 23:24:46: Geany INFO : Added filetype vdi (69). 23:24:46: Geany INFO : Added filetype vds (70). 23:24:46: Geany WARNING : IPC socket could not be created, see Help->Debug Messages for details. 23:24:46: SpellCheck DEBUG : Initializing Enchant library version 2.2.3 23:24:46: SpellCheck WARNING : Stored language ('en_GB') could not be loaded. 23:24:46: Geany INFO : Loaded: C:\Programs\Geany\lib\geany\spellcheck.dll (Spell Check) 23:24:46: Geany INFO : C:\Users\tomasz.janicki\Desktop\ETHx.txt : None (UTF-8) 23:24:46: Geany INFO : Detected encoding by regex search: UTF-8 23:24:46: Geany INFO : C:\Users\tomasz.janicki\Desktop\config.xlaunch : XML (UTF-8)
So first instance tries to bind - fails, fails creating one as well. But other instances do not try to bind ?
But you were definitely right about the socket... I will explore some settings, like Firewall [not sure what Win Update has 'forced' on me]. Not sure what has taken that socket neither.
Is 127.0.0.1:49876: 10013 changeable anywhere? Or is hard-coded
Other lead is cygwin installation, maybe it has done some havoc. Are there any complains using stand-alone geany and cygwin? Worth noting is that nothing cygwin-wise is running when I am doing these tests, and this behaviour is being experienced.
So first instance tries to bind - fails, fails creating one as well. But other instances do not try to bind ?
Yes because they see the working mutex of the first instance and so try to connect to the TCP port instead of opening a new one. I added one more debug message for exact this case in https://github.com/geany/geany/pull/2111/commits/ec10be0ddf6bc1a4f7c144de489.... The real problem remains in the failed bind of the first instance.
Is 127.0.0.1:49876: 10013 changeable anywhere? Or is hard-coded
It's hard-coded since it usually doesn't cause any problems. Even if, changing the port number probably won't solve your problem.
Other lead is cygwin installation, maybe it has done some havoc. Are there any complains using stand-alone geany and cygwin?
Not that I know of.
Hi I've just got back from holiday. How can check if the mod you have done works?
In the meantime. I've run geany with AntiVir disabled, Firewall Disabled. I use TCPView (Sysinternals) to check for used ports.
When I "open with geany" 1st txt file. Nothing gets populated in that view When I "open with geany" 2nd txt file. I can capture geany.exe getting to the list, but the connection dies quickly
![geany-tcpview](https://user-images.githubusercontent.com/7257442/55555756-e4ecdc00-56dd-11e...)
So I taught I could perhaps monitor the state of that connection somehow. I've used RawCap (to capture on loopback https://www.netresec.com/?page=RawCap ) and Wireshark to open and filter pcap (dumpfile) and I've opened couple of geanys (via "open with geany")
[dumpfile.zip](https://github.com/geany/geany/files/3043420/dumpfile.zip)
I've used (tcp.port == 49876) to filter the display in wireshark
What
Failed to bind IPC socket (127.0.0.1:49876): 10013: An attempt was made to access a socket in a way forbidden by its access permissions.
can mean ?
I've also tried as an admin, and the same result. Worth noting that if I double click, open with geany, or use a fresh geany exe then try to double click on any txt file, the result is always the same
I'll check if it is Hyper-V that is holding the socket/port, even though _netstat -ano_ does not show anyghing
I'll check if it is Hyper-V that is holding the socket/port, even though netstat -ano does not show anyghing
Got that idea from here:
https://stackoverflow.com/questions/10461257/an-attempt-was-made-to-access-a...
Geany now binds to same instance
@volcik does it work now? I cannot say what is causing `An attempt was made to access a socket in a way forbidden by its access permissions.`, this is the error message from Windows and unfortunately we cannot get more information in Geany to assist in debugging.
Yes it works now. I had to unsitlass Hyper-V. It looks like it is Win10's Hyper-V problem
Closed #2101.
So let me chime in with an alternative solution. I'm on Win10, geany 1.36 (built on or after 2019-09-28).
Recently, I ran into this very same issue. For background info: I recently upgraded to WSL2, which required the "Virtual Machine Platform" optional feature. So, we're talking Hyper-V again, I guess. Just to be clear - I'm running a windows install, not a Geany inside the linux 'VM'.
My solution was to change the port number of the IPC socket, which is by default 49876, to another number (I randomly picked 33492). Since I was to lazy to compile, I did this by grabbing my favourite hex editor, and changing two occurences of 0xd4 0xc2 inside libgeany-0.dll to 0xd4 0x82. Now it opens files again in the same instance! Hurrah!
I believe the reason is that Hyper-V acts funny if you use ports inside the Dynamic ports range, which starts at 49152, but I didn't check that. If someone wants to publish a patch to that extend, I'm happy to experiment a bit around if another port number is wanted.
Hope this is useful for someone!
The "proper" solution is to select an unused port if somebody wants to contribute the windows code to do that.
Or, as @codebrainz pointed out on IRC, somebody could provide a PR to remove the IP socket use on windows and use [windows named pipes](https://docs.microsoft.com/en-us/windows/win32/ipc/named-pipes) instead.
So let me chime in with an alternative solution. I'm on Win10, geany 1.36 (built on or after 2019-09-28).
Recently, I ran into this very same issue. For background info: I recently upgraded to WSL2, which required the "Virtual Machine Platform" optional feature. So, we're talking Hyper-V again, I guess. Just to be clear - I'm running a windows install, not a Geany inside the linux 'VM'.
My solution was to change the port number of the IPC socket, which is by default 49876, to another number (I randomly picked 33492). Since I was to lazy to compile, I did this by grabbing my favourite hex editor, and changing two occurences of 0xd4 0xc2 inside libgeany-0.dll to 0xd4 0x82. Now it opens files again in the same instance! Hurrah!
I believe the reason is that Hyper-V acts funny if you use ports inside the Dynamic ports range, which starts at 49152, but I didn't check that. If someone wants to publish a patch to that extend, I'm happy to experiment a bit around if another port number is wanted.
Hope this is useful for someone!
Could you give the offsets of the two 0xd4 0xc2's you changed? There are four occurrences of 0x34 0xc2 in libgeany-0.dll.
So let me chime in with an alternative solution. I'm on Win10, geany 1.36 (built on or after 2019-09-28). Recently, I ran into this very same issue. For background info: I recently upgraded to WSL2, which required the "Virtual Machine Platform" optional feature. So, we're talking Hyper-V again, I guess. Just to be clear - I'm running a windows install, not a Geany inside the linux 'VM'. My solution was to change the port number of the IPC socket, which is by default 49876, to another number (I randomly picked 33492). Since I was to lazy to compile, I did this by grabbing my favourite hex editor, and changing two occurences of 0xd4 0xc2 inside libgeany-0.dll to 0xd4 0x82. Now it opens files again in the same instance! Hurrah! I believe the reason is that Hyper-V acts funny if you use ports inside the Dynamic ports range, which starts at 49152, but I didn't check that. If someone wants to publish a patch to that extend, I'm happy to experiment a bit around if another port number is wanted. Hope this is useful for someone!
Could you give the offsets of the two 0xd4 0xc2's you changed? There are four occurrences of 0xd4 0xc2 in libgeany-0.dll.
Sure. At your own risk, obviously ;) my libgeany-0.dll has a md5sum of 8f657bddd306134b922ba98cb4097324. Offsets are 0x603ce and 0x603f5. my hexdump diff looks like (original top, my changes bottom). < 000603c0 43 6a ff d0 3d b7 00 00 00 74 27 c7 04 24 d4 c2 < 000603f0 00 00 c7 04 24 d4 c2 00 00 e8 7c 03 00 00 89 45 ---
000603c0 43 6a ff d0 3d b7 00 00 00 74 27 c7 04 24 d4 82 000603f0 00 00 c7 04 24 d4 82 00 00 e8 7c 03 00 00 89 45
Thank you.
Ok, so knayet's fix isn't working for me completely. I can load two files, but Geany can't seem to keep track of the 2nd one and immediately reports "file not found" after the 1st edit.
How do we reopen this issue?
Maybe we could make the port configurable via the config file/various preferences?
Reopened #2101.
And move the default port out of the dynamic range where its likely to be allocated to something at any time.
Ok, so knayet's fix isn't working for me completely. I can load two files, but Geany can't seem to keep track of the 2nd one and immediately reports "file not found" after the 1st edit.
Sorry to hear that - works for me here. You're on your own..
Are you guys using the same geany? Maybe the reason for both working and not working is the different version that you are using.
On Mon, 7 Sep 2020, 22:51 Gordon Harris, notifications@github.com wrote:
Ok, so knayet's fix isn't working for me completely. I can load two files, but Geany can't seem to keep track of the 2nd one and immediately reports "file not found" after the 1st edit.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/geany/geany/issues/2101#issuecomment-688520455, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABXL2YRMJAYVTUVXT4CYIHLSEVIU3ANCNFSM4G4V7S2A .
My md5sum for libgeany-0.dll matched knayet's and the 0xd4 0xc2s were at the offsets he stipulated.
Please stop hacking the Geany binary :D.
The linked PR adds a setting in "Various preferences" to change the TCP port number and changes the default to 45937 which should be better in terms of Hyper-V.
https://download.geany.org/snapshots/geany-1.37git55e0998c3pr2585_setup.exe This is the current GIT master with updated dependant libraries bundled (whole GTK, including the mentioned Pango and harfbuzz libraries). The ligatures seem to work properly. Note: if you have also installed the geany-plugins package, you can use the 1.36 release installer of geany-plugins. It will show warnings about version incompatibilities but it does work. Still, use at your risk :).
@gharris999 @knayet feedback is welcome.
Thank you. I'll try give this a try right away.
Ok, So I just tried it, it works! Thanks! I experimented a little bit with the port numbers, and I noted something exceptionally bizarre - port 49876 is working again? Currently, on my machine, port 50059 is now the last port to work - so port 50060 is 'magical' in some way. I don't recall any important stuff I did on my PC since I hacked the Geany binary :D so I have to blame a random windows update.
Maybe Hyper-V binds to port numbers randomly or in some other way not constant and so you experience different results between restarts. Anyway, it's probably safer to keep below the above mentioned port 49152.
Please note, the snapshot does *not* validate the entered port number but the next Geany release will accept only port numbers from 1024 to 65535. So be sure to not use a port number below 1024.
Just want to report that the geany-1.37git55e0998c3pr2585 snapshot works perfectly for me alongside WSL2. No problems at all with multiple documents.
My earlier report of having trouble with "file not found" issues was due entirely to a misconfiguration I had with WinSCP, which was launching Geany. knayet's modified binary fix was, in fact, working.
Closed #2101 via #2585.
github-comments@lists.geany.org