Hi all,
I've run into a segmentation violation problem while making textures
under OSX using Screen('MakeTexture'...). This happens when I try to
make textures from image arrays - some images work, others don't. Two
examples are attached: 'goat.jpg' always works, 'oval.jpg' virtually
always produces a segmentation violation and sometimes crashes Matlab
entirely. An example script illustrating the problem follows below, as
does the error message that Matlab outputs when things go wrong.
I would be very grateful for any hints!
Best regards,
Johannes
Here is the script that illustrates the problem. Run it from the same
folder as the two images attached to this message.
% ***************************************************************
clear all;
AssertOpenGL;
screens=Screen('Screens');
screenNumber=max(screens);
frameRate=Screen('FrameRate',screenNumber);
if(frameRate==0)
frameRate=60;
end
% Making the goat texture - this works
try
goat = imread('goat.jpg');
goattex = Screen('MakeTexture', screenNumber, goat);
disp('The goat texture worked.');
catch
error('The goat texture didn''t work.');
end
% Making the oval texture - this often fails
try
oval = imread('oval.jpg');
ovaltex = Screen('MakeTexture', screenNumber, oval);
disp('The oval texture worked.');
catch
error('The oval texture didn''t work.');
end
% ***************************************************************
Here is Matlab's error message:
------------------------------------------------------------------------
Segmentation violation detected at Mon Nov 15 14:41:09 2004
------------------------------------------------------------------------
Configuration:
MATLAB Version: 6.5.0.185000 (R13)
Operating System: Darwin 7.4.0 Darwin Kernel Version 7.4.0: Wed May
12 16:58:24 PDT 2004; root:xnu/xnu-517.7.7.obj~7/RELEASE_PPC Power
Macintosh
Window System: The XFree86 Project, Inc (40300000), display :0.0
Current Visual: 0x22 (class 4, depth 24)
Virtual Machine: Java 1.3.1 with "Apple Computer, Inc." Java
HotSpot(TM) Client VM
(mixed mode)
Segmentation violation occurred within signal handler.
Unable to complete stack trace (stack was probably corrupted)
This error was detected while a MEX-file was running. If the MEX-file
is not an official MathWorks function, please examine its source code
for errors. Please consult the External Interfaces Guide for
information
on debugging MEX-files.
If it is an official MathWorks function, please
follow these steps in reporting this problem to The MathWorks so
that we have the best chance of correcting it:
1. Send this crash report to segv@... for automated
analysis.
For your convenience, this information has been recorded in:
/Users/johannes/matlab_crash_dump.2278
2. Also, if the problem is reproducible, send the crash report to
support@... along with:
- A specific list of steps that will reproduce the problem
- Any M, MEX, MDL or other files required to reproduce the
problem
- Any error messages displayed prior to this crash report
A technical support engineer will contact you with further
information.
Thank you for your assistance. Please save your workspace and restart
MATLAB before continuing your work.
I've run into a segmentation violation problem while making textures
under OSX using Screen('MakeTexture'...). This happens when I try to
make textures from image arrays - some images work, others don't. Two
examples are attached: 'goat.jpg' always works, 'oval.jpg' virtually
always produces a segmentation violation and sometimes crashes Matlab
entirely. An example script illustrating the problem follows below, as
does the error message that Matlab outputs when things go wrong.
I would be very grateful for any hints!
Best regards,
Johannes
Here is the script that illustrates the problem. Run it from the same
folder as the two images attached to this message.
% ***************************************************************
clear all;
AssertOpenGL;
screens=Screen('Screens');
screenNumber=max(screens);
frameRate=Screen('FrameRate',screenNumber);
if(frameRate==0)
frameRate=60;
end
% Making the goat texture - this works
try
goat = imread('goat.jpg');
goattex = Screen('MakeTexture', screenNumber, goat);
disp('The goat texture worked.');
catch
error('The goat texture didn''t work.');
end
% Making the oval texture - this often fails
try
oval = imread('oval.jpg');
ovaltex = Screen('MakeTexture', screenNumber, oval);
disp('The oval texture worked.');
catch
error('The oval texture didn''t work.');
end
% ***************************************************************
Here is Matlab's error message:
------------------------------------------------------------------------
Segmentation violation detected at Mon Nov 15 14:41:09 2004
------------------------------------------------------------------------
Configuration:
MATLAB Version: 6.5.0.185000 (R13)
Operating System: Darwin 7.4.0 Darwin Kernel Version 7.4.0: Wed May
12 16:58:24 PDT 2004; root:xnu/xnu-517.7.7.obj~7/RELEASE_PPC Power
Macintosh
Window System: The XFree86 Project, Inc (40300000), display :0.0
Current Visual: 0x22 (class 4, depth 24)
Virtual Machine: Java 1.3.1 with "Apple Computer, Inc." Java
HotSpot(TM) Client VM
(mixed mode)
Segmentation violation occurred within signal handler.
Unable to complete stack trace (stack was probably corrupted)
This error was detected while a MEX-file was running. If the MEX-file
is not an official MathWorks function, please examine its source code
for errors. Please consult the External Interfaces Guide for
information
on debugging MEX-files.
If it is an official MathWorks function, please
follow these steps in reporting this problem to The MathWorks so
that we have the best chance of correcting it:
1. Send this crash report to segv@... for automated
analysis.
For your convenience, this information has been recorded in:
/Users/johannes/matlab_crash_dump.2278
2. Also, if the problem is reproducible, send the crash report to
support@... along with:
- A specific list of steps that will reproduce the problem
- Any M, MEX, MDL or other files required to reproduce the
problem
- Any error messages displayed prior to this crash report
A technical support engineer will contact you with further
information.
Thank you for your assistance. Please save your workspace and restart
MATLAB before continuing your work.