PDA

View Full Version : _e0d99e04_p_XAPP__AppException


xarragon
June 13th, 2010, 04:13 PM
Hello guys, I am still stuck trying to finish this neverending App that I am working on. I still have one issue that crops back up from time to time and impedes progress.

Currently I have a rather complex App that stores global state in LocalConfig and uses a special dialog box in order to purchase access to content. The dialog is defined as an XML file and then I call some code in the onLoad method which sets up images, text etc. in that dialog. I doubt this is the best way to go about it, since such behaviour usually causes some flickering when the dialog is first shown, but I am unable to get it to work at all... let alone improve it through using a dummy list or whatnot.

In short I get stuck with this error:
21:52:50 T:1472 M:692875264 DEBUG: CWin32DirectSound::CheckPlayStatus: Resuming Playback
21:52:50 T:1644 M:693075968 INFO: Scriptresult: Success
21:52:50 T:1644 M:693075968 DEBUG: XBPyPersistentThread::GetPythonPath - using python path <C:\Documents and Settings\xarragon\Application Data\BOXEE\userdata\apps\headweb;C:\Program Files\Boxee\system\python\python24.zlib;C:\Program Files\Boxee\system\python\DLLs;C:\Program Files\Boxee\system\python\Lib;C:\Program Files\Boxee\system\python\spyce;C:\Program Files\Boxee\system\python\local;>
21:52:50 T:1644 M:693063680 DEBUG: msvcrt.dll incomplete function _fdopen(...) called
21:52:50 T:1644 M:693043200 DEBUG: C:\Documents and Settings\xarragon\Application Data\BOXEE\userdata\apps\example\MovieAction.py, line 13, __init__: Called.
21:52:50 T:1644 M:693043200 DEBUG: C:\Documents and Settings\xarragon\Application Data\BOXEE\userdata\apps\example\MovieAction.py, line 21, load: Called.
21:52:50 T:1644 M:693043200 DEBUG: C:\Documents and Settings\xarragon\Application Data\BOXEE\userdata\apps\example\MovieAction.py, line 33, onLoad: Called.
21:52:50 T:1644 M:693022720 ERROR: Scriptresult: Error
21:52:50 T:1644 M:693022720 NOTICE: Traceback (most recent call last):
21:52:50 T:1644 M:693022720 NOTICE: File "<string>", line 5, in ?
21:52:50 T:1644 M:693022720 NOTICE: File "C:\Documents and Settings\xarragon\Application Data\BOXEE\userdata\apps\example\MovieAction.py", line 35, in onLoad
21:52:50 T:1644 M:693022720 NOTICE: titleLabel = mc.GetActiveWindow().GetLabel(ID_PLAYBACK_TRAILER)
21:52:50 T:1644 M:693022720 NOTICE: File "C:\Program Files\Boxee\system\python\local\mc.py", line 2241, in GetLabel
21:52:50 T:1472 M:692998144 DEBUG: CWin32DirectSound::WaitCompletion - timeout waiting for silence
21:52:50 T:1644 M:692965376 NOTICE: return _mc.Window_GetLabel(*args)
21:52:50 T:1644 M:692965376 NOTICE: RuntimeError
21:52:50 T:1644 M:692965376 NOTICE: :
21:52:50 T:1644 M:692965376 NOTICE: _e0d99e04_p_XAPP__AppException
21:52:51 T:2312 M:692965376 DEBUG: (dbg) FreeMem 676724/1048044 Kb, FPS 60.0, CPU 2 core(s) average: 13.7% Loader Q:[0] Textures:[54 (12.73 M)] SERVER: [67.225.149.139] ver: 0.9.20.10708
21:52:51 T:2312 M:692965376 DEBUG: (dbg)

Essentially the App crashes when I call mc.GetActiveWindow().GetLabel(701), and yes, that control DOES exist in the XML file. I've gotten this error intermittently earlier, but never been able to reliably track it down. Any suggestions, or do I have to start debugging Boxee itself? Is there any sort of special considerations when using multiple windows with/or dialogs and embedded Python code that can cause race conditions etc? Is LocalConfig access thread-safe? What about long-running network reads that might return when the GUI has potentially entered another state?

Any help appreciated, best regards from
Martin Persson

xarragon
June 19th, 2010, 05:20 PM
I've reproduced the error in a minimal example App that you can try for yourself. One of my hypothesises is that the Python code attached to the onLoad event in the dialog.xml file might be executed before the entiere XML file that defines the window has been parsed and created?

Essentially the App has a main window which opens a child window/dialog via mc.ActivateWindow(). The child window then has an onLoad event that goes in and changes/updates some text, labels and textures based on information passed from the main window. In the real application this is done via the LocalConfig object since the Python version of ActivateWindow didn't seem to be able to accept parameters (which was my first preference).

The App uses the Python ActivateWindow version because it saves some states to the local config before activating the child window. I might be able to hack around that requirement and pass parameters via ActivateWindow instead, but I would still need to change the appearance of child controls in the dialog window. If Python is executed in a separate thread a hack migth be to simply delay it long enough to ensure proper window construction in the background (like in this thread (http://forums.boxee.tv/showthread.php?t=18780)).

Anyways, if you would be kind enough to test the App and see if you can recreate the error I'd be very happy. Your logfile should contain a line similar to this:
23:00:34 T:2796 M:544686080 INFO: Launching app: app://test_appexception/ (applaunch)
23:00:34 T:2796 M:544628736 INFO: updating test_appexception's information in apps.xml
23:00:35 T:1804 M:550608896 NOTICE: -->Python Interpreter Initialized<--
23:00:35 T:1804 M:550608896 INFO: XBPyPersistentThread::Process, iteration started (python)
23:00:35 T:1804 M:550608896 INFO: XBPyPersistentThread::Process, running job (python)
23:00:35 T:1804 M:550608896 INFO: XBPyPersistentThread::Process, run script, (python)
23:00:41 T:1804 M:549904384 INFO: Scriptresult: Success
23:00:41 T:1804 M:549904384 INFO: XBPyPersistentThread::Process, iteration started (python)
23:00:41 T:1804 M:549904384 INFO: XBPyPersistentThread::Process, running job (python)
23:00:41 T:1804 M:549904384 INFO: XBPyPersistentThread::Process, run script, (python)
23:00:41 T:1804 M:549842944 ERROR: Scriptresult: Error
23:00:41 T:1804 M:549842944 NOTICE: Traceback (most recent call last):
23:00:41 T:1804 M:549842944 NOTICE: File "<string>", line 4, in ?
23:00:41 T:1804 M:549842944 NOTICE: File "C:\Documents and Settings\xarragon\Application Data\BOXEE\userdata\apps\test_appexception\dialog. py", line 12, in on_load
23:00:41 T:1804 M:549842944 NOTICE: titleLabel = mc.GetActiveWindow().GetLabel(700)
23:00:41 T:1804 M:549842944 NOTICE: File "C:\Program Files\Boxee\system\python\local\mc.py", line 2272, in GetLabel
23:00:41 T:1804 M:549777408 NOTICE: return _mc.Window_GetLabel(*args)
23:00:41 T:1804 M:549777408 NOTICE: RuntimeError
23:00:41 T:1804 M:549777408 NOTICE: :
23:00:41 T:1804 M:549777408 NOTICE: _f86dc304_p_XAPP__AppException

You might need to raise your loglevel if you don't get anything in your logfile. If the script works the dialog should have the title replaced with the text string "New label text". If the script b0rks it should just read ("title"). I first discovered this error in 0.9.20, and it persists in the new release (0.9.21).
Thanks in advance!

xarragon
July 4th, 2010, 10:41 AM
I just got a reply from the Boxee support team on this issue. There seems that GetActiveWindow doesn't work on dialog windows. The recommended workaround is to refer to windows by their ID numbers instead when using dialog windows. I havn't had time to verify it yet.