[prev in list] [next in list] [prev in thread] [next in thread]
List: freedesktop-xorg
Subject: visualPrivates problem: it's not initialized
From: soararing <soararing () 163 ! com>
Date: 2007-09-29 7:10:54
Message-ID: 1849880613.249991191049854425.JavaMail.coremail () bj163app99 ! 163 ! com
[Download RAW message or body]
[Attachment #2 (multipart/Alternative)]
Hi, in file glxvisuals.c, function init_visuals(): static Bool \
init_visuals(int *nvisualp, VisualPtr *visualp, VisualID *defaultVisp, int ndepth, \
DepthPtr pdepth, int rootDepth) in this function, code segment : if \
(numConfigs == 0) {
memcpy(pNewVisualConfigs, FallbackConfigs, NUM_FALLBACK_CONFIGS * \
sizeof(__GLXvisualConfig)); memset(pNewVisualPriv, 0, NUM_FALLBACK_CONFIGS * \
sizeof(void *)); }
else {
/* copy driver's visual config info */
for (i = 0; i < numConfigs; i++) {
pNewVisualConfigs[i] = visualConfigs[i];
pNewVisualPriv[i] = visualPrivates[i];
}
} use S3 driver, will go into "else" path, but in my machine visualPrivates \
is 0x0X0, and pNewVisualPriv[i] = visualPrivates[i] will cause segmentation fault \
because visualPrivates[0] is not alloctate memory, so where the pointer \
visualPrivates is initialized in Xorg7.1? ThanksJeff
[Attachment #5 (text/html)]
<DIV>Hi,</DIV>
<DIV> in file glxvisuals.c, function init_visuals():</DIV>
<DIV> </DIV>
<DIV> static Bool init_visuals(int *nvisualp, VisualPtr \
*visualp, VisualID *defaultVisp, int ndepth, DepthPtr pdepth, int \
rootDepth)</DIV> <DIV> </DIV>
<DIV> </DIV>
<DIV> in this function, code segment :</DIV>
<DIV> </DIV>
<DIV> if (numConfigs == 0) {<BR> \
memcpy(pNewVisualConfigs, FallbackConfigs, \
NUM_FALLBACK_CONFIGS * sizeof(__GLXvisualConfig));<BR> \
memset(pNewVisualPriv, 0, NUM_FALLBACK_CONFIGS * sizeof(void \
*));<BR> }<BR> else \
{<BR> /* copy driver's visual config info \
*/<BR> for (i = 0; i < numConfigs; i++) \
{<BR> \
pNewVisualConfigs[i] = \
visualConfigs[i];<BR> \
pNewVisualPriv[i] = visualPrivates[i];<BR> \
}<BR> }</DIV> <DIV> </DIV>
<DIV> </DIV>
<DIV> use S3 driver, will go into "else" path, but in my machine \
visualPrivates is 0x0X0, and </DIV> <DIV> pNewVisualPriv[i] = \
visualPrivates[i] will cause segmentation fault because visualPrivates[0] is not \
alloctate memory, so where the pointer visualPrivates is initialized in \
Xorg7.1?</DIV> <DIV> </DIV>
<DIV> </DIV>
<DIV>Thanks</DIV>
<DIV>Jeff<BR></DIV>
<DIV> </DIV>
<DIV> </DIV><br><!-- footer --><br>
<hr>
<table width="100%%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="50" height="50"><img \
src="http://mimg.163.com/hd/163/163footer/163footer_50.jpg" alt="LOGO" width="50" \
height="50"></td> <td style="padding:5px;"><a style="font-size:12px;color:black; \
line-height:20px;text-decoration:none;" \
href="http://popme.163.com/link/003515_0929_938.html">把爱心注入牛奶,共同凝聚这份力量</a><br \
/><a style="font-size:12px;line-height:20px; color:black; text-decoration:none;" \
href="http://popme163.com/link/003515_0929_938.html">快来参加蒙牛免费赠奶爱心行动 \
</a></td> </tr>
</table>
_______________________________________________
xorg mailing list
xorg@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/xorg
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic