psychopy.org | Reference | Downloads | Github

Suddenly, my experiments went on strike (the ntdll blues)


#1

OS (e.g. Win10): Win7/Win10
PsychoPy version (e.g. 1.84.x): 1.84.2

I use PsychoPy for all of my experimental needs, and until this month I was perfectly happy with that. However, suddenly and simultaneously, all of my PsychoPy experiments have started (sporadically) crashing. The experiments do disparate things (some involve movie files, some involve sound files; all involve keyboard responses), and are housed on disparate computers (one a very old Win7 computer with poor memory that hasn’t been updated since last summer, one a very new Win10 computer with excellent memory that is constantly up to date). Despite those differences, the sequence of events that leads up to the crash is roughly the same:

  1. I input participant information and start the experiment.
  2. The experiment starts up fine.
  3. Within a couple of minutes, after the participant gives a keyboard response to advance to the next Routine, the experiment hangs, and a message pops up saying that python.exe has crashed. No error messages are generated in PsychoPy; Windows points the finger at ntdll.dll, in a message that looks something like this:

Faulting application name: python.exe, version: 0.0.0.0, time stamp: 0x56634a05
Faulting module name: ntdll.dll, version: 6.1.7601.23572, time stamp: 0x57fd02d3
Exception code: 0xc0000005
Fault offset: 0x0002e43e
Faulting process id: 0x1244
Faulting application start time: 0x01d298105bf977a9
Faulting application path: C:\Program Files (x86)\PsychoPy2\python.exe
Faulting module path: C:\Windows\SysWOW64\ntdll.dll

ntdll.dll is always the problem across computers. The experiments don’t always crash; one experiment has crashed only once (out of the 5 or so times I’ve run it) but a different version of the same experiment where the only difference is in the stimuli crashes almost all of the time. When they do, though, they are relatively consistent on where they crash within the experiment; for example, in the fourth Routine that displays instructions for one experiment, or during the first or second video stimulus for a different experiment. However, it’s nothing about the individual instruction Routine or any individual video; the program still crashes after deleting all of the instruction Routines (just sometime during the trials), and the order of presentation in the other experiment is random (so it’s not the case that any one video sinks it). If the experiment doesn’t crash within the first couple of minutes, it always completes and saves the data without any issue.

I’m at wit’s end, to be honest. I’ve uninstalled and reinstalled PsychoPy plenty of times, restarted the computers in between crashes, gone through and basically eliminated each Routine one by one, and nothing seems to help. Furthermore, this is new and without any obvious cause. The best example is for the video experiment, where I just finished collecting data in a very similar experiment in the middle of February; I never saw similar errors for the previous one, and the only difference between the two experiments is in a handful of the stimuli (which were encoded identically). PsychoPy was already at 1.84.2 at that point. The experiment that crashes the most was working without issues in December, and neither the OS nor PsychoPy were changed between then and when I started trying to run it again last week.

Oddly, I’ve never had a similar experience on my (Win10) laptop, although the only time I run experiments on my laptop is when I’m programming or when the experiment has crashed on the experimental computers, so that might just be a sample size issue.

Any thoughts? I’m happy to try anything.


#2

Update: downgrading to 1.84.1 did not solve the issue. Upgrading to 1.85.0 produced an error (which I’ve given below) that seems to be unrelated to the ntdll problems. And unplugging one of the computers from the Internet and restarting it also did not help (one of my advisors thought it might be a network issue).

Here’s the error I got in 1.85.0:

Running: C:\Users\linguser\Desktop\Sepulchre\Sepulchre Training 2016-12-04_lastrun.py
pyo version 0.8.0 (uses single precision)
Traceback (most recent call last):
File “C:\Users\linguser\Desktop\Sepulchre\Sepulchre Training 2016-12-04_lastrun.py”, line 139, in
sound_1 = sound.Sound(‘A’, secs=-1)
File “C:\Program Files (x86)\PsychoPy2\lib\site-packages\psychopy\sound\backend_pyo.py”, line 276, in init
init(rate=sampleRate)
File “C:\Program Files (x86)\PsychoPy2\lib\site-packages\psychopy\sound\backend_pyo.py”, line 125, in init
audioDriver, outputID = _bestDriver(devNames, devIDs)
File “C:\Program Files (x86)\PsychoPy2\lib\site-packages\psychopy\sound\backend_pyo.py”, line 28, in _bestDriver
osEncoding = sys.getfilesystemencoding()
NameError: global name ‘sys’ is not defined


#3

Sorry to triple post, but I found a temporary (if unsatisfactory) solution: downgrading to 1.83.4. I apparently didn’t downgrade back far enough. I’ve only checked this on one computer, but will confirm on others soon enough. However, the upgrade to 1.84.2 coincides within a day of the first appearance of error messages on one of the computers. I’m not entirely comfortable with laying the blame solely on the version change—I don’t think I installed a 1.84 version on one of the other computers anytime recently, for example—but it does seem to be one of the biggest causes. This problem is not just affecting me, though; it’s affecting other users of PsychoPy using the same computers. So I’m not sure that it’s anything in our individual experiments per se that is causing the problem.

Besides ntdll, after poring over the error logs on the computer, I noticed another error that has been occurring that looks like this:

Faulting application name: python.exe, version: 0.0.0.0, time stamp: 0x56634a05
Faulting module name: umath.pyd, version: 0.0.0.0, time stamp: 0x572b9e76
Exception code: 0xc0000005
Fault offset: 0x0000ad30
Faulting process id: 0xda4
Faulting application start time: 0x01d29445be79af83
Faulting application path: C:\Program Files (x86)\PsychoPy2\python.exe
Faulting module path: C:\Program Files (x86)\PsychoPy2\lib\site-packages\numpy\core\umath.pyd

A different error comes up at the end of many successful experimental runs that looks like this:

Faulting application name: python.exe, version: 0.0.0.0, time stamp: 0x56634a05
Faulting module name: portmidi.dll, version: 0.0.0.0, time stamp: 0x00000000
Exception code: 0xc0000005
Fault offset: 0x00002627
Faulting process id: 0xd48
Faulting application start time: 0x01d2942beeb2f390
Faulting application path: C:\Program Files (x86)\PsychoPy2\python.exe
Faulting module path: C:\Program Files (x86)\PsychoPy2\lib\site-packages\portmidi.dll
Report Id: 4fd18ac5-0021-11e7-97f7-bc305bc66846

Hopefully this can be fixed in future patches? I’m very excited about the online experiment capabilities of 1.85; I’d love to update eventually.


#4

I’m afraid I’ve never seen this error and cant reproduce it on my own Win7 installation. I’m guessing this is a change in one of the dependencies rather than PsychoPy itself but while I can’t reproduce the problem myself I’m unable to debug where it comes from.
The fact that it fails differently loading a range of different libraries is very suspicious and I wonder if it’s something special about the system setups or permissions, but I really don’t know.


#5

Hi Jon - sorry for the delay. I have some more error messages, in case they’re helpful. After the downgrade to 1.83.4, all of my experiments that don’t involve Movie stims are working fine, but all of my experiments with Movie stims are still breaking after a couple of videos are played. In 1.83.4, I get this error (with the movie file breaking never being consistent):

Traceback (most recent call last):
File “…lastrun.py”, line 732, in
depth=-3.0,
File “C:\Program Files (x86)\PsychoPy2\lib\site-packages\psychopy-1.83.04-py2.7.egg\psychopy\visual\movie3.py”, line 121, in init
self.loadMovie(self.filename)
File “C:\Program Files (x86)\PsychoPy2\lib\site-packages\psychopy-1.83.04-py2.7.egg\psychopy\visual\movie3.py”, line 168, in loadMovie
self._audioStream = sound.Sound(self._mov.audio.to_soundarray(),
File “”, line 2, in to_soundarray
File “C:\Program Files (x86)\PsychoPy2\lib\site-packages\moviepy-0.2.2.11-py2.7.egg\moviepy\decorators.py”, line 54, in requires_duration
return f(clip, *a, **k)
File “C:\Program Files (x86)\PsychoPy2\lib\site-packages\moviepy-0.2.2.11-py2.7.egg\moviepy\audio\AudioClip.py”, line 114, in to_soundarray
chunksize=buffersize))
File “C:\Program Files (x86)\PsychoPy2\lib\site-packages\numpy\core\shape_base.py”, line 230, in vstack
return _nx.concatenate([atleast_2d(_m) for _m in tup], 0)
File “C:\Program Files (x86)\PsychoPy2\lib\site-packages\moviepy-0.2.2.11-py2.7.egg\moviepy\audio\AudioClip.py”, line 81, in generator
buffersize=chunksize)
File “”, line 2, in to_soundarray
File “C:\Program Files (x86)\PsychoPy2\lib\site-packages\moviepy-0.2.2.11-py2.7.egg\moviepy\decorators.py”, line 54, in requires_duration
return f(clip, *a, **k)
File “C:\Program Files (x86)\PsychoPy2\lib\site-packages\moviepy-0.2.2.11-py2.7.egg\moviepy\audio\AudioClip.py”, line 127, in to_soundarray
snd_array = self.get_frame(tt)
File “”, line 2, in get_frame
File “C:\Program Files (x86)\PsychoPy2\lib\site-packages\moviepy-0.2.2.11-py2.7.egg\moviepy\decorators.py”, line 89, in wrapper
return f(*new_a, **new_kw)
File “C:\Program Files (x86)\PsychoPy2\lib\site-packages\moviepy-0.2.2.11-py2.7.egg\moviepy\Clip.py”, line 95, in get_frame
return self.make_frame(t)
File “C:\Program Files (x86)\PsychoPy2\lib\site-packages\moviepy-0.2.2.11-py2.7.egg\moviepy\audio\io\AudioFileClip.py”, line 71, in
self.make_frame = lambda t: reader.get_frame(t)
File “C:\Program Files (x86)\PsychoPy2\lib\site-packages\moviepy-0.2.2.11-py2.7.egg\moviepy\audio\io\readers.py”, line 196, in get_frame
"but len(buffer)=%d\n"%(len(self.buffer))+ str(error))
IOError: Error in file Stimuli/Videos/fe141_200.mov, At time t=11.34-12.47 seconds, indices wanted: 100000-149999, but len(buffer)=110980
index 110980 is out of bounds for axis 0 with size 110980
Exception TypeError: “‘NoneType’ object is not callable” in <bound method Server.del of <pyolib.server.Server object at 0x04F1F330>> ignored
AsioDrv::: CAsioDrv()…
AsioDrv::: InitWdmDrv()…

Oddly, this error now pops up for my final dissertation experiment, which was working fine through mid-February.

I think as a next step I can check to see how broadly distributed these problems are on campus. Although the computers I have access to are pretty heterogeneous, I could get more data on whether they’re afflicting others, too, so that it’s some sort of strange campus-wide thing.


#6

Okay, I think I may have found a solution. Upgrading to 1.85.01 seems to have resolved the “sys” issue, while this fix to moviepy seems to make the videos play fine (and without freezing). So, I think the issue is resolved, although we’ll see if anything else crops up!