-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
A way to disable the optimization for filling the stack traces #3638
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
A way to disable the optimization for filling the stack traces #3638
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your contribution!
I think that PrivateSecurityManagerStackTraceUtil
should always be disabled on Android. Similarly to #3071 I would simply disable the class if the java.vendor
system property contains Android
.
@ppkarwasz , as you mentioned in the other ticket, this PR seems to be on a critical path. But I'm not quite sure I understand what is the blocker here, sorry. What can I do to unblock the progress? |
Currently you are proposing a new My point is that Lines 31 to 44 in 7acbc48
should:
|
Ah, I see your point. Let me quickly draft the solution. |
Okay, so checking the runtime platform appears ugly, because it requires copying the code from Therefore I decided, instead, to go with checking the capability of the instantiated I have completely rewritten the solution, and replaced the PR description. |
8c823ce
to
425a37a
Compare
I think that this should be enough: boolean isAndroid = System.getProperty("java.vendor", "").contains("Android"); If we already know the |
Apparently, we have different approaches. Feel free to close this PR if you don't plan to merge it. After all, it proposes one of many possible ways to fix #3639; you can always draft a better solution yourself, especially that you already have the bigger part of it. |
425a37a
to
40d66ed
Compare
Re-formatted the code to make Spotless happy. Hopefully, this turns the build green. This is the most I can do, I'm sorry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
Thanks! In order to merge the PR:
|
Done
Hmmm, |
I don't see the signatures, I even checked the raw data. git rebase -f -i -S 2.x
git push -f |
…fully) supporting SecurityManager do not poison the stack trace.
cf4a361
to
87a81da
Compare
This helped! |
Thanks a lot! Now the Android support is almost as good as the JVM support! 💯 IIRC there is still one location-related feature that breaks on Android: If you know of a smart way to fix that, let me know. |
This PR addresses issue #3639
This PR allows to disable the optimization for filling the stack traces on platforms where it is not available (e.g. on Android).The developer of the port to such platform shall callPrivateSecurityManagerStackTraceUtil.disable()
before any loggins is printed, e.g. during the configuration phase.For this reason, the visibility ofPrivateSecurityManagerStackTraceUtil
was increased topublic
.The capability of instantiated
PrivateSecurityManager
is checked, and a faulty candidate (e.g. on Android) is rejected, thus rendering the optimization not enabled.