Closed llewellyn-marriott closed 8 months ago
Suffering from the same issue here - here is a screenshot of such a quickjs crash:
Reproducing is easy: Just use Eclipse IDE, configure px 0.9.0 (localhost:3128) as manual proxy and try to install any more complex plugin from the marketplace -> Eclipse tries to access px.exe from multiple threads, leading to the assertion failure...
I fully agree: Thank you for all your hard work on px, it has really been very useful for everybody here at my customer behind the NTLM/Kerberos proxy...
Thank you for the report - I'll get this resolved in v0.9.1.
Fixed in v091. Thank you for making it so easy @llewellyn-marriott!
The quickjs Python library is thread-safe if Function is used. If the Context class is used directly, it can only ever be accessed by the same thread. This is true even if the accesses are not concurrent.
v0.9.1 has been released.
The quickjs Python library is thread-safe if Function is used. If the Context class is used directly, it can only ever be accessed by the same thread. This is true even if the accesses are not concurrent.
Sorry to resurrect a closed issue @genotrance, but reading this makes me wonder if the fix actually goes far enough. The quoted text seems to imply that a Context can only ever be accessed by the thread that created it, whereas the fix (as I understand it) only prevents concurrent accesses by different threads.
I have been having issues with PX crashing inconsistently, the logs wouldn't show much, until today when I noticed the following error:
Note on the version number: I did try updating to 0.9 but still had intermittent crashes, with varying errors. I just don't have any of them saved.
I had a look through the code (I am not a Python dev) and from what I can see there is no state lock used when calling quickjs, which is shared between multiple threads.
In my px.ini file I set
threads = 1
and the intermittent crashes went away.Looking at the quickjs Python package (https://pypi.org/project/quickjs/), it indicates that:
Also, thank you for all your hard work on px, it has really been very useful for me.