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

NR-84187 Fix ClassCircularityError when agent attaches #1137

Merged
merged 1 commit into from
Jan 31, 2023

Conversation

sdaubin
Copy link
Contributor

@sdaubin sdaubin commented Jan 30, 2023

Overview

I have an app that crashes when using nri-lsi-java to attach the java agent. Here's how to reproduce this: https://source.datanerd.us/saxon/java-agent-crash

Here's the exception:

at java.base/java.text.FieldPosition.getFieldDelegate(FieldPosition.java:215)at java.base/java.text.DecimalFormat.format(DecimalFormat.java:714)at java.base/java.text.DecimalFormat.format(DecimalFormat.java:507)at ```

We can avoid the error by loading `FieldPosition$Delegate` before we modify class loaders.

### Related Github Issue
[Include a link to the related GitHub issue, if applicable](https://issues.newrelic.com/browse/NR-84187)

### Testing
You can verify the fix with https://source.datanerd.us/saxon/java-agent-crash

### Checks

[ ] Are your contributions backwards compatible with relevant frameworks and APIs?
[ ] Does your code contain any breaking changes? Please describe. 
[ ] Does your code introduce any new dependencies? Please describe.

@jasonjkeller jasonjkeller merged commit 635924a into newrelic:main Jan 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants