"Python.exe has stopped working" with keyring module in Windows Vista - python

I'm running Python 3.3.5 with Keyring 3.8 on an MS Vista SP2 machine. The issue occurs in both normal and safe mode. I've been running this same program on an XP SP3 machine without issue.
The part of the code that causes the problem is...
import keyring
keyring.set_password("Test_Service","MyUser","Password123")
Python freezes and I get this error.
Clicking "close program" restarts the python shell.
The windows event viewer has this.
Faulting application pythonw.exe, version 0.0.0.0, time stamp 0x531c3653,
faulting module ntdll.dll, version 6.0.6002.18881, time stamp 0x51da3e27,
exception code 0xc0000374, fault offset 0x000b06fc, process id 0x1104,
application start time 0x01cf7d9df6c97176.
A quick google has ntdll.dll as a windows API library.
Any ideas as to why this is happening? How to fix? Or whether there are alternate modules?
Edit: In the mean time I have ditched Keyring and decided to use a salted hash of the MachineGuid as a machine unique consistent password.

Related

What causes a "...memory could not be written error" in windows?

I'm getting an application error on Windows 10 with python in PyCharm when I run a script after the error my PyCharm terminal looks as though the script is still running but when I open task manager all my python processes are reading 0% CPU usage, the script is utilizing multiprocessing pool set to 14 processors. It will sit like this forever I am guessing and no error will print to the terminal. The script also works entirely on one dataset but throws this error on the other. Although the database is larger the table is about the same size, maybe smaller, and the number of records the script is looking for is about 1000 less than on the dataset it works on.
What does this error mean?
How do I fix it?
Is it linked to multiprocessing? Data size and memory? or something else?
Python 3.7.0, PyCharm 2021.1.1 Community Edition Build PC# 211.7142.13 Runtime Version 11.010+9-b1341.41 amd64, GDAL 3.1.4
Faulting application name: python.exe, version: 3.7.150.1013, time stamp: 0x5b331a30
Faulting module name: gdal301.dll, version: 3.1.4.0, time stamp: 0x5fdf9dd8
Exception code: 0xc0000005
Fault offset: 0x0000000000b7043b
Faulting process id: 0x8160
Faulting application start time: 0x01d8f8795e672f31
Faulting application path: C:\OSGeo4W64\apps\Python37\python.exe
Faulting module path: C:\OSGEO4~1\bin\gdal301.dll

Debugging Python segmentation fault on Mac OS Catalina

I'm developing an application with PySide2 and scikit-learn. The application works properly if I use a single thread, but if I move the sckikit-learn calculations to a worker QThread (to keep the UI responsive during the processing) I get random segmentation faults on Mac OS Catalina. The same program seems to work fine on Windows (on Mac I get a segmentation fault every other time I run the program; I ran the program at least twenty times on Windows and it never crashed). I was trying to follow the suggestions in this answer, but I can't have either gdb nor lldb to work properly on Catalina.
This is what I get with lldb:
% lldb python
(lldb) target create "python"
Current executable set to 'python' (x86_64).
(lldb) run test.py
error: process exited with status -1 (attach failed (Not allowed to attach to process. Look in the console messages (Console.app), near the debugserver entries when the attached failed. The subsystem that denied the attach permission will likely have logged an informative message about why it was denied.))
I then tried to install gdb with MacPorts, then I followed the instructions from the GDB Wiki to allow gdb to debug another process, however gdb either hangs after the run command or gives me an Unknown signal error while running a simple script (just print a string):
% ggdb python
GNU gdb (GDB) 9.2
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-apple-darwin19.5.0".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from python...
(No debugging symbols found in python)
(gdb) run test.py
Starting program: /usr/bin/python test.py
[New Thread 0x2603 of process 92261]
[New Thread 0x1803 of process 92261]
During startup program terminated with signal ?, Unknown signal.
Is there a way to debug Python segmentation faults on Catalina?
SIP (System Integrity Protection) on macOS prohibits the debugger from attaching to system applications, including the shipping version of Python. That's what you are seeing.
You either need to turn off SIP or build your own version of the Python. OTOH, debugging your problem in Python will be a lot easier if you are debugging a -O0 built Python, so figuring out how to build it yourself (it's actually not that hard to do) its likely to be worthwhile in the long term.

Python has stopped working

I'm running a Python script on my windows 10 machine. The script reads compressed data files, stored as .tar.gz, processes it, and then reads the next one. In this manner it processes thousands of files.
I run the scipt in a windows10 powershell, and -seemingly randomly- I often get the following error:
Some times this happens after a day, sometimes already after a few minutes.
I select 'Close program' and the script is terminated. Looking into Windows event viewer, I can see the following entry:
Faulting application name: python.exe, version: 3.6.2150.1013, time
stamp: 0x59c1326e Faulting module name: multiarray.cp36-win_amd64.pyd,
version: 0.0.0.0, time stamp: 0x59c3eeda Exception code: 0xc0000005
Any ideas on how to avoid this error message?
0xc0000005 means 'memory access violation' error.
The related info seems to indicate this happens when python is processing arrays.
You can try to trouble shoot by adding logs so you can identify the issue.
The problem may be solved by changing related code.
If you are able to replicate the issue consistently and the python code seems correct - it may be a rare case of a bug in python.

Loading NCBITaxa crashes

I've been using the ete2 module on very powerful servers for some time.
Everything was fine until it started going very slowly (one get_taxid_translator() function per minute), now I cannot even get past ncbi = NCBITaxa() assignment.
I have uninstalled and reinstalled anaconda2, tried updating to ete3, everything works fine on our 'development servers' but still cannot get past the ncbi = NCBITaxa() line in any piece of software on our normal servers. Even the following script fails to finish
#!/usr/bin/env python
from ete3 import NCBITaxa
ncbi = NCBITaxa()
print "Finished"
Has this happened to anyone else? Do I need to downgrade any dependencies? Could it be a permissions issue?
When I run the basic script ctrl+c nor ctrl+z will escape the script and I have to use kill -9 <job-id> to kill the script. If I wait too long the process enters an uninterruptible sleep.
Thank you in advance,
Alexis.
Python 2.7.12 :: Anaconda custom (64-bit)
gcc (GCC) 5.4.0

wx.App (wxPython) crash when calling

Recently I installed wxPython to do some works under Windows. Most of the time I work in Linux so I have a little experience here.
with python.exe interpreter, I just do 2 line of codeimport wxtmp=wx.App(False)
Then the interpreter crashed with Windows error reporting.
I tried both python 2.7.1 and 2.6.6 with wxPython 2.8.11, all come from their main website, still no luck.
Is there something I must do after install Python in Windows ? I can see that python install just fine and can do some basic job, wxPython library can be load, but can't call wx.App
If you are running that in IDLE, then that is your problem. IDLE and wx don't get along very well because you basically end up with two mainloops fighting each other. Try putting it in a file and then run the file from the command line:
c:\python27\python.exe myPyFile.py
That should work just fine. Otherwise, download the correct wxPython for your Python and OS (32/64 bit), uninstall the current one and install the new one. I've been using wxPython on Windows XP, Vista and 7 with no problems like this.
In case like me somebody will stumble into this question like I did. Recently installed wxpython on two machines, windows 7 and XP. Testing the sample code in simple.py (provided with the wxpython docs-demos installer), running from a python console, I had the following problem on both machines: First import ok, but when I did a reload of the module, python crash.
I added this line in the end of the simple.py file: del app
and that fixed the problem on windows 7 and tomorrow I try it on the XP machine.
Same solution fitted for the XP machine. So, reloading an un-edited module with a reference to a wx.App with a closed gui seem not to be feasable. Killing the reference with a del statement was enough to solve the problem.
I searched for a while and found that this is the problem with wxPython and Python >2.5. Tried many fix with manyfest file but no luck, so I think switch to PyQt is the only solution now.

Categories