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

Don't add debug config if it's already present #274

Closed
dmikusa opened this issue Apr 5, 2023 · 0 comments · Fixed by #280
Closed

Don't add debug config if it's already present #274

dmikusa opened this issue Apr 5, 2023 · 0 comments · Fixed by #280
Assignees
Labels
hacktoberfest Hacktoberfest eligible note:good-first-issue A good first issue to get started with note:ideal-for-contribution An issue that a contributor can help us with type:bug A general bug

Comments

@dmikusa
Copy link
Contributor

dmikusa commented Apr 5, 2023

Expected Behavior

Current Behavior

Steps to Reproduce

If you set JAVA_TOOL_OPTIONS to contain Java debug info, like -agentlib:jdwp=transport=dt_socket,server=y,address=%s,suspend=%s and then set BPL_DEBUG_ENABLED=true. You'll end up with debug setting specified twice and the JVM will fail to start. The buildpack helper should not add them if it already exists.

Possible Solution

The buildpack will need to look at JAVA_TOOL_OPTIONS and do a fuzzy search for -agentlib:jdwp=transport=dt_socket,server=y,address=%s,suspend=%s. Possibly by looking for an arg that starts with -agentlib:jdwp. If present, log a message and indicate that it was not added a second time. If not present, add it.

This needs to be fixed in both Java 8 & Java 9+ helpers.

Motivations

This can also impact cases where you use one process type through /cnb/process/* to invoke a process type contributed by a libjvm powered buildpack. In this case, the launcher will run twice and can cause the JVM agent properties to be added multiple times.

@dmikusa dmikusa added type:bug A general bug note:good-first-issue A good first issue to get started with note:ideal-for-contribution An issue that a contributor can help us with labels Apr 5, 2023
@anthonydahanne anthonydahanne added the hacktoberfest Hacktoberfest eligible label Oct 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hacktoberfest Hacktoberfest eligible note:good-first-issue A good first issue to get started with note:ideal-for-contribution An issue that a contributor can help us with type:bug A general bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants