You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Available at https://github.com/usnistgov/ACVP-Server/blob/85f8742965b2691862079172982683757d8d91db/README.md#License
1400
+
1401
+
NIST-developed software is provided by NIST as a public service. You may use, copy, and distribute copies of the software in any medium, provided that you keep intact this entire notice. You may improve, modify, and create derivative works of the software or any portion of the software, and you may copy and distribute such modifications or works. Modified works should carry a notice stating that you changed the software and should note the date and nature of any such change. Please explicitly acknowledge the National Institute of Standards and Technology as the source of the software.
1402
+
1403
+
NIST-developed software is expressly provided "AS IS." NIST MAKES NO WARRANTY OF ANY KIND, EXPRESS, IMPLIED, IN FACT, OR ARISING BY OPERATION OF LAW, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, AND DATA ACCURACY. NIST NEITHER REPRESENTS NOR WARRANTS THAT THE OPERATION OF THE SOFTWARE WILL BE UNINTERRUPTED OR ERROR-FREE, OR THAT ANY DEFECTS WILL BE CORRECTED. NIST DOES NOT WARRANT OR MAKE ANY REPRESENTATIONS REGARDING THE USE OF THE SOFTWARE OR THE RESULTS THEREOF, INCLUDING BUT NOT LIMITED TO THE CORRECTNESS, ACCURACY, RELIABILITY, OR USEFULNESS OF THE SOFTWARE.
1404
+
1405
+
You are solely responsible for determining the appropriateness of using and distributing the software and you assume all risks associated with its use, including but not limited to the risks and costs of program errors, compliance with applicable laws, damage to or loss of data, programs or equipment, and the unavailability or interruption of operation. This software is not intended to be used in any situation where a failure could cause risk of injury or damage to property. The software developed by NIST employees is not subject to copyright protection within the United States.
Copy file name to clipboardExpand all lines: docs/design/coreclr/botr/clr-abi.md
+1-84Lines changed: 1 addition & 84 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -200,11 +200,7 @@ For Windows/x86 on NativeAOT and Linux/x86, funclets are used just like on other
200
200
201
201
## Cloned finallys
202
202
203
-
JIT64 attempts to speed the normal control flow by 'inlining' a called finally along the 'normal' control flow (i.e., leaving a try body in a non-exceptional manner via C# fall-through). Because the VM semantics for non-rude Thread.Abort dictate that handlers will not be aborted, the JIT must mark these 'inlined' finally bodies. These show up as special entries at the end of the EH tables and are marked with `COR_ILEXCEPTION_CLAUSE_FINALLY | COR_ILEXCEPTION_CLAUSE_DUPLICATED`, and the try_start, try_end, and handler_start are all the same: the start of the cloned finally.
204
-
205
-
RyuJit also implements finally cloning, for all supported architectures. However, the implementation does not yet handle the thread abort case; cloned finally bodies are not guaranteed to remain intact and are not reported to the runtime. Because of this, finally cloning is disabled for VMs that support thread abort (desktop clr).
206
-
207
-
JIT32 does not implement finally cloning.
203
+
RyuJIT attempts to speed the normal control flow by 'inlining' a called finally along the 'normal' control flow (i.e., leaving a try body in a non-exceptional manner via C# fall-through). This optimization is supported on all architectures.
208
204
209
205
## Invoking Finallys/Non-local exits
210
206
@@ -499,85 +495,6 @@ When the inner "throw new UserException4" is executed, the exception handling fi
499
495
500
496
Filters are invoked in the 1st pass of EH processing and as such execution might resume back at the faulting address, or in the filter-handler, or someplace else. Because the VM must allow GC's to occur during and after a filter invocation, but before the EH subsystem knows where it will resume, we need to keep everything alive at both the faulting address **and** within the filter. This is accomplished by 3 means: (1) the VM's stackwalker and GCInfoDecoder report as live both the filter frame and its corresponding parent frame, (2) the JIT encodes all stack slots that are live within the filter as being pinned, and (3) the JIT reports as live (and possible zero-initializes) anything live-out of the filter. Because of (1) it is likely that a stack variable that is live within the filter and the try body will be double reported. During the mark phase of the GC double reporting is not a problem. The problem only arises if the object is relocated: if the same location is reported twice, the GC will try to relocate the address stored at that location twice. Thus we prevent the object from being relocated by pinning it, which leads us to why we must do (2). (3) is done so that after the filter returns, we can still safely incur a GC before executing the filter-handler or any outer handler within the same frame. For the same reason, control must exit a filter region via its final block (in other words, a filter region must terminate with the instruction that leaves the filter region, and the program may not exit the filter region via other paths).
501
497
502
-
## Duplicated Clauses
503
-
504
-
Duplicated clauses are a special set of entries in the EH tables to assist the VM. Specifically, if handler 'A' is also protected by an outer EH clause 'B', then the JIT must emit a duplicated clause, a duplicate of 'B', that marks the whole handler 'A' (which is now lexically disjoint for the range of code for the corresponding try body 'A') as being protected by the handler for 'B'.
505
-
506
-
Duplicated clauses are not needed for x86 and for NativeAOT ABI.
507
-
508
-
During exception dispatch the VM uses these duplicated clauses to know when to skip any frames between the handler and its parent function. After skipping to the parent function, due to a duplicated clause, the VM searches for a regular/non-duplicate clause in the parent function. The order of duplicated clauses is important. They should appear after all of the main function clauses. They should still follow the normal sorting rules (inner-to-outer, top-to-bottom), but because the try-start/try-end will all be the same for a given handler, they should maintain the ordering, regarding inner-to-outer, as the corresponding original clause.
509
-
510
-
Example:
511
-
512
-
```
513
-
A: try {
514
-
B: ...
515
-
C: try {
516
-
D: ...
517
-
E: try {
518
-
F: ...
519
-
G: }
520
-
H: catch {
521
-
I: ...
522
-
J: }
523
-
K: ...
524
-
L: }
525
-
M: finally {
526
-
N: ...
527
-
O: }
528
-
P: ...
529
-
Q: }
530
-
R: catch {
531
-
S: ...
532
-
T: }
533
-
```
534
-
535
-
In MSIL this would generate 3 EH clauses:
536
-
537
-
```
538
-
.try E-G catch H-J
539
-
.try C-L finally M-O
540
-
.try A-Q catch R-T
541
-
```
542
-
543
-
The native code would be laid out as follows (the order of the handlers is irrelevant except they are after the main method body) with their corresponding (fake) native offsets:
2. .try 3-9 finally 15-17 (top-most & next inner-most)
573
-
3. .try 1-11 catch 18-20 (top-most & outer-most)
574
-
4. .try 12-14 finally 15-17 duplicated (inner-most because clause 2 is inside clause 3, top-most because handler H-J is first)
575
-
5. .try 12-14 catch 18-20 duplicated
576
-
6. .try 15-17 catch 18-20
577
-
```
578
-
579
-
If the handlers were in a different order, then clause 6 might appear before clauses 4 and 5, but never in between.
580
-
581
498
## Clauses covering the same try region
582
499
583
500
Several consecutive clauses may cover the same `try` block. A clause covering the same region as the previous one is marked by the `COR_ILEXCEPTION_CLAUSE_SAMETRY` flag. When exception ex1 is thrown while running handler for another exception ex2 and the exception ex2 escapes the ex1's handler frame, this enables the runtime to skip clauses that cover the same `try` block as the clause that handled the ex1.
Copy file name to clipboardExpand all lines: docs/workflow/testing/libraries/testing-android.md
+35-1Lines changed: 35 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,7 +22,7 @@ Android SDK and NDK can be automatically installed via the following script:
22
22
#!/usr/bin/env bash
23
23
set -e
24
24
25
-
NDK_VER=r23c
25
+
NDK_VER=r27c
26
26
SDK_VER=9123335_latest
27
27
SDK_API_LEVEL=33
28
28
SDK_BUILD_TOOLS=33.0.1
@@ -154,3 +154,37 @@ The emulator can be launched with a variety of options. Run `emulator -help` to
154
154
### Debugging the native runtime code using Android Studio
155
155
156
156
See [Debugging Android](../../debugging/mono/android-debugging.md)
157
+
158
+
## Upgrading the Android NDK Version in CI Pipelines
159
+
160
+
The Android NDK has two release channels: a rolling release, which occurs approximately every quarter, and a Long Term Support (LTS) release, which happens once a year (typically in Q3). While release dates are not guaranteed, LTS versions receive support for at least one year or until the next LTS reaches the release candidate stage. After that, the NDK version stops receiving bug fixes and security updates.
161
+
162
+
The LTS NDK release schedule roughly aligns with the .NET Release Candidate (RC) timeline. Given this, we should plan to upgrade the NDK version used in `main` around that time. If we successfully upgrade before .NET release, we can ensure that our CI builds and tests run against a supported NDK version for approximately 9 months after the release.
163
+
164
+
.NET MAUI is supported for 18 months after each .NET release. This means the NDK version used in CI will be supported for about half the lifecycle of a given .NET MAUI release. If we want to ensure that the NDK version used in CI is supported for the entire lifecycle of a given .NET MAUI release, we should consider upgrading the NDK version in the `release` branches.
165
+
166
+
CI pipelines retrieve the NDK version from Docker images hosted in the [dotnet-buildtools-prereqs-docker](https://github.com/dotnet/dotnet-buildtools-prereqs-docker) repository.
167
+
168
+
For reference, see an example Dockerfile NDK definition:
169
+
[Azure Linux 3.0 .NET 10.0 Android Dockerfile](https://github.com/dotnet/dotnet-buildtools-prereqs-docker/blob/c480b239b3731983e36b0879f5b60d8f4ab7b945/src/azurelinux/3.0/net10.0/android/amd64/Dockerfile#L2).
170
+
171
+
Bumping version of the NDK in the prereqs repo will automatically propagate it to all CI runs Thus, bumping the NDK requires a three step process in order to ensure that CI continues to operate correctly.
172
+
To upgrade the NDK version used in CI for building and testing Android, follow these steps:
173
+
174
+
### 1. Verify the New NDK Version Locally
175
+
- Download the new NDK version.
176
+
- Test the local build using the new NDK by building a sample Android app.
177
+
- Ensure **AOT** and **AOT_WITH_LIBRARY_FILES** are enabled in the build.
178
+
179
+
### 2. Test the New NDK in CI and Fix Issues
180
+
- Create a new Docker image containing the updated NDK version (based on the original docker image from the [dotnet-buildtools-prereqs-docker](https://github.com/dotnet/dotnet-buildtools-prereqs-docker) repository).
181
+
- Open a **draft PR** in the **runtime** repository that updates the Dockerfile reference to use the new image.
182
+
- Monitor CI results and fix any failures.
183
+
- Once CI is green, **commit only the necessary changes** (e.g., fixes, build adjustments) to the respective branch.
184
+
-**Do not** change the Docker image reference in the final commit.
185
+
186
+
### 3. Update the NDK Version in the Prerequisites Repository
187
+
- Update the NDK version in the [dotnet-buildtools-prereqs-docker](https://github.com/dotnet/dotnet-buildtools-prereqs-docker) repository by modifying the Dockerfile.
188
+
- The updated NDK will automatically flow to all builds of a given branch once merged.
189
+
190
+
By following these steps, you ensure a smooth upgrade of the Android NDK in CI while maintaining stability and compatibility.
0 commit comments