[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>&nbsp;&nbsp;&nbsp; in file glxvisuals.c, function init_visuals():</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;static Bool init_visuals(int *nvisualp, VisualPtr \
*visualp, VisualID *defaultVisp,&nbsp;int ndepth, DepthPtr pdepth,&nbsp;int \
rootDepth)</DIV> <DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;&nbsp; in this function, code segment :</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;&nbsp; if (numConfigs == 0) {<BR>&nbsp;&nbsp;&nbsp; \
&nbsp;&nbsp;&nbsp;&nbsp; memcpy(pNewVisualConfigs, FallbackConfigs, \
NUM_FALLBACK_CONFIGS * sizeof(__GLXvisualConfig));<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
&nbsp;&nbsp; memset(pNewVisualPriv, 0, NUM_FALLBACK_CONFIGS * sizeof(void \
*));<BR>&nbsp;&nbsp;&nbsp; }<BR>&nbsp;&nbsp;&nbsp; else \
{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /* copy driver's visual config info \
*/<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for (i = 0; i &lt; numConfigs; i++) \
{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
pNewVisualConfigs[i] = \
visualConfigs[i];<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
pNewVisualPriv[i] = visualPrivates[i];<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
}<BR>&nbsp;&nbsp;&nbsp; }</DIV> <DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;&nbsp; use S3 driver, will go into "else" path, but in my machine \
visualPrivates is 0x0X0, and </DIV> <DIV>&nbsp;&nbsp;&nbsp; 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>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>Thanks</DIV>
<DIV>Jeff<BR></DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</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