Skip to content

[2020-02] [mono][loader] Set status on success; avoid mmap on Android#21610

Merged
akoeplinger merged 2 commits into2020-02from
backport/pr-21609-to-2020-02
Jan 26, 2023
Merged

[2020-02] [mono][loader] Set status on success; avoid mmap on Android#21610
akoeplinger merged 2 commits into2020-02from
backport/pr-21609-to-2020-02

Conversation

@github-actions
Copy link
Contributor

@github-actions github-actions bot commented Jan 20, 2023

Backport of #21609 to 2020-02

/cc @lambdageek

Customer Impact

Customers using Xamarin Android may experience sporadic crashes at app startup or during assembly loading due to an uninitialized variable.

Testing

Manual testing

Risk

Low. We now initialize the variable.

IMPORTANT: Is this backport for a servicing release? If so and this change touches code that ships in a NuGet package, please make certain that you have added any necessary package authoring and gotten it explicitly reviewed.

Manual backport of dotnet/runtime#80949 to mono/mono

Emebedders that call `mono_assembly_load_from_full` may observe a non-NULL return value and an uninitialized MonoImageOpenStatus, which may lead to incorrect diagnostics in code like:

```
MonoImageOpenStatus status;
MonoAssembly *assembly = mono_assembly_load_from_full (image, name, status, refonly);
if (!assembly || status != MONO_IMAGE_OK) {
   fprintf(stderr, "Failure due to: %s\n", mono_image_strerror (status));
   abort();
}
```
Which will print `Failure due to: Internal error`

Addresses dotnet/android#7658
Avoid an mmap that will fail since Android uses a custom
loader and the assemblies aren't on disk
@lambdageek
Copy link
Member

/cc @akoeplinger

@lambdageek lambdageek closed this Jan 25, 2023
@lambdageek lambdageek reopened this Jan 25, 2023
@lambdageek
Copy link
Member

@monojenkins build

@akoeplinger akoeplinger merged commit a102a35 into 2020-02 Jan 26, 2023
@akoeplinger akoeplinger deleted the backport/pr-21609-to-2020-02 branch January 26, 2023 15:18
jonpryor added a commit to jonpryor/xamarin-android that referenced this pull request May 19, 2023
Fixes: dotnet#7658

Changes: mono/mono@6dd9def...73df89a

  * mono/mono@73df89a73d2: Fix xar url again
  * mono/mono@36fd1837d0d: Switch back to original xar version
  * mono/mono@5bbc709e5dc: Fix xar download url
  * mono/mono@3cb47d8b4dc: [mono] Use `unsigned char` when computing UTF8 string hashes (mono/mono#21633)
  * mono/mono@a102a350e53: [2020-02] [mono][loader] Set status on success; avoid mmap on Android (mono/mono#21610)
  * mono/mono@74f85c2ac33: Fix url to gtksharp msi
  * mono/mono@2f7d584ad2b: Fix build on macOS 13 / Xcode 14 (mono/mono#21597)
  * mono/mono@03b09960787: Disable a failing test
jonpryor added a commit to dotnet/android that referenced this pull request May 25, 2023
Fixes: #7658

Changes: mono/mono@6dd9def...73df89a

  * mono/mono@73df89a73d2: Fix xar url again
  * mono/mono@36fd1837d0d: Switch back to original xar version
  * mono/mono@5bbc709e5dc: Fix xar download url
  * mono/mono@3cb47d8b4dc: [mono] Use `unsigned char` when computing UTF8 string hashes (mono/mono#21633)
  * mono/mono@a102a350e53: [2020-02] [mono][loader] Set status on success; avoid mmap on Android (mono/mono#21610)
  * mono/mono@74f85c2ac33: Fix url to gtksharp msi
  * mono/mono@2f7d584ad2b: Fix build on macOS 13 / Xcode 14 (mono/mono#21597)
  * mono/mono@03b09960787: Disable a failing test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants