New PTB, macOS Mojave, DrawText plugin problem?

Ok, that’s annoying. So with the error checking during Screen(‘Openwindow’) disabled - that’s what that first Screen(‘Preference’,‘ConserveVRAM’, 512); does - ‘OpenWindow’ completes without apparent malfunctions, showing the nice new welcome logo, passing all other non-OpenGL correctness and timing tests. Demos seem to run without visual artifacts or apparent trouble judging from the output? And the specific sequence of the only OpenGL commands during ‘OpenWindow’ which could in theory trigger an error do not trigger an error when executed manually from the Matlab prompt outside the context of ‘OpenWindow’.

This problem has some similarity to the one reported in:
Screen() Failure for macOS Sierra 10.12
but also possibly and some remote similarity to MAC OS PsychError_InvalidWindowRecord for Catalina although the latter one has too little information and is not quite identical.

Can you check if demos like the ones you ran here, LinesDemo, DrawSomeTextDemo, etc. do work after a restart of Matlab without using the Screen(‘Preference’,‘ConserveVRAM’, 512); ie. with regular error handling enabled? I’d assume they fail as well, because what happens inside UpdatePsychtoolbox is just opening a hidden onscreen window and drawing a little text string - this to trigger a potential update of the fontconfig database if needed.

It executes this sequence :

Assuming this all fails as well, because it is some weird interaction bug between OpenGL calls and other code that has nothing to do with OpenGL and should not cause such an error at all, it is time to get out the big guns. The following Technical note teaches you how to install and use Apples OpenGL Profiler, attach it to the running (freshly started!) Matlab process, set a breakpoint on OpenGL errors and start tracing. Then run a test sequence:

PsychDebugWindowConfiguration;
w = Screen(‘Openwindow’, 0);
sca;

The profiler should halt Matlab execution once the OpenGL error is encountered during ‘Openwindow’ and the trace should hopefully point in the general direction of where the problem happens.