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

Enable CoreCLR init failure logging in single exe host #80104

Conversation

janvorli
Copy link
Member

@janvorli janvorli commented Jan 2, 2023

When adding the CoreCLR initialization failure logging recently, I have missed the fact that there are two versions of the coreclr_resolver.cpp. One for standalone host that I have added support for, but also for linking into single exe.

This change adds the missing support to the single exe host.

When adding the CoreCLR initialization failure logging recently, I have
missed the fact that there are two versions of the coreclr_resolver.cpp.
One for standalone host that I have added support for, but also for linking
into single exe.

This change adds the missing support to the single exe host.
@janvorli janvorli added this to the 8.0.0 milestone Jan 2, 2023
@janvorli janvorli self-assigned this Jan 2, 2023
@ghost
Copy link

ghost commented Jan 2, 2023

Tagging subscribers to this area: @vitek-karas, @agocke, @VSadov
See info in area-owners.md if you want to be subscribed.

Issue Details

When adding the CoreCLR initialization failure logging recently, I have missed the fact that there are two versions of the coreclr_resolver.cpp. One for standalone host that I have added support for, but also for linking into single exe.

This change adds the missing support to the single exe host.

Author: janvorli
Assignees: janvorli
Labels:

area-Host

Milestone: 8.0.0

@build-analysis build-analysis bot mentioned this pull request Jan 3, 2023
Copy link
Member

@vitek-karas vitek-karas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good - I would only remove the unnecessary typedef.

@@ -8,6 +8,8 @@
#include <pal.h>
#include <trace.h>

typedef void (*coreclr_error_writer_callback_fn) (const char *message);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is necessary - the same typedef already exists in coreclr_resolver.h which is included.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed in the last commit.

@janvorli
Copy link
Member Author

janvorli commented Jan 4, 2023

The CI failure is a known issue unrelated to this change.

@janvorli janvorli merged commit 6c0c96c into dotnet:main Jan 4, 2023
@janvorli janvorli deleted the add-coreclr-initialization-failure-logging-to-single-exe branch January 4, 2023 13:36
janvorli added a commit to janvorli/runtime that referenced this pull request Jan 6, 2023
Port of dotnet#78484, dotnet#78790, dotnet#80104 and dotnet#80294
This change adds detecting and logging of failures during coreclr
initialization. For logging, it uses a new host API
`coreclr_set_error_writer` to register a callback to report the errors
to the host. The hosts have support for optional usage of this API so
that they can work with older runtime versions as well.

The logging checks and reports failures with:
* System.Private.CoreLib.dll
* GC initialization
* JIT initialization
* libSystem.Native.so/dylib on Unix

The logging messages should allow customers to self-diagnose the issues
causing the failures.

This change also adds backport of support for standalone GC back compatibility that
is a prerequisite for it.
janvorli added a commit to janvorli/runtime that referenced this pull request Jan 17, 2023
Port of dotnet#78484, dotnet#78790, dotnet#80104 and dotnet#80294
This change adds detecting and logging of failures during coreclr
initialization. For logging, it uses a new host API
`coreclr_set_error_writer` to register a callback to report the errors
to the host. The hosts have support for optional usage of this API so
that they can work with older runtime versions as well.

The logging checks and reports failures with:
* System.Private.CoreLib.dll
* GC initialization
* JIT initialization
* libSystem.Native.so/dylib on Unix

The logging messages should allow customers to self-diagnose the issues
causing the failures.

This change also adds backport of support for standalone GC back compatibility that
is a prerequisite for it.
@ghost ghost locked as resolved and limited conversation to collaborators Feb 3, 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.

2 participants