title: Qt 4.8.2 QString toStdString unhandled exception
body: <pre><code>void QuinielaApuesta::funcion(QString &amp; str)
  {
      std::string cadenita = str.toStdString();
      std::cout &lt;&lt; cadenita &lt;&lt; std::endl;
  }
  </code></pre>
  
  <p>I am on Qt 4.8.2 for VS2010, Windows 7 N 64-bit, Visual Studio 2010 and using the QString method "toStdString()" (or something somewhat related) causes an Unhandled exception.</p>
  
  <p>it doesn't matter where I use the line</p>
  
  <pre><code>std::string cadenita = str.toStdString();
  </code></pre>
  
  <p>It will cause an unhandled exception. In this particular case, it happens right after I get out of the method "funcion"s scope. But it happens in the current context of the scope escape (That is, if you put this line in an object's constructor, it will proceed as expected until the end of the constructor, and then when it should proceed to a higher scope level, it will send an Unhandled Exception error).</p>
  
  <p>I have isolated the issue to .toStdString by trial and error, and I cannot say if other methods might (or might) have this same issue. I can say, however, that as soon as the line is commented, it all works ok. In fact, if I replace said line with a simple</p>
  
  <pre><code>std::cout &lt;&lt; "Some Funny Test Text" std::endl;
  </code></pre>
  
  <p>It all works fine and dandy.</p>
  
  <p>The error is</p>
  
  <blockquote>
    <p>Unhandled exception at 0x53b8ad7a (msvcp100d.dll) in C_plus_plus_QT_project.exe: 0xC0000005: Access violation reading location 0xccccccd0.</p>
  </blockquote>
  
  <p>And then in file xutility, line 201</p>
  
  <pre><code> #if _ITERATOR_DEBUG_LEVEL == 2
  if (_Myproxy != 0)
      {   // proxy allocated, drain it
      _Lockit _Lock(_LOCK_DEBUG);
  
      for (_Iterator_base12 **_Pnext = &amp;_Myproxy-&gt;_Myfirstiter;
          *_Pnext != 0; *_Pnext = (*_Pnext)-&gt;_Mynextiter) // HERE IS THE LINE WHERE THE BREAK KICKS IN
          (*_Pnext)-&gt;_Myproxy = 0;
      _Myproxy-&gt;_Myfirstiter = 0;
      }
  </code></pre>
  
  <p>Visual Studio's output is:</p>
  
  <blockquote>
    <p>'C_plus_plus_QT_project.exe': Loaded 'C:\Users\aravasio\Desktop\C_plus_plus_QT_project\Debug\C_plus_plus_QT_project.exe', Symbols loaded.
    'C_plus_plus_QT_project.exe': Loaded 'C:\Windows\SysWOW64\ntdll.dll', Cannot find or open the PDB file
    'C_plus_plus_QT_project.exe': Loaded 'C:\Windows\SysWOW64\kernel32.dll', Cannot find or open the PDB file
    'C_plus_plus_QT_project.exe': Loaded 'C:\Windows\SysWOW64\KernelBase.dll', Cannot find or open the PDB file
    'C_plus_plus_QT_project.exe': Loaded 'C:\Users\aravasio\Desktop\C_plus_plus_QT_project\Debug\QtGui4.dll', Binary was not built with debug information.
    'C_plus_plus_QT_project.exe': Loaded 'C:\Windows\SysWOW64\gdi32.dll', Cannot find or open the PDB file
    'C_plus_plus_QT_project.exe': Loaded 'C:\Windows\SysWOW64\user32.dll', Cannot find or open the PDB file
    'C_plus_plus_QT_project.exe': Loaded 'C:\Windows\SysWOW64\advapi32.dll', Cannot find or open the PDB file
    'C_plus_plus_QT_project.exe': Loaded 'C:\Windows\SysWOW64\msvcrt.dll', Cannot find or open the PDB file
    'C_plus_plus_QT_project.exe': Loaded 'C:\Windows\SysWOW64\sechost.dll', Cannot find or open the PDB file
    'C_plus_plus_QT_project.exe': Loaded 'C:\Windows\SysWOW64\rpcrt4.dll', Cannot find or open the PDB file
    'C_plus_plus_QT_project.exe': Loaded 'C:\Windows\SysWOW64\sspicli.dll', Cannot find or open the PDB file
    'C_plus_plus_QT_project.exe': Loaded 'C:\Windows\SysWOW64\cryptbase.dll', Cannot find or open the PDB file
    'C_plus_plus_QT_project.exe': Loaded 'C:\Windows\SysWOW64\lpk.dll', Cannot find or open the PDB file
    'C_plus_plus_QT_project.exe': Loaded 'C:\Windows\SysWOW64\usp10.dll', Cannot find or open the PDB file
    'C_plus_plus_QT_project.exe': Loaded 'C:\Windows\SysWOW64\comdlg32.dll', Cannot find or open the PDB file
    'C_plus_plus_QT_project.exe': Loaded 'C:\Windows\SysWOW64\shlwapi.dll', Cannot find or open the PDB file
    'C_plus_plus_QT_project.exe': Loaded 'C:\Windows\winsxs\x86_microsoft.windows.common-controls_6595b64144ccf1df_5.82.7601.17514_none_ec83dffa859149af\comctl32.dll', Cannot find or open the PDB file
    'C_plus_plus_QT_project.exe': Loaded 'C:\Windows\SysWOW64\shell32.dll', Cannot find or open the PDB file
    'C_plus_plus_QT_project.exe': Loaded 'C:\Windows\SysWOW64\oleaut32.dll', Cannot find or open the PDB file
    'C_plus_plus_QT_project.exe': Loaded 'C:\Windows\SysWOW64\ole32.dll', Cannot find or open the PDB file
    'C_plus_plus_QT_project.exe': Loaded 'C:\Windows\SysWOW64\imm32.dll', Cannot find or open the PDB file
    'C_plus_plus_QT_project.exe': Loaded 'C:\Windows\SysWOW64\msctf.dll', Cannot find or open the PDB file
    'C_plus_plus_QT_project.exe': Loaded 'C:\Windows\SysWOW64\winmm.dll', Cannot find or open the PDB file
    'C_plus_plus_QT_project.exe': Loaded 'C:\Windows\SysWOW64\winspool.drv', Cannot find or open the PDB file
    'C_plus_plus_QT_project.exe': Loaded 'C:\Users\aravasio\Desktop\C_plus_plus_QT_project\Debug\QtCore4.dll', Binary was not built with debug information.
    'C_plus_plus_QT_project.exe': Loaded 'C:\Windows\SysWOW64\ws2_32.dll', Cannot find or open the PDB file
    'C_plus_plus_QT_project.exe': Loaded 'C:\Windows\SysWOW64\nsi.dll', Cannot find or open the PDB file
    'C_plus_plus_QT_project.exe': Loaded 'C:\Windows\winsxs\x86_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.30729.6161_none_50934f2ebcb7eb57\msvcp90.dll', Cannot find or open the PDB file
    'C_plus_plus_QT_project.exe': Loaded 'C:\Windows\winsxs\x86_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.30729.6161_none_50934f2ebcb7eb57\msvcr90.dll', Cannot find or open the PDB file
    'C_plus_plus_QT_project.exe': Loaded 'C:\Windows\SysWOW64\msvcp100d.dll', Symbols loaded.
    'C_plus_plus_QT_project.exe': Loaded 'C:\Windows\SysWOW64\msvcr100d.dll', Symbols loaded.
    'C_plus_plus_QT_project.exe': Loaded 'C:\Windows\SysWOW64\uxtheme.dll', Cannot find or open the PDB file
    'C_plus_plus_QT_project.exe': Loaded 'C:\Windows\SysWOW64\dwmapi.dll', Cannot find or open the PDB file
    First-chance exception at 0x53b8ad7a (msvcp100d.dll) in C_plus_plus_QT_project.exe: 0xC0000005: Access violation reading location 0xccccccd0.
    Unhandled exception at 0x53b8ad7a (msvcp100d.dll) in C_plus_plus_QT_project.exe: 0xC0000005: Access violation reading location 0xccccccd0.</p>
  </blockquote>
  
  <p>If I can provide any other information about my system, I will be glad to.</p>
  
  <p>I can only make some sort of educated guess that this is not a Qt bug, because at home I am having no problem at all (but at home I am using an x86 W7, so it might not be a good example).</p>
  
  <p>Does anybody know about this? I've googled quite a bit, but every error seems to have been addressed in an old hotfix.</p>
  
  <p>Should I just abandon ship and try VS2008? Does it work with x64 environments? (Release is going to be for x86, btw, not x64)</p>