or maybe that's the wrong kind of class to be instrumenting, but same idea wherever
^^ better
Thanks, I'm playing around with this now. I'm not entirely sure what this patch is measuring. I changed ms to nanoseconds and also recorded the total nanoseconds.
It looks like it doesn't count the static blocks in the __init.class
, right?
Like here:
Now added the calls to the static block in the init classes:
The total probably isn't correct, I'm counting 18 seconds in total while the entire program takes 4. https://gist.github.com/borkdude/8472055bd5b5e3108b9dbb69debc3137
it was counting the static initializer (clinit), which wraps the calls to the initN methods so you shouldn't count both
yes, I commented that out
you can see the edited patch at the bottom of the gist
Hello all
Any advice for registering BouncyCastle security providers? I’m attempting to use sshj
with HolyLambda. I’m using HL’s `agent/in-context` mechanism to hit some ssh code which just performs an ls
on a target machine. The image builds fine, but I get this at runtime:
Exception in thread "main" com.oracle.svm.core.jdk.UnsupportedFeatureError: Trying to verify a provider that was not registered at build time: BC version 1.68. All providers must be registered and verified in the Native Image builder.
I’ve seen this https://www.graalvm.org/reference-manual/native-image/JCASecurityServices/ that mentions a param called AdditionalSecurityProviders
, but this is reported as not being a valid parameter name:
my option:
-H:AdditionalSecurityProviders=org.bouncycastle.jce.provider.BouncyCastleProvider
Error: Could not find option 'AdditionalSecurityProviders'. Use -H:PrintFlags= to list all available options.
Is there anything else I can try?@chris.lowe.uk You probably need the dev version for this new parameter.
Asking directly in the native image channel on the GraalVM slack may get you better info
@chris.lowe.uk > Can you try putting Provider bc = Security.getProvider("BC"); in a class initialized at build time, so it's detected and included automatically.
How you can do this in Clojure: just make a top level def
with this thing
@borkdude thank you for the suggestions I added this just below the ns definition:
(java.security.Security/addProvider (BouncyCastleProvider.))
(let [bcProvider (java.security.Security/getProvider "BC")]
(println "BC" bcProvider)
(java.security.Security/insertProviderAt bcProvider 1))
And I could see the output from BC during the build:
[output:23] classlist: 6,816.77 ms, 2.04 GB
[output:23] (cap): 592.64 ms, 2.04 GB
[output:23] setup: 2,486.59 ms, 2.04 GB
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See <http://www.slf4j.org/codes.html#StaticLoggerBinder> for further details.
BC #object[org.bouncycastle.jce.provider.BouncyCastleProvider 0x1474f301 BC version 1.68]
[output:23] (clinit): 1,062.73 ms, 3.59 GB
[output:23] (typeflow): 32,105.20 ms, 3.59 GB
But still no joy when executing in AWS:
Exception in thread "main" com.oracle.svm.core.jdk.UnsupportedFeatureError: Trying to verify a provider that was not registered at build time: BC version 1.68. All providers must be registered and verified in the Native Image builder.
I think it's better to ask directly in the native image channel on the GraalVM slack
Will do. Thank you for the advice