Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[mono][loader] Set status on success #80949

Merged
merged 1 commit into from
Jan 21, 2023

Conversation

lambdageek
Copy link
Member

@lambdageek lambdageek commented Jan 20, 2023

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

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
@lambdageek lambdageek marked this pull request as ready for review January 20, 2023 20:26
@ghost ghost assigned lambdageek Jan 20, 2023
@ghost
Copy link

ghost commented Jan 20, 2023

Tagging subscribers to this area:
See info in area-owners.md if you want to be subscribed.

Issue Details

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

Author: lambdageek
Assignees: lambdageek
Labels:

area-AssemblyLoader-mono

Milestone: -

@lambdageek
Copy link
Member Author

/backport to release/7.0

@github-actions
Copy link
Contributor

lambdageek added a commit to lambdageek/mono that referenced this pull request Jan 20, 2023
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
github-actions bot pushed a commit to mono/mono that referenced this pull request Jan 20, 2023
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
@lewing lewing merged commit 0aad863 into dotnet:main Jan 21, 2023
mdh1418 pushed a commit to mdh1418/runtime that referenced this pull request Jan 24, 2023
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
lambdageek added a commit to mono/mono that referenced this pull request Jan 25, 2023
* [mono][loader] Set status on success

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

* [loader] Make mono_image_laod_time_date_stamp a no-op on Android

Avoid an mmap that will fail since Android uses a custom
loader and the assemblies aren't on disk
akoeplinger pushed a commit to mono/mono that referenced this pull request Jan 26, 2023
…#21610)

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`

Avoid an mmap that will fail since Android uses a custom loader and the assemblies aren't on disk


Co-authored-by: Aleksey Kliger <[email protected]>
@ghost ghost locked as resolved and limited conversation to collaborators Feb 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants