<html>
<head>
<base href="https://bugs.llvm.org/">
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW - DynamicLibrary Shutdown unit test crashes when built with /MTd"
href="https://bugs.llvm.org/show_bug.cgi?id=34456">34456</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>DynamicLibrary Shutdown unit test crashes when built with /MTd
</td>
</tr>
<tr>
<th>Product</th>
<td>libraries
</td>
</tr>
<tr>
<th>Version</th>
<td>trunk
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>Windows NT
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>Support Libraries
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>jh7370.2008@my.bristol.ac.uk
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org
</td>
</tr></table>
<p>
<div>
<pre>In DynamicLibraryTest.cpp, the unit test "Shutdown" crashes if building with
Visual Studio and the cmake variable "LLVM_USE_CRT_DEBUG" is set to /MTd.
The problem appears to be that in this mode, allocating in the main
executable's heap and destroying from the DLL (or vice versa) is not allowed.
During the test, a vector owned by the main executable is resized by the DLL,
resulting in the crash as it deallocates the original vector element.
I attempted to reserve space in the vector to fix the issue, but then the
copying of the string within push_back (called during the Global destructor in
PipSqueak) resulted in a memory allocation in the DLL, leading to a crash when
destroying the vector in the main executable.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>