# Screen(&#39;Gamma?&#39;) causes seg fault

**URL:** <https://psychtoolbox.discourse.group/t/screen-39-gamma-39-causes-seg-fault/744>\
**Category:** Uncategorized\
**Created:** [August 8, 2004, 4:07am UTC](https://psychtoolbox.discourse.group/t/screen-39-gamma-39-causes-seg-fault/744 "2004-08-08T04:07:54Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Allen\_Ingling](https://avatars.discourse-cdn.com/v4/letter/a/a183cd/32.png) [@Allen\_Ingling](https://psychtoolbox.discourse.group/u/Allen_Ingling)\
**Post date:** [August 8, 2004, 4:07am UTC](https://psychtoolbox.discourse.group/t/screen-39-gamma-39-causes-seg-fault/744/1 "2004-08-08T04:07:54Z")

</div>

Did anybody get the function Screen('Gamma?') to work in  
Windows? On my test machines it invariably causes a  
segmentation fault (see screen dump below). ScreenTest and  
most demos run successfully.  
  
System 1: Pentium 4 2.8 GHz running Windows XP sp1,  
DirectX9.2b. ATI Rage128 PRO (AGP4X). MATLAB R13 and R14  
with/without -nojvm. Psychtoolbox 2.5.4.  
  
System 2: Pentium 4 2.5 GHz running Windows XP sp1,  
DirectX9.2b, Dell Intel 82845G (on-board). MATLAB R13 and  
Psychtoolbox 2.5.4.  
  
Thanks for your help,  
  
Vincent  
  
  
--- from System 1 running R14  
  
Warning: Function call SCREEN invokes inexact match  
V:\projects\vspc\PsychToolbox\_2.54\PsychBasic\Screen.dll.  
  

> \> In ltScreenInitialize at 31

 In vs at 73  
You are using a Multiscan 500PS  
The refresh rate is 60 Hz  
The resolution is 1280x1024 pixels.  
Latest calibration was done on 14-May-2001 02:42:31  
A loadable gamma table is detected!  
  
------------------------------------------------------------------------  
 Segmentation violation detected at Sat Aug 07  
20:43:53 2004  
------------------------------------------------------------------------  
  
Configuration:  
 MATLAB Version: 7.0.0.19920 (R14)  
 Operating System: Microsoft Windows XP  
 Window System: Version 5.1 (Build 2600: Service Pack  
1)  
 Processor ID: x86 Family 15 Model 2 Stepping 5,  
GenuineIntel  
 Virtual Machine: Java is not enabled  
 Default Charset: ibm-5348\_P100-1997  
  
Register State:  
 EAX = 8b008a00 EBX = 00000000  
 ECX = 00cdc124 EDX = 7ffe0304  
 ESI = 8b008a00 EDI = 00cdc140  
 EBP = 00cdc138 ESP = 00cdc134  
 EIP = 78791d67 FLG = 00010286  
  
Stack Trace:  
 [0] libmx.dll:\_mxGetN(0x8b008a00, 0x00cdc6a4, 0x00cdc5b4,  
0) + 7 bytes  
 [1] Screen.dll:0x04569993(0x99009800, 0x9b009a00,  
0x9d009c00, 0x9f009e00)  
 [2] 0x97009600  
  
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@...](mailto:segv@...) for  
automated analysis.  
 For your convenience, this information has been  
recorded in:  
 C:\DOCUME~1\Vincent\LOCALS~1\Temp\matlab\_crash\_dump.212  
  
 2. Also, if the problem is reproducible, send the crash  
report to  
[support@...](mailto: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 to the command window  
 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.  
  
Error in ==\> ltLoadCalibration at 48  
[oldGammaTable,dacSize]=SCREEN(screen.windowPtr,'Gamma',round(newGamInv),8);  
  
Error in ==\> vs at 74  
ltLoadCalibration(myscreen,3);  
  
  
--  
Vincent Bonin - [vincent@...](mailto:vincent@...)  
Smith-Kettlewell Eye Research  
2318 Fillmore St. - San Francisco, CA 94115  
Phone: +1 415 345 2155 - Fax: +1 415 345 8455
