Error in log after system resume

This is where you report any issues if you are running a beta version of EventGhost
Forum rules
To submit a possible bug report please follow this template

Version: 0.5 beta 2 (the version you are running)
Traceback: Traceback (most recent call last):
File "<SOME_EVENTGHOST_FILE.py>", line 10, in <module>
SOME_FUNCTION()
File "<SOME_EVENTGHOST_FILE.py>", line 4, in SOME_EVENTGHOST_MODULE
SOME_FUNCTION()

copy and past any traceback information from the log if there is no traceback put NONE

Event:
Main.test.0.1.2.3.4.5.6.7.8
1
2

in the Event field you will want to put the event that was triggered just prior to the traceback occurring, if there is personal data put PERSONAL DATA if there was no traceback or no event triggered right before the traceback put NO EVENT

Description: if you have the ability to replicate the issue then put in here a description of what you are doing to create the problem.

Screen Shots: screen shots of the error and any events/macros/acrions that were run before the issue or screen shots of the problem

Files: any files that may be used to isolate where the issue is. something like the log.txt file would go here

if you provide the above information before hand it will greatly speed up the diagnostic process. we will not have to ask for the bits and pieces. And also having a well formatted Bug Report filled out will get answered sooner then the ones that aren't
Post Reply
jonib
Plugin Developer
Posts: 1299
Joined: Thu Mar 26, 2009 9:33 pm
Location: Sweden

Error in log after system resume

Post by jonib » Sat May 05, 2018 4:28 pm

Version: 0.5.0-rc4

Code: Select all

Traceback: Traceback (most recent call last):
  File "threading.pyc", line 774, in __bootstrap
  File "threading.pyc", line 801, in __bootstrap_inner
  File "threading.pyc", line 754, in run
  File "C:\Program Files (x86)\Utils\EventGhost\eg\Classes\ThreadWorker.py", line 280, in __MainLoop
    self.__DoOneEvent()
  File "C:\Program Files (x86)\Utils\EventGhost\eg\Classes\ThreadWorker.py", line 261, in __DoOneEvent
    self.__PumpWaitingMessages()
  File "C:\Program Files (x86)\Utils\EventGhost\eg\Classes\ThreadWorker.py", line 287, in __PumpWaitingMessages
    while PeekMessage(byref(msg), 0, 0, 0, PM_REMOVE):
  File "C:\Program Files (x86)\Utils\EventGhost\eg\Classes\MessageReceiver.py", line 127, in WindowProc
    res = handler(hwnd, mesg, wParam, lParam)
  File "C:\Program Files (x86)\Utils\EventGhost\plugins\System\PowerBroadcastNotifier.py", line 234, in OnPowerBroadcast
    eg.actionThread.CallWait(eg.actionThread.OnComputerResume)
  File "C:\Program Files (x86)\Utils\EventGhost\eg\Classes\ThreadWorker.py", line 84, in CallWait
    return self.Func(func, timeout)()
  File "C:\Program Files (x86)\Utils\EventGhost\eg\Classes\ThreadWorker.py", line 131, in Wrapper
    eg.PrintStack()
Traceback (most recent call last) (0.5.0-rc4):
  File "_ctypes/callbacks.c", line 315, in 'calling callback function'
  File "C:\Program Files (x86)\Utils\EventGhost\eg\Classes\MessageReceiver.py", line 127, in WindowProc
    res = handler(hwnd, mesg, wParam, lParam)
  File "C:\Program Files (x86)\Utils\EventGhost\plugins\System\PowerBroadcastNotifier.py", line 234, in OnPowerBroadcast
    eg.actionThread.CallWait(eg.actionThread.OnComputerResume)
  File "C:\Program Files (x86)\Utils\EventGhost\eg\Classes\ThreadWorker.py", line 84, in CallWait
    return self.Func(func, timeout)()
  File "C:\Program Files (x86)\Utils\EventGhost\eg\Classes\ThreadWorker.py", line 132, in Wrapper
    raise Exception("Timeout while calling %s" % func.__name__)
Exception: Timeout while calling OnComputerResume
Description: When testing to send power on to my HDTV via the Pulse-Eight CEC+ plugin after a system resume I got this error.

jonib
XBMC2 plugin to control XBMC. If you want to flatter me Image

User avatar
topix
Experienced User
Posts: 441
Joined: Sat May 05, 2007 3:43 pm
Location: Germany
Contact:

Re: Error in log after system resume

Post by topix » Sun May 06, 2018 8:27 am

When the system is resuming from sleep or hibernation EventGhost calls OnComputerResume on every plugin. So it looks like if some plugin isn't returning from that call, thus the timeout error.

Maybe the Pulse-Eight CEC+ plugin has a problem after system sleep. If you can reproduce the error, then please before sending the power on to your HDTV try stopping/starting the Pulse-Eight CEC+ plugin and/or EventGhost. (of course only to find the source of error, it shouldn't be the way for every day use)

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

Re: Error in log after system resume

Post by kgschlosser » Tue May 08, 2018 3:13 pm

This error should no longer show up as a traceback in the WIP versions of EG. This is a debugging message that will only show up when debugging is turned on. Once you turn it off this should go away.

If you read the traceback it's not a traceback per say. this line is the clue that it's not

eg.PrintStack()

it's a stack trace.
If you like the work I have been doing then feel free to Image

jonib
Plugin Developer
Posts: 1299
Joined: Thu Mar 26, 2009 9:33 pm
Location: Sweden

Re: Error in log after system resume

Post by jonib » Tue May 08, 2018 5:11 pm

OK

jonib
XBMC2 plugin to control XBMC. If you want to flatter me Image

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

Re: Error in log after system resume

Post by kgschlosser » Tue May 08, 2018 6:35 pm

This specific problem shows up a lot. The whole system designed around the eg.MainMessageReceiver needs to be done over. The reason why is because what normally takes place is when a plugin starts either the already running message receiver is used or a new one is created but the message receiver in it's self runs in it's own thread. but the plugin was started in the Action Thread. and then the handle for the main message receiver is passed to the windows notification system while in the Action thread. and not in the thread the message receiver is running in. This causes all kinds of odd behavior.

newer versions of windows have become super sensitive to everything dealing with the windows notification system being handled by the same thread. and with windows it would be preferable if that thread is the min thread, issue there is wxPython takes over the main thread functions. so handling windows notifications in that thread is not something that can be done very easily.
addressing the power notifications it is not a great idea to stall the windows notification system waiting until the action thread finishes processing the state changes sent into the plugins.

This is one of those problems that the best solution is going to be a GUI/Service. where the service can do what it needs to do in the main thread. and the GUI can run wx in it's main thread.
If you like the work I have been doing then feel free to Image

Post Reply