Describe the bug
Georgios @geoand has spotted it is not part of the native CI build and fails locally when run in the native mode with:
[quarkus-elytron-security-ldap-integration-test-999-SNAPSHOT-runner:26719] analysis: 27,176.27 ms
Error: Unsupported features in 2 methods
Detailed message:
Error: Class initialization of org.wildfly.security.auth.client.ElytronMessages failed. Use the option --initialize-at-run-time=org.wildfly.security.auth.client.ElytronMessages to explicitly request delayed initialization of this class.
Original exception that caused the problem: java.lang.NoClassDefFoundError: org/wildfly/client/config/ConfigXMLParseException
at java.lang.Class.forName0(Native Method)
Thanks for opening the issue @sberyozkin
@gastaldi agreed to take a look
@hartimcwildfly Hi, FYI George has spent a lot of time on trying to fix it, narrowing it down to the
Fatal error: Failed to leave the current IsolateThread context and to detach the current thread. (code 12)
when running the test in the native mode.
Can you please look into it as we need to decide if the ldap extension can be marked as stable or not
Thanks.
Hi everbody,
thanks for the Info. Honestly I don't think I have enough background info for fixing the bug. I will have a look upcoming week but chances are not very good.
In this case I suggest to remove the extension from the core sources in
master (and for 1.2), since we need to make sure they work in native too.
Em Dom, 19 de jan de 2020 19:28, hartimcwildfly notifications@github.com
escreveu:
Hi everbody,
thanks for the Info. Honestly I don't think I have enough background info
for fixing the bug. I will have a look upcoming week but chances are not
very good.—
You are receiving this because you were assigned.
Reply to this email directly, view it on GitHub
https://github.com/quarkusio/quarkus/issues/6606?email_source=notifications&email_token=AAANG5PVIFWNRLWQF2WQWXLQ6THYDA5CNFSM4KIG75X2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEJK6JTI#issuecomment-576054477,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AAANG5OR4HYBWTW3D7R7TTDQ6THYDANCNFSM4KIG75XQ
.
I agree to removing this extension from the codebase for now since it doesn't work in native
I created #6659 removing the extension from the core. It should be reverted when native tests work
Hi @hartimcwildfly - please investigate the native issue as the extension code looks good to us, but right now the expectations for the new extensions is that they can work in the native image, thanks
I couldn't find a way to debug the native code application and the error message is very meaningless.
Do you guys know how to debug a GraalVM/Quarkus native application?
So I could continue on searching for the bug.
For me it seems like there is some C function call of GraalVM or a linked os library.
I will try to build a native image on/for Windows and see if the same error occurs. Then we maybe know if the problem originates from the GraalVM code or the quarkus code.
But first I have to set up the environment in Windows, I usually work with Ubuntu.
Maybe the new GraalVM version fixes the problem?
It would be very sad not to see the ldap extension in a near future release.
@hartimcwildfly All will be good, I'm sure it will make it to Quarkus, LDAP security support is important.
With a tight schedule, it was not possible to identify a fix, so we had to temporarily drop it. And unfortunately, at this moment of time at least, my own experience with fixing the native issues is limited to adding the classes for reflection or enabling JNI :-)
Can you please share a link to the latest branch with the ldap extension ?
Perhaps some of the colleagues can spot something. @stuartwdouglas, @dmlloyd Hi Stuart, David, does Failed to leave the current IsolateThread context and to detach the current thread. (code 12) ring any bell given #6659 (where we reverted the extension) ?
The branch one commit before the deletion: https://github.com/hartimcwildfly/quarkus/tree/add-elytron-ldap-auth
It's definitely a GraalVM problem relating to a point where Java code calls into C code. It could be a JNI bug (there is at least one bug which can potentially cause stack or heap corruption when handling byte arrays). But without more context (e.g. a stack trace at the point of failure) it's hard to say for sure.
Tested again with Elytron 1.11.2 and GraalVM 20.0. Same error. The ldap elytron code is still compatible with the master branch.
Just reverting the delete commit is easier: hash is ba3eaf8965912dc41a706bed2c530837961e94b0
@hartimcwildfly could you create a new PR again? That would be easier to track and we definitely want this so let's get a new PR and work on fixing that native issue.
Be clear in the description that this needs work on the native side.
Thanks!
Ok, sure! I will do it today.
Magic! Seems like the IT works now also in native image. I did not change anything. Just applied the diff onto the current master. I will open the PR soon.
Ticket can be closed.