Home » Language IDEs » Objectteams » Classpath problems when running OTJ test suite
Classpath problems when running OTJ test suite [message #1847177] |
Mon, 18 October 2021 09:17  |
Lars Schütze Messages: 16 Registered: June 2018 |
Junior Member |
|
|
Hi Stephan, hi everyone,
I am trying to execute the OTJ tests with my changes to further explore the implementation of other features. I run AllTests in tests.otjld as JUnit Plugin Tests.
However, I have a problem with class discovery (ClassNotFoundException thrown from BundleLoader.findClass) which often points to problems with visibility of bundles and packages in OSGi.
Caused by: java.lang.ClassNotFoundException: org.eclipse.objectteams.otredyn.runtime.dynamic.linker.TeamsAndCallinIdsBootstrap cannot be found by org.eclipse.ui.workbench_3.119.0.v20200521-1247
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:516)
My code changes directly happened in CreateCallAllBindingsCallInOrgMethod#generateInvocation of OTREDyn where I construct an invokedynamic callsite with ASM.
private static final Handle teamsAndIdsBootstrapHandle = new Handle(Opcodes.H_INVOKESTATIC,
ClassNames.TEAMS_AND_IDS_BOOTSTRAP_SLASH, ConstantMembers.teamsAndCallinIdsBootstrap.getName(),
ConstantMembers.teamsAndCallinIdsBootstrap.getSignature(), false);
and is put as an invokedynamic with
newInstructions.add(new InvokeDynamicInsnNode("getTeamsAndCallinIds",
ConstantMembers.getTeamsAndCallinIds.getSignature(), teamsAndIdsBootstrapHandle, joinpointId));
addLineNumber(newInstructions, SMAPConstants.STEP_OVER_LINENUMBER);
This also works without OSGi when exporting OTJ as JAR files.
So I suspect that either I need to have the OTREDyn packages being imported into base classes (is that done somewhere?) or the ASM library needs to be used differently in OSGi environment?
Do you by chance have an idea? I already looked into the otequinox plugin but could not find something which I would relate to my problems. I also exported the packages I added to otredyn and imported these from otequinox.
Thank you very much!
[Updated on: Mon, 18 October 2021 09:18] Report message to a moderator
|
|
| | |
Re: Classpath problems when running OTJ test suite [message #1847552 is a reply to message #1847526] |
Mon, 01 November 2021 10:57   |
Lars Schütze Messages: 16 Registered: June 2018 |
Junior Member |
|
|
Quote:let me ask if you succeeded to run the desired tests?
In order to run the tests I already need some features I did not implement, yet. So I am implementing these features now and move forward step by step.
Quote:I just wonder, how OT/Equinox enters the picture for otjld.AllTests: the actual tests are plain OT/J, no OSGi involved.
I start the tests with Run As -> JUnit Plugin Tests. Otherwise, how would I be able to get all my changes in the compiler etc. applied? Can I run the tests from the command line with the JARs? That would help me a lot!
Otherwise, as a long term goal, I would like to be able to execute that null-analysis you had implemented with ObjectTeams with my changes and see if there is a speed-up :-)
Quote:So it appears you are using a modified otredyn already for launching the test plugin?
Yes, I started directly modifying otredyn for my prototype.
[Updated on: Mon, 01 November 2021 15:33] Report message to a moderator
|
|
| | | |
Re: Classpath problems when running OTJ test suite [message #1847961 is a reply to message #1847898] |
Mon, 15 November 2021 11:09   |
Lars Schütze Messages: 16 Registered: June 2018 |
Junior Member |
|
|
It seems like it currently hangs in the TestVerifier. After calling ::runTest it calls AbstractOTJLDTest$OTTestVerifier.verifyClass and then AbstractOTJLDTest$OTTestVerifier.launchVerifier where it waits for server.accept(). Looks like it stalls there ...
That is the vm arguments it constructed (I changed it to not use JavacTestOptions.DEFAULT but added some necessary module visibility commands):
[-javaagent:/Users/lschuetze/Development/repos/objectteams-poly/plugins/org.eclipse.objectteams.otdt/lib/otredyn_agent.jar, -Xbootclasspath/a:/Users/lschuetze/Development/repos/objectteams-poly/plugins/org.eclipse.objectteams.otdt/lib/otre_min.jar, -Dot.dump=1, -Dobjectteams.otdre.verify=1, --add-reads, java.base=ALL-UNNAMED, --add-reads, jdk.net=ALL-UNNAMED, --add-opens, java.base/java.lang=ALL-UNNAMED]
I am a little bit concerned about the commas between the --add-opens and the declared modules as they go together.
[Updated on: Mon, 15 November 2021 11:13] Report message to a moderator
|
|
|
Re: Classpath problems when running OTJ test suite [message #1848030 is a reply to message #1847961] |
Wed, 17 November 2021 17:40   |
Stephan Herrmann Messages: 1853 Registered: July 2009 |
Senior Member |
|
|
Quote: I am a little bit concerned about the commas between the --add-opens and the declared modules as they go together.
Commas are OK, this is just the rendering of a string array, where arguments have been split at what would be whitespace in a regular command line.
Quote:AbstractOTJLDTest$OTTestVerifier.launchVerifier where it waits for server.accept(). Looks like it stalls there ...
This is where it get's tricky to debug, since we are (hopefully) launching a second vm for executing a test program. Some ideas for debugging:
- when it hangs, do you see a new JVM process at the operating system level? If so, can you use jstack to check what it's doing, when it hangs?
- the remote end executes a class generated on the fly from TestVerifier.getVerifyTestsCode(). So if that part doesn't behave, that's where you may want to add some logging, but beware that out and err are redirected: instead of printing on the console any logging will be received in AbstractRegressionTest.runTest(), but then it will be reported as unexpected program output :)
[Updated on: Wed, 17 November 2021 17:50] Report message to a moderator
|
|
|
Re: Classpath problems when running OTJ test suite [message #1848047 is a reply to message #1848030] |
Thu, 18 November 2021 12:55   |
Lars Schütze Messages: 16 Registered: June 2018 |
Junior Member |
|
|
Okay, So I do not get to the point where I could attach to the launched VM. In LocalVMLauncher::execCommandLine() it executed the generated command line:
[/Library/Java/JavaVirtualMachines/jdk-14.0.2.jdk/Contents/Home/bin/java, -verify, -javaagent:/Users/lschuetze/Development/repos/objectteams-poly/plugins/org.eclipse.objectteams.otdt/lib/otredyn_agent.jar, -Xbootclasspath/a:/Users/lschuetze/Development/repos/objectteams-poly/plugins/org.eclipse.objectteams.otdt/lib/otre_min.jar, -Dot.dump=1, -Dobjectteams.otdre.verify=1, --add-reads, java.base=ALL-UNNAMED, --add-reads, jdk.net=ALL-UNNAMED, --add-opens, java.base/java.lang=ALL-UNNAMED, --add-reads, jdk.dynalink=ALL-UNNAMED, --add-reads, jdk.localedata=ALL-UNNAMED, -Xverify:all, -XX:+UnlockExperimentalVMOptions, -Xbootclasspath/a:/Library/Java/JavaVirtualMachines/jdk-14.0.2.jdk/Contents/Home/jre/lib/rt.jar:, -classpath, /Library/Java/JavaVirtualMachines/jdk-14.0.2.jdk/Contents/Home/lib/jrt-fs.jar:/private/var/folders/28/fqt91mbn0rs_zf8dxkqw4pbr0000gn/T/comptest/run.1637239763023/regression:/Users/lschuetze/.p2/pool/plugins/org.eclipse.objectteams.runtime_2.8.1.202006091155.jar:/Users/lschuetze/.p2/pool/plugins/org.eclipse.objectteams.otredyn_1.4.1.202006091155.jar:/Users/lschuetze/Development/committers-2020-06/.metadata/.plugins/org.eclipse.pde.core/pde-junit/org.eclipse.osgi/523/0/.cp/:/Users/lschuetze/Development/committers-2020-06/.metadata/.plugins/org.eclipse.pde.core/pde-junit/org.eclipse.osgi/528/0/.cp/:/Users/lschuetze/Development/committers-2020-06/.metadata/.plugins/org.eclipse.pde.core/pde-junit/org.eclipse.osgi/526/0/.cp/:/Users/lschuetze/Development/committers-2020-06/.metadata/.plugins/org.eclipse.pde.core/pde-junit/org.eclipse.osgi/530/0/.cp/:/Users/lschuetze/Development/committers-2020-06/.metadata/.plugins/org.eclipse.pde.core/pde-junit/org.eclipse.osgi/525/0/.cp/:/private/var/folders/28/fqt91mbn0rs_zf8dxkqw4pbr0000gn/T/comptest/run.1637239763023/verifier:, org.eclipse.jdt.core.tests.util.VerifyTests, 52362]
It creates a process which immediately returns with error code 1. Process[pid=44243, exitValue=1]
As you can see from the generated command line I had to programmatically add my extra VM Arguments (i.e., dynalink) that I put into the run configuration inside Eclipse because they had not been taken up. I added them to AbstractOTJLDTest$OTTestVerifier::getOTVMArgs() by hand.
The only thing that I see is that the generated otredyn.jar is not taken up from org.eclipse.objectteams.otdt/lib/otredyn.jar but from the host Eclipse /Users/lschuetze/.p2/pool/plugins/org.eclipse.objectteams.otredyn_1.4.1.202006091155.jar
And then it tries to connect to that process which leads to the deadlock.
Thanks for all your help so far!
[Updated on: Thu, 18 November 2021 13:00] Report message to a moderator
|
|
| | | |
Goto Forum:
Current Time: Fri Dec 01 04:48:01 GMT 2023
Powered by FUDForum. Page generated in 0.03201 seconds
|