PLEASE HELP - Access violation ERROR
#1
Sad 
Hi,

I am currently writing my new ResumeX script.
This script need to run another script (the engine) and be able to turn it off.
I have tried a few different ways but everyone causes XBMC to freeze and give this error:

CThread:ConfusedtaticThread : Access violation at 0x0385a212: Writing location 0x00000000

My first way was to have the engine create a file. it keeps looping while this file exists. Then when the other script is run, it deletes this file and the engine script stops. I GET THE ERROR.

I also tried FILELOCK which keeps track of files you have locked/unlocked. This gives same error.

I also tried doing this in a DB using SQLITE and this again fails.

Any ideas?

The main reason I don't import the engine is so the user can click the script again and choose to stop it/change settings (if imported, xbmc would try to close the running script)

Any ideasHuh??
Reply
#2
BUMP!
I have people after this ResumeX script and really need to see a way around this issue Sad
Reply
#3
Hi stanley87,

Just seen this post thanks to your post in HERE

I just have few ideas for problem but since I didn't try it, I cannot not be sure it would work, but perhaps it worth to give it a try?

With the file issue, how to you check the file is here? You try to read it or you check the file exists (i.e os.path.exists())?

I noticed a way in XBMC to stop a script running in background was to relaunch it. Perhaps if you do it via the script who launch it it would stop it?

Sorry for not having better proposal, but at least it is something :o
Image
_____________________________

Repositories Installer: select and install unofficial repositories / TAC.TV: watch videos on TAC.TV
Installer Passion-XBMC: Download and Install Add-ons (pre-Dharma only)

Image
Reply
#4
how exactly are you trying to do this?

this works (tested on windows xp, r17621)
i put both files in the same folder in xbmc/scripts/

Code:
#default.py
import os, time, xbmc

tmp = open('special://masterprofile/temp.file', 'w')
tmp.close()
print 'os.getcwd()',os.getcwd()
xbmc.executescript(os.path.join(os.getcwd(),'launchme.py'))
time.sleep(2)
os.remove(xbmc.translatePath('special://masterprofile/temp.file'))

Code:
#launchme.py
import os, xbmcgui, xbmc

i=0
while os.path.isfile(xbmc.translatePath('special://masterprofile/temp.file')):
    print i
    i+=1

xbmcgui.Dialog().ok('Time To Exit!','temp.file not found','launchme.py went through %s iterations in 2 seconds' % i)
Always read the XBMC online-manual, FAQ and search and search the forum before posting.
For troubleshooting and bug reporting please read how to submit a proper bug report.

If you're interested in writing addons for xbmc, read docs and how-to for plugins and scripts ||| http://code.google.com/p/xbmc-addons/
Reply
#5
Hey!
I will try tonight! Thanks!
Reply
#6
stanley87 Wrote:Hey!
I will try tonight! Thanks!

any new information? mega eager here Big Grin and even if it doesnt work...thanks for trying, this is a mega kewl script
Reply
#7
Sad 
Code:
#default.py
import os, time, xbmc
from os.path import isfile

tmp = open('special://masterprofile/temp.file', 'w')
tmp.close()
print 'os.getcwd()',os.getcwd()
if isfile('special://masterprofile/temp.file'):
       os.remove(xbmc.translatePath('special://masterprofile/temp.file'))
else:
       xbmc.executescript(os.path.join(os.getcwd(),'launchme.py'))


Code:
launchme.py
import os, xbmcgui, xbmc

i=0
while os.path.isfile(xbmc.translatePath('special://masterprofile/temp.file')):
    print i
    i+=1

xbmcgui.Dialog().ok('Time To Exit!','temp.file not found','launchme.py went through %s iterations in 2 seconds' % i)

Problem is using the same script that ran the script, to delete the file. If i manually remove the file, the other script will stop.
rwparris2 - could you please help me find a solution :-D
Reply
#8
Anyone have thoughts on this?
My code above simulates the fault.

You run default.py and it will run lanuchme.
i want it when run again to stop the second script.
Reply
#9
use a skin bool setting or a window.property().

to set it
xbmc.executebuiltin("Skin.SetBool(myscriptisrunning)")

to check it:
xbmc.getCondVisibilty("Skin.HasSetting(myscriptisrunning)")

to clear it:
xbmc.executebuiltin("Skin.Reset(myscriptisrunning)")
For python coding questions first see http://mirrors.xbmc.org/docs/python-docs/
Reply
#10
Hi,
Thats the way I used 2 do it :-D
Will give it ago then i guess.!
Thanks
Reply
#11
I tried that and...
still does the same thing.
the program freezes when the "engine" script stops itself...
grrrrrrrrr

LOG:

20:02:15 T:3348 M:1070247936 INFO: Scriptresult: Succes
20:02:15 T:3348 M:1070338048 ERROR: CThread:ConfusedtaticThread : Access violation at 0x1e0ac802: Writing location 0x00000000
20:02:15 T:3348 M:1070338048 INFO: Python script stopped
20:02:15 T:3348 M:1070338048 DEBUG: CThread:ConfusedtaticThread, deleting thread graphic context
20:02:15 T:3348 M:1070338048 DEBUG: Thread 3348 terminating
20:02:15 T:3784 M:1070383104 DEBUG: python thread 5 destructed
20:02:15 T:3784 M:1070383104 INFO: Python, unloading python24.dll because no scripts are running anymore
Reply

Logout Mark Read Team Forum Stats Members Help
PLEASE HELP - Access violation ERROR0