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

Instrumenting a method with non-ASCII characters causes app crash #1982

Closed
nrcventura opened this issue Oct 17, 2023 · 1 comment · Fixed by #2109
Closed

Instrumenting a method with non-ASCII characters causes app crash #1982

nrcventura opened this issue Oct 17, 2023 · 1 comment · Fixed by #2109
Labels
bug Something isn't working

Comments

@nrcventura
Copy link
Member

Description

If an application contains an instrumented method that has non-ascii characters (in the assembly name, namespace, type name, or method name) it can cause an application running on Linux to crash.

The problem appears to be related to the way we log things within the profiler. On Linux, if we attempt to log a message that contains a non-ascii character it causes the app to crash. On Windows, it partially writes the log message (up until the non-ascii character) and then everything continues.

Current workarounds include:

  • Changing the log level so that the profiler doesn't attempt to log non-ascii characters
  • Removing the non-ascii characters from the code

Expected Behavior

The agent should not crash and the method should be instrumented normally. The log messages should support non-ascii characters.

Troubleshooting or NR Diag results

The issue doesn't appear if the log level is reduced to not include the problematic log lines.
The issue doesn't appear on Windows.

Steps to Reproduce

  1. Create a new aspnetcore 7 application that is dockerized and runs in Linux container.
  2. Add a controller endpoint that contains a non-ascii character (such as \u0435)
  3. Enable finest level logs for the agent (to ensure that the profiler attempts to log the non-ascii character).
  4. Send a request to the endpoint with the non-ascii character
  5. Notice that the docker container terminates with a non-successful exit code (which indicates that the app crashed)

Your Environment

This was reproduced in a Linux docker container but it can probably be reproduced on any Linux system. This can probably also be reproduced when using the Transaction or Trace attributes (or xml instrumentation) on a method containing non-ascii characters.

For Maintainers Only or Hero Triaging this bug
Suggested Priority (P1,P2,P3,P4): P4
Suggested T-Shirt size (S, M, L, XL, Unknown): Unknown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
1 participant