bug with command line "eventghost.exe -e"

Found a bug in EventGhost? Report it here.
User avatar
kgschlosser
Site Admin
Posts: 4919
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: bug with command line "eventghost.exe -e"

Post by kgschlosser » Sat Apr 21, 2018 9:48 am

OK so i have been working on this quite a bit. and I have managed to get this whole thing running as a multi-threaded asynchronous overlapped IO pipe. What this means is it doesn't operate round robin style. so it can handle multiple instances of the pipe writing data back and forth and no set intervals. so while one instance is reading another can be writing. This is going to be very useful in the future when we eventually get EG to run as a service. there will be a lot of data that is going to need to be transferred between a GUI and the service. and this is the mechanism to do it. and the best part is i wrote it so that it only uses the python standard library and is pure python so no problematic use of pywin32. I still have a few kinks to iron out but it is looking really good. I could not find a single piece of information of something like this being done in python. So i may convert it into a python library.
If you like the work I have been doing then feel free to Image

User avatar
kgschlosser
Site Admin
Posts: 4919
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: bug with command line "eventghost.exe -e"

Post by kgschlosser » Sat Apr 21, 2018 11:34 pm

Ok so I believe I have worked out all the kinks. I am sure someone will find a bug in it. When I get home I will submit the code to be added to EG that will cause a build to take place. When it is done building I will post a link to the download. It will not update the build button at the top of the forum until the code clears quality control. I feel really good about the code that has been done up on this. The original code I knew was going to need some work, I thought it would suffice for our current needs. This new code should be good for a very very long time. I made it scalable
If you like the work I have been doing then feel free to Image

User avatar
kgschlosser
Site Admin
Posts: 4919
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: bug with command line "eventghost.exe -e"

Post by kgschlosser » Sun Apr 22, 2018 2:44 am

I haven't tried the build yet but here is the link to it if anyone wants to give it a go. This one has the updated named pipe.

https://ci.appveyor.com/api/buildjobs/k ... _Setup.exe
If you like the work I have been doing then feel free to Image

Snowbird
Experienced User
Posts: 364
Joined: Fri Jul 03, 2009 10:04 am

Re: bug with command line "eventghost.exe -e"

Post by Snowbird » Mon Apr 23, 2018 8:01 pm

ok, so here is the error I got after a few hours of usage :

Code: Select all

Traceback (most recent call last):
  File "EventGhost.pyw", line 53, in <module>
  File "C:\Program Files (x86)\EventGhost\eg\__init__.py", line 31, in <module>
    import Cli
  File "C:\Program Files (x86)\EventGhost\eg\Cli.py", line 183, in <module>
    send_message('eg.TriggerEvent', *args.startupEvent)
  File "C:\Program Files (x86)\EventGhost\eg\Cli.py", line 110, in send_message
    '%s, %s' % (msg, str(msg_args))
  File "C:\Program Files (x86)\EventGhost\eg\NamedPipe.py", line 1095, in send_message
    raise PipeError(err)
eg.NamedPipe.PipeError: The pipe has been ended. [0x0000006D]
I left the default settings as is : Allow "3" named pipe, i'm going to change it to 6 and see what happens.

BTW, is there a way to get the date and time in EG log so we can know exactly when errors occur ?

User avatar
kgschlosser
Site Admin
Posts: 4919
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: bug with command line "eventghost.exe -e"

Post by kgschlosser » Tue Apr 24, 2018 12:16 am

give me some information in what you were doing when this error occurred. or what was happening. Did it happen while you were tinkering with it?

Did it happen at some other point?



this is what takes place when you have EG already open and run eventghost with the --event switch.


a second copy of EG starts and it check for the existence of the pipe. if the pipe is found then there is a copy of EG already running.
Since there is a copy of EG running it will then proceed to check which command line arguments were used and it will determine if anything needs to be sent through the pipe. and if something does it will make a connection to the pipe and send the information. it will then read the pipe to get an answer.

the server side reads that lane on the pipe takes the command and processes it. after it is done processing it it will take any returned information and send it back through to the client. if an error occurs during that processing the server will close that channel in the pipe. thus disconnecting the client.

The error that you got was from the client side not the server side. Now that i think about it i need to change the client side up a bit. This is due to the second instance getting stuck and the process not closing because the traceback has occurred.


I am going to make it so that the program terminates in a error state. this way whatever program you are using to trigger the event will be able to read that it closed in an error state and it can try to resend the event.

I have been rewriting the named pipe portion again to make it a more full featured client and server This was a a test run to see how it went.

When reporting the error I am going to need a full copy of the log file not just the one error. because the client and server are going to be spitting out information before and after the error that is going to tell me what happened. If you do not want to post the log in the open forum send it to me in a PM


also changing the number of connections is not going to fix that error. the error occurred because the server closed the pipe on the client for some reason.
If you like the work I have been doing then feel free to Image

Snowbird
Experienced User
Posts: 364
Joined: Fri Jul 03, 2009 10:04 am

Re: bug with command line "eventghost.exe -e"

Post by Snowbird » Tue Apr 24, 2018 6:42 am

ok, I think you're on the right track ! :) I've sent you a PM with a complete log and some explanations, hope it helps, if you need more things let me know !

Snowbird
Experienced User
Posts: 364
Joined: Fri Jul 03, 2009 10:04 am

Re: bug with command line "eventghost.exe -e"

Post by Snowbird » Sun Apr 29, 2018 6:24 am

hi, any progress on this ?

User avatar
kgschlosser
Site Admin
Posts: 4919
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: bug with command line "eventghost.exe -e"

Post by kgschlosser » Sun Apr 29, 2018 8:39 am

when i get it working 100% you will be the first to know.
If you like the work I have been doing then feel free to Image

Snowbird
Experienced User
Posts: 364
Joined: Fri Jul 03, 2009 10:04 am

Re: bug with command line "eventghost.exe -e"

Post by Snowbird » Sat May 26, 2018 6:22 am

I tried the latest WIP, and the problem is still there regarding the namedpipe, it works fine for a while then suddenly EG runs a new instance of itself... (a new EG process is created on top of the current one), and then the mess starts everywhere since most of the plugins are ran twice, events are generated twice, etc. and it ends up freezing EG because it's not a normal use. I can assure you that there's nothing helpful in the log. I can't give you any clue unfortunately, I know you have tested this and everything works for you, but I'm pretty sure that there is still something that needs to be fixed. The thing I don't understand is why it works fine for many hours, sometimes days, and suddenly starts acting weird, this is really strange....

dan Edens
Experienced User
Posts: 61
Joined: Mon Sep 24, 2018 7:57 pm

Re: bug with command line "eventghost.exe -e"

Post by dan Edens » Tue Nov 12, 2019 3:26 pm

kgschlosser wrote:
Fri Dec 01, 2017 5:21 pm
ok so i have to try and figure out how to stall the bugger until the pipe can get recreated. at least I think I am on the right track.
2019-11-12 09_19_19-Task Manager.png
2019-11-12 09_19_19-Task Manager.png (8.06 KiB) Viewed 21 times
So i think I'm having a similar issue.

Code: Select all

"C:/Program Files (x86)/EventGhost/EventGhost.exe" -event underkey

most of the time, the events my logitech mouse and headset fire through the Lcore manger with the above line go to my currently running instance of EG. but every once and a while, each button press launchs a new instance. I thought it had to do with permissions, but I've run it every which way permissions up down and sideways and it doesn't reproduce. Any ideas?

dan Edens
Experienced User
Posts: 61
Joined: Mon Sep 24, 2018 7:57 pm

Re: bug with command line "eventghost.exe -e"

Post by dan Edens » Tue Nov 12, 2019 3:47 pm

okay so figured out a bit more.
I knew it usually started working fine, than needs a logout when it happens and than it's fine again.
But lately it wasn't working and I figured out why. I don't usually "launch eg when boot" but I had it checked.
2019-11-12 09_39_46-Task Manager.png
2019-11-12 09_39_46-Task Manager.png (6.16 KiB) Viewed 20 times
I should be good just relogging whenever it happens, but it would be really cool to be able to name and target instances for that -event flag. Don't even remotely know how that would be possible and probably isn't but I'd run 2-3 instances at once If i could haha.

like it'd be cool to have a testing Instance I can crash repeatably without having to reset my on boot global vars (excessively polluted namespace is my middlename(s?))
a stable/hotkey instance that can remain stable through those crashes.
and a monitor instance(currently i make due with a secondary windows 7 machine works great) to run my pingers on field gear and control my other machines during reboots/while in the field and shit on my main machine.

EG is slowly turning into my entire OS :D

User avatar
kgschlosser
Site Admin
Posts: 4919
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: bug with command line "eventghost.exe -e"

Post by kgschlosser » Tue Nov 12, 2019 3:55 pm

dan Edens wrote:
Tue Nov 12, 2019 3:47 pm
but I'd run 2-3 instances at once If i could haha.
I have said it many times and I will say it many times more I am sure. With EG anything is possible.

Code: Select all

eventghost.exe -multiload
you just have to be super careful about conflicting macros. you do not want to end up with EG instances having a war.
If you like the work I have been doing then feel free to Image

dan Edens
Experienced User
Posts: 61
Joined: Mon Sep 24, 2018 7:57 pm

Re: bug with command line "eventghost.exe -e"

Post by dan Edens » Tue Nov 12, 2019 4:36 pm

kgschlosser wrote:
Tue Nov 12, 2019 3:55 pm
dan Edens wrote:
Tue Nov 12, 2019 3:47 pm
but I'd run 2-3 instances at once If i could haha.
I have said it many times and I will say it many times more I am sure. With EG anything is possible.

Code: Select all

eventghost.exe -multiload
you just have to be super careful about conflicting macros. you do not want to end up with EG instances having a war.
O i can get it to multiload just fine, infact maybe i could disable it to fix this?
Problem is targeting the -event flag to not open up a new instance for every event.

User avatar
kgschlosser
Site Admin
Posts: 4919
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: bug with command line "eventghost.exe -e"

Post by kgschlosser » Tue Nov 12, 2019 8:51 pm

it has to open a new instance for every event. how else would the event manage to get to the running instance?

so this is how the process works. if you do not have EG running and you use the -e command line parameter it is going to start EG and that event will get triggered. and it is going to leave EG open.

If you already have a running instance of EG and then you run EG again using the -e command line parameter. the new instance checks to see if there is an already running instance. if there is then it connects to the already running instance over a socket connection that is bound to the loopback adapter and sends the event to the running instance and then the new instance is supposed to close.

I am not sure why sometimes the damned thing gets stuck. I have tried and tried and tried to get the thing to get stuck on my test system and I have not been able to. it seems to always work. I have run tests where 100 simultaneous eg instances get creates and events get triggered to a running instance. I have run looping tests that keep on triggering events for days on end one every 20 or so milliseconds. and never do I end up with an instance getting stuck.

I need to be able to replicate the issue to be able to isolate where the problem is. I have tried and tried and tried. I am not denying the fact that there is some kind of a problem. There is..where the problem is stemming from is beyond me.

one of the things I have thought about doing was compiling that portion of EG into a DLL and generate the pdb file along with it so we can use a debugger to track down the problem.

the multiload is not the issue. The issue is something is getting stuck in some kind of a loop that does nothing. I have checked and rechecked the code and there is no loop that would act like this in that portion of EG.

The whole command line portion of EG is the very first thing that gets done in EG. nothing else gets loaded. there used to be a com server and that is how EG would send the events. there were 2 issues with this.. it was slow as hell and the other is that com errors may happen. every which way I have tried to get this thing to work right it seems to not want to.
If you like the work I have been doing then feel free to Image

Post Reply