<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 12 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-CA link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span style='color:#1F497D'>Hi Greg,<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>Will mixing and matching vc9 and vc10 binaries cause potential problems with memory allocators? <o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>Regards,<o:p></o:p></span></p><div><p class=MsoNormal><span style='color:#1F497D'>Trevor<o:p></o:p></span></p></div><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><div><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm'><p class=MsoNormal><b><span lang=EN-US style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span lang=EN-US style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> fdo-internals-bounces@lists.osgeo.org [mailto:fdo-internals-bounces@lists.osgeo.org] <b>On Behalf Of </b>Greg Boone<br><b>Sent:</b> March 23, 2011 11:56 AM<br><b>To:</b> FDO Internals Mail List (fdo-internals@lists.osgeo.org)<br><b>Cc:</b> FDO Users Mail List (fdo-users@lists.osgeo.org)<br><b>Subject:</b> [fdo-internals] Issues mixing vc9/vc10 runtimes and FdoIoFileStream* Create(FILE* fp)<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>Hi All,<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>Myself and Romy recently built the FDO binaries using vc9 and the FDO Unit Tests (and related CppUnit static lib) using vc10. This was done to mimic FDO usage within applications such as MapGuide, which may be compiled in vc10 in the near future.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>Running unit tests on Win64/Release we see the following fatal error.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.0pt;font-family:Consolas'><br>Microsoft Visual Studio C Runtime Library has detected a fatal error in UnitTest.exe.<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.0pt;font-family:Consolas'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'> msvcr90.dll!00000000704640b5() <o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>> FDOCommon.dll!FdoIoFileStream::InitFileStatus() Line 394 C++<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'> FDOCommon.dll!FdoIoFileStream::FdoIoFileStream() Line 78 C++<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'> FDOCommon.dll!FdoIoFileStream::Create() Line 125 C++<o:p></o:p></span></p><p class=MsoNormal><b><span lang=EN-US style='color:#C00000'> UnitTest.exe!FdoIoTest::setUp() Line 49 C++<o:p></o:p></span></b></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'> UnitTest.exe!CppUnit::TestCase::run() Line 27 C++<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'> UnitTest.exe!CppUnit::TestSuite::run() Line 44 C++<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'> UnitTest.exe!CppUnit::TextUi::TestRunner::runTest() Line 137 C++<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'> UnitTest.exe!CppUnit::TextUi::TestRunner::runTestByName() Line 81 C++<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'> UnitTest.exe!CppUnit::TextUi::TestRunner::run() Line 70 C++<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'> UnitTest.exe!main() Line 91 C++<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal style='margin-left:36.0pt;text-autospace:none'><span lang=EN-US style='font-size:9.5pt;font-family:Consolas;color:blue'>void</span><span lang=EN-US style='font-size:9.5pt;font-family:Consolas'> FdoIoFileStream::InitFileStatus()<o:p></o:p></span></p><p class=MsoNormal style='margin-left:36.0pt;text-autospace:none'><span lang=EN-US style='font-size:9.5pt;font-family:Consolas'>{<o:p></o:p></span></p><p class=MsoNormal style='margin-left:36.0pt;text-autospace:none'><span lang=EN-US style='font-size:9.5pt;font-family:Consolas;color:blue'>#ifdef</span><span lang=EN-US style='font-size:9.5pt;font-family:Consolas'> _WIN32<o:p></o:p></span></p><p class=MsoNormal style='margin-left:36.0pt;text-autospace:none'><span lang=EN-US style='font-size:9.5pt;font-family:Consolas'> mFd = _fileno(mFp);<o:p></o:p></span></p><p class=MsoNormal style='margin-left:36.0pt;text-autospace:none'><span lang=EN-US style='font-size:9.5pt;font-family:Consolas;color:blue'>#else</span><span lang=EN-US style='font-size:9.5pt;font-family:Consolas'><o:p></o:p></span></p><p class=MsoNormal style='margin-left:36.0pt;text-autospace:none'><span lang=EN-US style='font-size:9.5pt;font-family:Consolas'> mFd = fileno(mFp);<o:p></o:p></span></p><p class=MsoNormal style='margin-left:36.0pt;text-autospace:none'><span lang=EN-US style='font-size:9.5pt;font-family:Consolas;color:blue'>#endif</span><span lang=EN-US style='font-size:9.5pt;font-family:Consolas'><o:p></o:p></span></p><p class=MsoNormal style='margin-left:36.0pt;text-autospace:none'><span lang=EN-US style='font-size:9.5pt;font-family:Consolas'> <span style='color:blue'>struct</span> stat fileStat;<o:p></o:p></span></p><p class=MsoNormal style='margin-left:36.0pt;text-autospace:none'><span lang=EN-US style='font-size:9.5pt;font-family:Consolas'><o:p> </o:p></span></p><p class=MsoNormal style='margin-left:36.0pt;text-autospace:none'><span lang=EN-US style='font-size:9.5pt;font-family:Consolas'> <span style='color:blue'>if</span> ( fstat(mFd, &fileStat) != 0 ) <b><span style='color:#C00000'><<<<<<<<<<<<<<<<<<<<<<<<< Here <<<<<<<<<<<<<<<<<<</span></b><o:p></o:p></span></p><p class=MsoNormal style='margin-left:36.0pt;text-autospace:none'><span lang=EN-US style='font-size:9.5pt;font-family:Consolas'> <span style='color:blue'>throw</span> FdoException::Create(<o:p></o:p></span></p><p class=MsoNormal style='margin-left:36.0pt;text-autospace:none'><span lang=EN-US style='font-size:9.5pt;font-family:Consolas'> FdoException::NLSGetMessage(FDO_NLSID(FDO_24_STREAMBADFP)));<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.5pt;font-family:Consolas'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>The problem is that in the unit test, the FILE* is opened using vc10, then in FDOCommon the vc9 version of fstat is used to access that pointer… and blammo, it dies.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal style='margin-left:36.0pt;text-autospace:none'><span lang=EN-US style='font-size:9.5pt;font-family:Consolas;color:blue'>void</span><span lang=EN-US style='font-size:9.5pt;font-family:Consolas'> FdoIoTest::setUp()<o:p></o:p></span></p><p class=MsoNormal style='margin-left:36.0pt;text-autospace:none'><span lang=EN-US style='font-size:9.5pt;font-family:Consolas'>{<o:p></o:p></span></p><p class=MsoNormal style='margin-left:36.0pt;text-autospace:none'><span lang=EN-US style='font-size:9.5pt;font-family:Consolas'> <span style='color:green'>// Create a file used for various file tests.</span><o:p></o:p></span></p><p class=MsoNormal style='margin-left:36.0pt;text-autospace:none'><b><span lang=EN-US style='font-size:9.5pt;font-family:Consolas;color:#C00000'> FILE* fp = fopen( "testFile.txt", "w" );<o:p></o:p></span></b></p><p class=MsoNormal style='margin-left:36.0pt;text-autospace:none'><span lang=EN-US style='font-size:9.5pt;font-family:Consolas'> FdoIoFileStreamP fileStream = FdoIoFileStream::Create( fp );<o:p></o:p></span></p><p class=MsoNormal style='margin-left:36.0pt;text-autospace:none'><span lang=EN-US style='font-size:9.5pt;font-family:Consolas'><o:p> </o:p></span></p><p class=MsoNormal style='margin-left:36.0pt;text-autospace:none'><span lang=EN-US style='font-size:9.5pt;font-family:Consolas'> fileStream->Write( (FdoByte*) <span style='color:#A31515'>"test file contents"</span>, 18 );<o:p></o:p></span></p><p class=MsoNormal style='margin-left:36.0pt;text-autospace:none'><span lang=EN-US style='font-size:9.5pt;font-family:Consolas'> fileStream = NULL;<o:p></o:p></span></p><p class=MsoNormal style='margin-left:36.0pt;text-autospace:none'><span lang=EN-US style='font-size:9.5pt;font-family:Consolas'> fclose(fp);<o:p></o:p></span></p><p class=MsoNormal style='margin-left:36.0pt;text-autospace:none'><span lang=EN-US style='font-size:9.5pt;font-family:Consolas'>}<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.5pt;font-family:Consolas'><o:p> </o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='color:#1F497D'>The problem API function is question is the following.</span><span lang=EN-US style='font-size:9.5pt;font-family:Consolas'><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal style='margin-left:36.0pt;text-autospace:none'><span lang=EN-US style='font-size:9.5pt;font-family:Consolas;color:blue'>class</span><span lang=EN-US style='font-size:9.5pt;font-family:Consolas'> FdoIoFileStream : <span style='color:blue'>public</span> FdoIoStream<o:p></o:p></span></p><p class=MsoNormal style='margin-left:36.0pt;text-autospace:none'><span lang=EN-US style='font-size:9.5pt;font-family:Consolas'>{<o:p></o:p></span></p><p class=MsoNormal style='margin-left:36.0pt;text-autospace:none'><span lang=EN-US style='font-size:9.5pt;font-family:Consolas;color:blue'>public</span><span lang=EN-US style='font-size:9.5pt;font-family:Consolas'>:<o:p></o:p></span></p><p class=MsoNormal style='margin-left:36.0pt;text-autospace:none'><span lang=EN-US style='font-size:9.5pt;font-family:Consolas'>…<o:p></o:p></span></p><p class=MsoNormal style='margin-left:36.0pt;text-autospace:none'><span lang=EN-US style='font-size:9.5pt;font-family:Consolas'>…<o:p></o:p></span></p><p class=MsoNormal style='margin-left:36.0pt;text-autospace:none'><span lang=EN-US style='font-size:9.5pt;font-family:Consolas'> <span style='color:green'>/// \brief</span><o:p></o:p></span></p><p class=MsoNormal style='margin-left:36.0pt;text-autospace:none'><span lang=EN-US style='font-size:9.5pt;font-family:Consolas'> <span style='color:green'>/// creates the stream around a C Runtime file stream.</span><o:p></o:p></span></p><p class=MsoNormal style='margin-left:36.0pt;text-autospace:none'><span lang=EN-US style='font-size:9.5pt;font-family:Consolas'> <span style='color:green'>/// </span><o:p></o:p></span></p><p class=MsoNormal style='margin-left:36.0pt;text-autospace:none'><span lang=EN-US style='font-size:9.5pt;font-family:Consolas'> <span style='color:green'>/// \param fp </span><o:p></o:p></span></p><p class=MsoNormal style='margin-left:36.0pt;text-autospace:none'><span lang=EN-US style='font-size:9.5pt;font-family:Consolas'> <span style='color:green'>/// Input the file stream pointer.</span><o:p></o:p></span></p><p class=MsoNormal style='margin-left:36.0pt;text-autospace:none'><span lang=EN-US style='font-size:9.5pt;font-family:Consolas'> <span style='color:green'>/// </span><o:p></o:p></span></p><p class=MsoNormal style='margin-left:36.0pt;text-autospace:none'><span lang=EN-US style='font-size:9.5pt;font-family:Consolas'> <span style='color:green'>/// \return</span><o:p></o:p></span></p><p class=MsoNormal style='margin-left:36.0pt;text-autospace:none'><span lang=EN-US style='font-size:9.5pt;font-family:Consolas'> <span style='color:green'>/// Returns the created file stream.</span><o:p></o:p></span></p><p class=MsoNormal style='margin-left:36.0pt;text-autospace:none'><span lang=EN-US style='font-size:9.5pt;font-family:Consolas'> <span style='color:green'>/// </span><o:p></o:p></span></p><p class=MsoNormal style='margin-left:36.0pt;text-autospace:none'><span lang=EN-US style='font-size:9.5pt;font-family:Consolas'> FDO_API_COMMON <span style='color:blue'>static</span> FdoIoFileStream* Create(FILE* fp);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.5pt;font-family:Consolas'><o:p> </o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.5pt;font-family:Consolas'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>My initial thought is to remove this method from the FDO API in 3.7.0.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>The main purpose of the function is to allow an already opened FILE pointer (or stdin or stdout) to be wrapped in an FDO stream, usually for reading or writing XML. Streaming to or from stdout or stdin would likely be the most common case since the overload that takes a file name would more likely be used to access a disk file. <o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>The only problem in removing it would be if a customer is calling it directly. I would almost say that this is unlikely but I suppose it is possible that someone is using it to stream XML from FDO to stdout. <o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>Is there anyone using this method? Are there objections to removing it from the FDO API?<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>Regards,<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>Greg<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p></div></body></html>