OK a code example indeed makes things more clear: It seems now that the crash is connected to using PsychImaging (rather than Screen), combined with setting a BlendFunction, combined with Screen('CloseAll') and 'clear all'. The code below reliably causes matlab to crash for me (although without the effect on Java that I described above).
If I open the window with Screen('OpenWindow') and remove all the PsychImaging calls, there is no crash.
If I remove the BlendFunction call, there is no crash.
If I remove the clear all at the end, there is also no crash (this is different from my real code where I first got that crash, because my real code does not contain a clear all).
So this doesn't seem to have anything todo with the try/catch.
There is no useful error output from matlab. It crashes hard and then does not show any report at the start of the next session.
What system specs do you need?
- ThinkPad X200 tablet
- Intel Core 2 Duo
- 8 GB RAM
- 64-bit Windows 7
- Dual monitor setup (internal + external).
PTB-INFO: OpenGL-Renderer is Intel :: Mobile Intel(R) 4 Series Express Chipset Family :: 2.1.0 - Build 8.15.10.2302
OpenGL-Vendor / renderer / version are: Intel - Mobile Intel(R) 4 Series Express Chipset Family - 2.1.0 - Build 8.15.10.2302
OpenGL-Extensions are: GL_EXT_blend_minmax GL_EXT_blend_subtract GL_EXT_blend_color GL_EXT_abgr GL_EXT_texture3D GL_EXT_clip_volume_hint GL_EXT_compiled_vertex_array GL_SGIS_texture_edge_clamp GL_SGIS_generate_mipmap GL_EXT_draw_range_elements GL_SGIS_texture_lod GL_EXT_rescale_normal GL_EXT_packed_pixels GL_EXT_texture_edge_clamp GL_EXT_separate_specular_color GL_ARB_multitexture GL_EXT_texture_env_combine GL_EXT_bgra GL_EXT_blend_func_separate GL_EXT_secondary_color GL_EXT_fog_coord GL_EXT_texture_env_add GL_ARB_texture_cube_map GL_ARB_transpose_matrix GL_ARB_texture_env_add GL_IBM_texture_mirrored_repeat GL_EXT_multi_draw_arrays GL_NV_blend_square GL_ARB_texture_compression GL_3DFX_texture_compression_FXT1 GL_EXT_texture_filter_anisotropic GL_ARB_texture_border_clamp GL_ARB_point_parameters GL_ARB_texture_env_combine GL_ARB_texture_env_dot3 GL_ARB_texture_env_crossbar GL_EXT_texture_compression_s3tc GL_ARB_shadow GL_ARB_window_pos GL_EXT_shadow_funcs GL_EXT_stencil_wrap GL_ARB_vertex_program GL_EXT_texture_rectangle GL_ARB_fragment_program GL_EXT_stencil_two_side GL_ATI_separate_stencil GL_ARB_vertex_buffer_object GL_EXT_texture_lod_bias GL_ARB_occlusion_query GL_ARB_fragment_shader GL_ARB_shader_objects GL_ARB_shading_language_100 GL_ARB_texture_non_power_of_two GL_ARB_vertex_shader GL_NV_texgen_reflection GL_ARB_point_sprite GL_EXT_blend_equation_separate GL_ARB_depth_texture GL_ARB_texture_rectangle GL_ARB_draw_buffers GL_ARB_color_buffer_float GL_ARB_half_float_pixel GL_ARB_texture_float GL_ARB_pixel_buffer_object GL_EXT_framebuffer_object GL_ARB_draw_instanced GL_ARB_half_float_vertex GL_EXT_draw_buffers2 GL_WIN_swap_hint GL_EXT_texture_sRGB GL_EXT_packed_float GL_EXT_texture_shared_exponent GL_ARB_texture_rg GL_ARB_texture_compression_rgtc GL_NV_conditional_render GL_EXT_texture_swizzle GL_ARB_framebuffer_sRGB GL_EXT_packed_depth_stencil GL_ARB_depth_buffer_float GL_EXT_transform_feedback GL_EXT_framebuffer_blit GL_ARB_vertex_array_object
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% My code example:
Screen('Preference', 'SkipSyncTests', 1);
% win = Screen('OpenWindow', 1, 255/2);
PsychImaging('PrepareConfiguration');
PsychImaging('AddTask', 'AllViews', 'GeometryCorrection', 'D:\SkyDrive\Documents\MATLAB\lab\angleTask\undistortionConfigTest.mat');
win = PsychImaging('OpenWindow', 1, 255/2);
Screen('BlendFunction', win, GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
for i = 1:(2*60)
Screen('Flip', win);
end
Screen('CloseAll')
clear all
% Code example end
--- In psychtoolbox@yahoogroups.com, "Mario" <mario.kleiner@...> wrote:
>
>
>
> --- In psychtoolbox@yahoogroups.com, "qiagenmidikit" <qiagenmidikit@> wrote:
> >
> > Hi,
> >
> > I'm experiencing a weird crash when calling Screen('CloseAll') on Windows 7 64bit Matalb R2013a. The crash freezes Matlab and apparently also crashes Java, because Matlab won't start after such a crash until I reboot, unless I execute java.exe from my Start Menu.
> >
> > This happens in the following scenario:
> >
> > I use PTB to display some stimulus, including a geometric correction for cylindrical projection as described in DisplayUndistortionHalfCylinder.
> >
> > In my Matlab code, I wrap everything, starting from where the PTB window is opened, in a try...catch statement. To make debugging easier, the catch statement calls Screen('CloseAll') to close the screen before rethrowing the error.
> >
> > It seems that this Screen('CloseAll') in the catch statement causes the crash described above. If I remove it, there's no crash. When I call Screen('CloseAll') after exiting debug mode, there's also no crash.
> >
>
> That's indeed weird. Our demos call Screen('CloseAll') all the time from the catch branch of try-catch and this doesn't cause crashes. We usually call sca; which does other cleanup work besides Screen('CloseAll').
>
> > In all cases, the error causing the try...catch to trigger is something trivial in an unrelated part of code.
> >
> > I'm doing all this on my four year old laptop, which I use for development. Could it be that the crash is due to my old graphics hardware not being able to deal with the geometric undistortion or so?
> >
>
> No. Of course one can not exclude the probability of odd graphics driver bugs, but in general pretty much any graphics card since around 2006/2007 should be able to do this without trouble.
>
> > If you have an idea what the problem might be, that would be great. I could try to write a minimal code example but it would be quite some work, so I'll try without first.
> >
>
> Example code that reproduces it is a good idea. Also the full system specs. Does the crash produce any useable output, e.g., crash messages with stack traces etc.?
>
> -mario
>