I have narrowed the issue down to a difference in behaviour between Windows and Wine.<div><br></div><div>The problem boils down to the following code:<div><pre style="font-family:Consolas;font-size:13;color:black;background:white;">

  NONCLIENTMETRICS ncm;
  memset(&ncm, 0, <span style="color:blue;">sizeof</span>(NONCLIENTMETRICS));
  ncm.cbSize = <span style="color:blue;">sizeof</span>(NONCLIENTMETRICS);

  VERIFY(SystemParametersInfo(SPI_GETNONCLIENTMETRICS, <span style="color:blue;">sizeof</span>(NONCLIENTMETRICS), &ncm, 0));</pre><pre style="font-family:Consolas;font-size:13;color:black;background:white;"><span class="Apple-style-span" style="font-family: arial; white-space: normal; font-size: small; ">I used the font's returned from this call for drawing text and this caused the crash.</span></pre>

<pre style="font-family:Consolas;font-size:13;color:black;background:white;"><span class="Apple-style-span" style="font-family: arial; white-space: normal; font-size: small; ">The problem is that I upgraded to VS2010 and changed the target to WINVER=0x600.</span></pre>

<pre style="font-family:Consolas;font-size:13;color:black;background:white;"><span class="Apple-style-span" style="font-family: arial; white-space: normal; font-size: small; ">This means that I needed to change my code to the following.</span></pre>

<pre style="font-family:Consolas;font-size:13;color:black;background:white;"><span class="Apple-style-span" style="font-family: arial; white-space: normal; font-size: small; "><pre style="font-family:Consolas;font-size:13;color:black;background:white;">

  NONCLIENTMETRICS ncm;
  memset(&ncm, 0, <span style="color:blue;">sizeof</span>(NONCLIENTMETRICS));
  ncm.cbSize = <span style="color:blue;">sizeof</span>(NONCLIENTMETRICS);
 
<span style="color:blue;">#if</span>(WINVER >= 0x0600) 
  OSVERSIONINFO osvi; 
  memset(&osvi,0,<span style="color:blue;">sizeof</span>(osvi)); 
  osvi.dwOSVersionInfoSize = <span style="color:blue;">sizeof</span>(osvi); 
  GetVersionEx(&osvi); 
  <span style="color:blue;">if</span> (osvi.dwMajorVersion < 6) 
    ncm.cbSize -= <span style="color:blue;">sizeof</span>(ncm.iPaddedBorderWidth); 
<span style="color:blue;">#endif</span>
  VERIFY(SystemParametersInfo(SPI_GETNONCLIENTMETRICS, <span style="color:blue;">sizeof</span>(NONCLIENTMETRICS), &ncm, 0));</pre></span></pre><pre style="font-family:Consolas;font-size:13;color:black;background:white;">

<span class="Apple-style-span" style="font-family: arial; white-space: normal; font-size: small; ">Note: On windows my application does not actually crash or stop working with my original code and the text is displayed at a size I would kind of expect it to be.</span></pre>

</div><div>I will raise a bug for this one... as a difference in behaviour.</div><div><br></div><div><br><div class="gmail_quote">On 7 October 2011 08:50, Damian Dixon <span dir="ltr"><<a href="mailto:damian.dixon@gmail.com">damian.dixon@gmail.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Thanks for the suggestions.<div><br></div><div>I've narrowed one of the issues down to WineEngGetGlyphOutline in dlls/gdi32/freetype.c.</div>

<div><br></div><div>The pitch is 6640 and the height is 53003. This means that a buffer of ~335Mb has been allocated and then memset.</div>
<div><br></div><div>This is where the slow down is occurring (because of the memset). I suspect the resultant crash is also because of this.</div><div><br></div><div>I would suggest that limits need to be placed on the maximum pitch and height.<br>


<br><br>I do not however believe that this is the root cause just one of the symptoms. </div><div><div></div><div class="h5"><div><br></div><div><br><br><div class="gmail_quote">On 5 October 2011 18:37, Marcus Meissner <span dir="ltr"><<a href="mailto:marcus@jet.franken.de" target="_blank">marcus@jet.franken.de</a>></span> wrote:<br>


<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>On Wed, Oct 05, 2011 at 04:53:18PM +0100, Damian Dixon wrote:<br>
> Hi,<br>
><br>
> I was attempting to use Wine 1.3.29 (in OpenSUSE 11.4 x86) and because of<br>
> issues pulled the source from git last night and still have problems.<br>
><br>
> I am having performance issues with DrawText (5 odd seconds to draw a simple<br>
> string) and the occasional X Error and crash.<br>
><br>
> The X Error is consistent and is as follows:<br>
><br>
> fixme:advapi:SetSecurityInfo stub<br>
> X Error of failed request:  BadLength (poly request too large or internal<br>
> Xlib length error)<br>
>   Major opcode of failed request:  151 (RENDER)<br>
>   Minor opcode of failed request:  17 (RenderCreateGlyphSet)<br>
>   Serial number of failed request:  41091<br>
>   Current serial number in output stream:  41571<br>
> Process of pid=0023 has terminated<br>
><br>
><br>
> The crash less consistent but is dependent upon the amount of text I attempt<br>
> to draw.<br>
><br>
> The last version I know this worked in was 1.1.39.<br>
><br>
> I've a few things to still try out before I attempt to create an RBT.<br>
<br>
</div>To get a backtrace and be able to dump some datastructures, run with<br>
<br>
WINEDEBUG=+synchronous wine foo.exe<br>
<br>
This will bring it into the debugger once the condition happens.<br>
<br>
CIao, MArcus<br>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div></div>