C API: Crash happens in the API when enable gflag

Dear experts,

I am meeting a crash in SUMeshHelperCreateWithTextureWriter(…). Use the attached sample code in SDK_WIN_x64_2019-0-753_0.zip, and can reproduce this crash.

Reproduce steps:

  1. Unzip gflags.zip to C:\Temp, enable gflag by the command “C:\Temp\gflags\gflags.exe /p /enable “C:\SDK_WIN_x64_2019-0-753_0\samples\skp_to_xml\win\x64\Release\test.exe” /full”.
  2. Open C:\SDK_WIN_x64_2019-0-753_0\samples\skp_to_xml\win\skp2xml.sln.
  3. Use ‘Release|x64’, and activate ‘test’ project.
  4. Modify the library path in the all project settings, and debug the attached model(8_3.skp).
  5. Crash happens in the toolkit API SUMeshHelperCreateWithTextureWriter(…).

8_3.skp (2.4 MB)
gflags.zip (74.2 KB)
SDK_WIN_x64_2019-0-753_0.zip (6.3 MB)

What is this gflags?

Your test project seems to refer to an XML file not included:

int main(int argc, char* argv[])
{
    std::string skpName = argv[1];
    std::string xmlName("E:\\test.xml");
    CXmlExporter ex;
    bool res  = ex.Convert(skpName, xmlName, nullptr);

}

The OP’s test is built upon the sample XML exporter, so the xmlName would be the output pathname to which the loaded SKP file would be exported to (I would think.)

You can see the following link for the gflag introduction. It is mainly for testing the memory use.

My use here for gflag: use the page heap options in GFlags full-page heap verification , which places an inaccessible page at the end of each allocation so that the program stops immediately if it accesses memory beyond the allocation.

Xml file is the exported file from the input sketchup file. You only need provide a correct location on your machine.

I see. I need to read up more about this tool, as the description of it include:

Note Incorrect use of this tool can degrade system performance or prevent Windows from starting, requiring you to reinstall Windows.

I need to know more about this tool before I run it on my system as a reinstall would cause significant downtime for me. Might have to defer until next week when the US office is open and have it tested on one of our test-machines.

Logged it in the issue tracker: Crash happens in the C API when enable gflag · Issue #377 · SketchUp/api-issue-tracker · GitHub

Thank you for following up.