Skip to content

Enable CoreCLR init failure logging in single exe host - #80104

Merged
janvorli merged 2 commits into
dotnet:mainfrom
janvorli:add-coreclr-initialization-failure-logging-to-single-exe
Jan 4, 2023
Merged

Enable CoreCLR init failure logging in single exe host#80104
janvorli merged 2 commits into
dotnet:mainfrom
janvorli:add-coreclr-initialization-failure-logging-to-single-exe

Conversation

@janvorli

Copy link
Copy Markdown
Member

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.
@janvorlijanvorli added this to the 8.0.0 milestone Jan 2, 2023
@janvorlijanvorli self-assigned this Jan 2, 2023
@ghost

ghost commented Jan 2, 2023

Copy link
Copy Markdown

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-analysisbuild-analysisBot mentioned this pull request Jan 3, 2023

@vitek-karasvitek-karas left a comment

Copy link
Copy Markdown
Member

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.

#include <pal.h>
#include <trace.h>

typedef void (*coreclr_error_writer_callback_fn) (const char *message);

Copy link
Copy Markdown
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
Copy Markdown
MemberAuthor

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
Copy Markdown
MemberAuthor

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

@janvorli
janvorli merged commit 6c0c96c into dotnet:mainJan 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.
@ghostghost locked as resolved and limited conversation to collaborators Feb 3, 2023
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@janvorli@vitek-karas