1

A program containing Psychtoolbox functions crashes after running for 30 minutes when receiving trigger inputs (approx. 3 triggers per second), but runs the full 90 minutes when no trigger is connected. None of the arrays in the program appear to be larger than the allocated memory. It is unclear why the program consistently crashes after 30 minutes.

This is run on a Lenovo Thinkpad, using Psychtoolbox-3 and Matlab 2018b. We cannot decipher the source from the matlab crash report (similar crash reports have been posted, but none of the postings are applicable to our error). The Matlab support team claimed it was not a matlab error, and that the error points to something going wrong w Psychtoolbox. The entire crash report is posted below.

---EDIT-- SECTIONS OF CODE RELATED TO RECEIVING TRIGGERS note - triggers are received as a '=' press, and the buttons the subject presses during our task are received as '1' and '2's

KB_task=i(find(strcmp(j,'Keyboard'))); %selecting the keyboard named keyboard

KbQueueCreate(KB_task); %setting up queues to track keypresses
KBQueueStart(KB_task);

%check for press (we check approx. every .0167 s)
[pressed,firstpress]=KbQueueCheck(KB_task);

%saving out the time and identity of the button press
if pressed
 k=find(firstpress);
 for j=1:length(k)
  keyval(indx)=k(j);
  trtimes(indx)=firstpress(k(j));
  indx=indx+1;
  end
end 



          Assertion detected at Wed Jul 24 03:45:32 2019 -0400
--------------------------------------------------------------------------------

Configuration:
  Crash Decoding           : Disabled - No sandbox or build area path
  Crash Mode               : continue (default)
  Default Encoding         : windows-1252
  Deployed                 : false
  Graphics Driver          : Unknown hardware 
  Graphics card 1          : NVIDIA ( 0x10de ) NVIDIA Quadro P3200 Version 25.21.14.1735 (2018-12-11)
  JAWT Patch Status:       : Patch applied
  Java Version             : Java 1.8.0_152-b16 with Oracle Corporation Java HotSpot(TM) 64-Bit Server VM mixed mode
  MATLAB Architecture      : win64
  MATLAB Entitlement ID    : 2505012
  MATLAB Root              : C:\Program Files\MATLAB\R2018b
  MATLAB Version           : 9.5.0.1067069 (R2018b) Update 4
  OpenGL                   : hardware
  Operating System         : Microsoft Windows 10 Enterprise
  Process ID               : 1236
  Processor ID             : x86 Family 6 Model 158 Stepping 10, GenuineIntel
  Session Key              : 4747d68a-4186-4d29-9b23-2a26e32cae7c
  Window System            : Version 10.0 (Build 17763)

Fault Count: 1


Assertion in foundation::usm::Detail<struct foundation::usm::scope::Mvm>::find at b:\matlab\foundation\usm\management.cpp line 723

Register State (captured):
  RAX = 0000000010b6dce8  RBX = 0000000010b6dce8
  RCX = 000000024019e730  RDX = 0000000000000000
  RSP = 000000024019e6a0  RBP = 00000000117e9eb8
  RSI = 000000024019f3f8  RDI = 00000000117eafc0

   R8 = 00007ff94a96e928   R9 = 00007ff94a96e930
  R10 = 0000c4c293994e1f  R11 = 0000000010b5dcec
  R12 = 000000024019ed60  R13 = 00000000fea856e0
  R14 = 00000000117e9eb8  R15 = 0000000010b5dc18

  RIP = 000000001091292a  EFL = 00000206

   CS = 0033   FS = 0053   GS = 002b

Stack Trace (captured):
[  0] 0x000000001090b2c3                              bin\win64\libmwfl.dll+00045763 foundation::core::diag::thread_context::unspecified_bool+00000051
[  1] 0x0000000010909288                              bin\win64\libmwfl.dll+00037512 foundation::core::diag::stacktrace_base::capture+00000024
[  2] 0x000000001090e4cf                              bin\win64\libmwfl.dll+00058575 foundation::core::diag::symbols::getSymbolAddress+00012015
[  3] 0x000000001090d6d8                              bin\win64\libmwfl.dll+00055000 foundation::core::diag::symbols::getSymbolAddress+00008440
[  4] 0x000000001091220b                              bin\win64\libmwfl.dll+00074251 foundation::core::diag::terminate+00000059
[  5] 0x00000000117c35fc                  bin\win64\libmwfoundation_usm.dll+00013820 foundation::usm::getErrorHandler+00000060
[  6] 0x00000000117da74e                  bin\win64\libmwfoundation_usm.dll+00108366 foundation::usm::Detail<foundation::usm::scope::Mvm>::find+00000158
[  7] 0x00000000fb5f6607                          bin\win64\libmwbridge.dll+00026119 ioSetIoCallbacks+00007367
[  8] 0x00000000fe9dba1a                                bin\win64\libut.dll+00244250 utVprintf+00000202
[  9] 0x00000000fc611783                               bin\win64\libmex.dll+00202627 mexPrintf_800+00000035
[ 10] 0x00007ff92744ca97 C:\toolbox\Psychtoolbox\PsychBasic\MatlabWindowsFilesR2007a\PsychHID.mexw64+00051863 mexFunction+00014999
[ 11] 0x00007ff927442057 C:\toolbox\Psychtoolbox\PsychBasic\MatlabWindowsFilesR2007a\PsychHID.mexw64+00008279
[ 12] 0x00007ff927442176 C:\toolbox\Psychtoolbox\PsychBasic\MatlabWindowsFilesR2007a\PsychHID.mexw64+00008566
[ 13] 0x00007ff9511e7974                   C:\WINDOWS\System32\KERNEL32.DLL+00096628 BaseThreadInitThunk+00000020
[ 14] 0x00007ff953d0a271                      C:\WINDOWS\SYSTEM32\ntdll.dll+00434801 RtlUserThreadStart+00000033

We expect the program to run for the full 90 minutes. It can run smoothly for shorter periods of time... Thanks for your help!

sw2019
  • 11
  • 2
  • It can be a bug in the toolbox. If there is some segfault (e.g. a bad memory access), MATLAB can crash. Why 30 minutes? likely because that is when the error happens for your particular input. – Ander Biguri Jul 29 '19 at 17:05
  • This sounds like something you should contact MathWorks support about. You're (presumably) paying for their product, a critical bug preventing your use of that product should be addressed. – Wolfie Jul 30 '19 at 13:19
  • It would be useful if you posted the section of code used to receive the triggers, as well. – DMR Jul 30 '19 at 14:27
  • @Wolfie - We did contact MathWorks! Their response essentially said it wasn't their problem as they could trace it to something in Psychtoolbox – sw2019 Jul 31 '19 at 14:21
  • @DMR - Good point! We read in triggers (on our machine they are read in as "=" keypresses) using KbQueue. I've edited the question to display the code that reads in the triggers. – sw2019 Jul 31 '19 at 14:22

0 Answers0