<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 - [Windows][AArch64] setjmp/longjmp crashes with /guard:cf"
href="https://bugs.llvm.org/show_bug.cgi?id=47463">47463</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>[Windows][AArch64] setjmp/longjmp crashes with /guard:cf
</td>
</tr>
<tr>
<th>Product</th>
<td>lld
</td>
</tr>
<tr>
<th>Version</th>
<td>unspecified
</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>enhancement
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>COFF
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>Richard.Townsend@arm.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org
</td>
</tr></table>
<p>
<div>
<pre>Created <span class=""><a href="attachment.cgi?id=23936" name="attach_23936" title="Example program">attachment 23936</a> <a href="attachment.cgi?id=23936&action=edit" title="Example program">[details]</a></span>
Example program
When compiling the attached sample program (sample.c) in the following way from
an ARM64 cross-tools terminal:
clang-cl -o test-clang.obj -c sample.c /guard:cf --target=aarch64-windows /Z7
lld-link test-clang.obj /guard:cf -debug /out:test-clang-lld.exe
link test-clang.obj /guard:cf /out:test-clang-link.exe
The resulting binary (test-clang-lld.exe) terminates with a control flow guard
exception like the following:
EXCEPTION_RECORD: (.exr -1)
ExceptionAddress: 00007fff7a8337c8 (ntdll!RtlFailFast2)
ExceptionCode: c0000409 (Security check failure or stack buffer overrun)
ExceptionFlags: 00000001
NumberParameters: 1
Parameter[0]: 0000000000000026
Subcode: 0x26 FAST_FAIL_INVALID_LONGJUMP_TARGET
When linked with the Microsoft linker, everything works as expected.
Possible follow on to <a class="bz_bug_link
bz_status_NEW "
title="NEW - Emit longjmp target tables under /guard:cf,nochecks so users don't need /guard:cf,nolongjmp"
href="show_bug.cgi?id=40057">https://bugs.llvm.org/show_bug.cgi?id=40057</a></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>