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

Problem with the class loader when calling static class initialisation method #61

Open
xdevroey opened this issue Mar 15, 2019 · 3 comments
Assignees
Labels
botsing This issue is related to botsing core components bug Something isn't working

Comments

@xdevroey
Copy link
Member

xdevroey commented Mar 15, 2019

Running botsing-1.0.3 with ./dependencies containing all the jars of authzforce + all the deps I could get with maven dependency plugin:

java -jar /home/gibello/.m2/repository/eu/stamp-project/botsing-reproduction/1.0.3/botsing-reproduction-1.0.3.jar -crash_log /tmp/ex1.log -target_frame 4 -project_cp ./dependencies/

Produces the following error without stopping the execution:

09:28:06.718 [main] INFO  e.s.b.reproduction.CrashReproduction - Starting the dependency analysis. The number of detected jar files is 119.
Exception in thread "main" java.util.ServiceConfigurationError: org.ow2.authzforce.core.pdp.api.PdpExtension: Provider org.ow2.authzforce.core.pdp.testutil.ext.TestAttributeProvider$Factory not a subtype
	at java.util.ServiceLoader.fail(ServiceLoader.java:239)
	at java.util.ServiceLoader.access$300(ServiceLoader.java:185)
	at java.util.ServiceLoader$LazyIterator.nextService(ServiceLoader.java:376)
	at java.util.ServiceLoader$LazyIterator.access$700(ServiceLoader.java:323)
	at java.util.ServiceLoader$LazyIterator$2.run(ServiceLoader.java:407)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:409)
	at java.util.ServiceLoader$1.next(ServiceLoader.java:480)
	at org.ow2.authzforce.core.pdp.impl.PdpExtensions.<clinit>(PdpExtensions.java)
	at java.lang.Class.forName0(Native Method)
	at java.lang.Class.forName(Class.java:348)
	at org.evosuite.setup.TestClusterUtils.getClass(TestClusterUtils.java:312)
	at org.evosuite.setup.TestClusterGenerator.initializeTargetMethods(TestClusterGenerator.java:663)
	at org.evosuite.setup.TestClusterGenerator.generateCluster(TestClusterGenerator.java:134)
	at org.evosuite.setup.DependencyAnalysis.analyze(DependencyAnalysis.java:118)
	at org.evosuite.setup.DependencyAnalysis.analyzeClass(DependencyAnalysis.java:132)
	at eu.stamp.botsing.reproduction.CrashReproduction.initializeTargetClass(CrashReproduction.java:200)
	at eu.stamp.botsing.reproduction.CrashReproduction.generateCrashReproductionTests(CrashReproduction.java:103)
	at eu.stamp.botsing.reproduction.CrashReproduction.execute(CrashReproduction.java:78)
	at eu.stamp.botsing.Botsing.parseCommandLine(Botsing.java:68)
	at eu.stamp.botsing.Botsing.main(Botsing.java:161)

Originally posted by @gibello in #58 (comment)

@xdevroey
Copy link
Member Author

xdevroey commented Mar 15, 2019

Stack trace for botsing-reproduction is:

java.lang.RuntimeException: Failed to load XML schemas: [classpath:pdp.xsd]
	at org.ow2.authzforce.core.pdp.impl.SchemaHandler.createSchema(SchemaHandler.java:541)
	at org.ow2.authzforce.core.pdp.impl.PdpModelHandler.<init>(PdpModelHandler.java:159)
	at org.ow2.authzforce.core.pdp.impl.PdpEngineConfiguration.getInstance(PdpEngineConfiguration.java:682)
	at org.ow2.authzforce.core.pdp.impl.PdpEngineConfiguration.getInstance(PdpEngineConfiguration.java:699)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:162)

@xdevroey
Copy link
Member Author

Class org.ow2.authzforce.core.pdp.impl.PdpExtensions has a user defined static class initialiser. EvoSuite class loader seems unnable to load the class (?).

@gibello
Copy link

gibello commented Mar 15, 2019

Tried with target_frame 1: works fine with the 1.0.3 command line (at least, generates a test).
But the 1.0.4-SNAPSHOT maven plugin does not seem to work: it does not seem to support multimodule projects ?

mvn eu.stamp-project:botsing-maven:1.0.4-SNAPSHOT:botsing -Dcrash_log=/tmp/ex1.log -Dtarget_frame=1

If run in authzforce/core, an error occurs:
INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.250 s
[INFO] Finished at: 2019-03-15T16:21:57+01:00
[INFO] Final Memory: 16M/208M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal eu.stamp-project:botsing-maven:1.0.4-SNAPSHOT:botsing (default-cli) on project authzforce-ce-core: Error executing Botsing: Classpath element does not exist on disk at: /home/gibello/STAMP/STAMP-project/authzforce/core/target/classes -> [Help 1]

If run inside modules directories (I tried them all), there is no error, but an empty test is generated. I never obtain a test, like with the command line.

@xdevroey xdevroey changed the title Unable to load org.ow2.authzforce.core.pdp.impl.PdpExtensions Problem with the class loader when calling static class initialisation method Mar 15, 2019
@xdevroey xdevroey added the bug Something isn't working label Mar 22, 2019
@xdevroey xdevroey added the botsing This issue is related to botsing core components label Mar 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
botsing This issue is related to botsing core components bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants