Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 156618

Summary: The new AC fails to launch java agents on linux
Product: z_Archived Reporter: Geoff Lambourne <glam001>
Component: TPTPAssignee: Guru Nagarajan <guru.nagarajan>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P1 CC: glam001
Version: unspecifiedKeywords: plan
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard: closed460

Description Geoff Lambourne CLA 2006-09-07 18:27:51 EDT
Steps I took.

1. unzip archive agntctrl.linux_ia32-TPTP-4.2.0.2.zip
2. from bin directory ran ./SetConfig.sh - accepted defaults
3. edited agents/org.eclipse.tptp.TimeColector/agent.xml as described in the
readme.txt
3. edited agents/org.eclipse.tptp.JavaTimeCollector/agent.xml
 set the executable to point to my installation of java
 set the classpath parameter to point to my installation of tptpcore.jar
 (org.eclipse.tptp.platform.execution_4.2.0.v200606140100/tptpcore.jar)
 see below. Note the first Parameter uses the position="replace" option. This was needed otherwise the java execution failed with 
"Exception in thread "main" java.lang.NoClassDefFoundError:"
This is another bug - however using position="replace" was is a workaround.

4. started the server with ./ACServer
5. Ran ./SampleClient to check it worked - it did.
6. From within the eclipse SDK, ran
org.eclipse.tptp.platform.execution.samples.SampleClientAC.java. to check that
it worked. This is a java client talking to a c++ agent. It worked.
7. Modified SampleClientAC.java to talk to JavaTimeCollector instead of
TimeCollector
8. Ran SampleClientAC and the ./ACServer reports an exception. see below

My investigations into the exeception have found...
1. freeEnvironmentStrings is declared in libprocessControlUtil.so.4.2.0
2. libtptpConfig.so.4.2.0 has an undefined reference to it
3. libtptpConfig or libjavaBaseAgent should be linked against libprocessControlUtil to resolve this.


==== ACServer output ======
./ACServer
java.lang.UnsatisfiedLinkError: /space/geoff/downloads/eclipse/3.2/agntctrl/lib/libjavaBaseAgent.so.4.2.0: /space/geoff/downloads/eclipse/3.2/agntctrl/lib/libtptpConfig.so.4: undefined symbol: freeEnvironmentStrings
        at java.lang.ClassLoader$NativeLibrary.load(Native Method)
        at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586)
        at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1511)
        at java.lang.Runtime.loadLibrary0(Runtime.java:788)
        at java.lang.System.loadLibrary(System.java:834)
        at org.eclipse.tptp.platform.execution.datacollection.BaseAgent.<clinit>(BaseAgent.java:98)
org.eclipse.tptp.platform.execution.exceptions.NativeLibraryNotFound: Error: The native library not found.
        at org.eclipse.tptp.platform.execution.datacollection.BaseAgent.init(BaseAgent.java:161)
        at org.eclipse.tptp.platform.execution.samples.TPTPJavaAgent.<init>(TPTPJavaAgent.java:54)
        at org.eclipse.tptp.platform.execution.samples.TPTPJavaAgent.main(TPTPJavaAgent.java:63)
Exception in thread "main" java.lang.UnsatisfiedLinkError: register0
        at org.eclipse.tptp.platform.execution.datacollection.BaseAgent.register0(Native Method)
        at org.eclipse.tptp.platform.execution.datacollection.BaseAgent.register(BaseAgent.java:202)
        at org.eclipse.tptp.platform.execution.samples.TPTPJavaAgent.main(TPTPJavaAgent.java:68)

=== modified agent.xml ===
<?xml version="1.0" encoding="UTF-8" ?> 
<!-- The Java Time Collector will work with the following ServiceConfig 
     settings. (Bugzilla# 115006)
     a) The TransportLayer namedPipeTL element that contains the 
     	named pipe name in the PipeName element must be set to "ramaster".
     b) The TransportLayer sharedMemTL element that contains the shared mem buffer 
     name in the element MemName must be set to "rabuffer" -->
<Agent Name="org.eclipse.tptp.JavaTimeCollector">
	<Interface>org.eclipse.tptp.agent</Interface>
	<Interface>org.eclipse.tptp.collector</Interface>
	<SingleInstance>0</SingleInstance>
	<Bound>0</Bound>
	<MaxControllers>-1</MaxControllers>
	<MaxObservers>-1</MaxObservers>
	<ConfigFile>c:\tptp\agents\org.eclipse.tptp.JavaTimeCollector\config\agentconfig.xml</ConfigFile>
	<LaunchConfiguration>                                
		<launchInfo>
			<Application executable="java" path="%JAVA_PATH%">
				<Parameter position="replace" value="-Djava.library.path=/space/geoff/downloads/eclipse/3.2/agntctrl/lib" />
				<Parameter value="-classpath" />
				<Parameter value="/space/geoff/downloads/eclipse/3.2/extensions/tptp-4.2.0.2-200608021100/eclipse/plugins/org.eclipse.tptp.platform.execution_4.2.0.v200606140100/tptpcore.jar" />
				<Parameter value="org.eclipse.tptp.platform.execution.samples.TPTPJavaAgent"/>
			</Application>
		</launchInfo>
	</LaunchConfiguration>
</Agent>
Comment 1 Geoff Lambourne CLA 2006-09-07 22:33:54 EDT
the following change makes it work for me.

=================
--- AgentBase.make      2006-09-08 12:25:39.000000000 +1000
+++ AgentBase.make.new  2006-09-08 12:25:19.000000000 +1000
@@ -43,7 +43,7 @@
 #   list of additional libraries to be linked with
 #      (separated by blanks)
 #-----------------------------------
-LIBS       :=  uuid dl transportSupport tptpUtils tptpLogUtils tptpConfig pthread xerces-c
+LIBS       :=  uuid dl transportSupport tptpUtils tptpLogUtils tptpConfig processControlUtil pthread xerces-c

 #-----------------------------------
 #   list of additional library directories to search from
Comment 2 Randy D. Smith CLA 2006-09-14 12:55:02 EDT
Guru, The tptpConfig-should-link-in-processControlUtil problem should be assigned to me... I just checked and we put this in on Windows but not on Linux. I can fix that.

But I'm not sure that this is a single bug... is the "replace" stuff a separate bug? That's not mine... but the linking is... so if there is another bug you need to break it out prior to assigning to me.
Comment 3 Guru Nagarajan CLA 2006-11-03 10:58:16 EST
The fix is a simple one will attach it. The code will be part of Head-CVS in 4.4
Comment 4 Guru Nagarajan CLA 2007-04-23 15:24:05 EDT
Resolved
Comment 5 Paul Slauenwhite CLA 2009-06-30 13:44:01 EDT
As of TPTP 4.6.0, TPTP is in maintenance mode and focusing on improving quality by resolving relevant enhancements/defects and increasing test coverage through test creation, automation, Build Verification Tests (BVTs), and expanded run-time execution. As part of the TPTP Bugzilla housecleaning process (see http://wiki.eclipse.org/Bugzilla_Housecleaning_Processes), this enhancement/defect is verified/closed by the Project Lead since this enhancement/defect has been resolved and unverified for more than 1 year and considered to be fixed. If this enhancement/defect is still unresolved and reproducible in the latest TPTP release (http://www.eclipse.org/tptp/home/downloads/), please re-open.
Comment 6 Paul Slauenwhite CLA 2009-06-30 14:14:53 EDT
As of TPTP 4.6.0, TPTP is in maintenance mode and focusing on improving quality by resolving relevant enhancements/defects and increasing test coverage through test creation, automation, Build Verification Tests (BVTs), and expanded run-time execution. As part of the TPTP Bugzilla housecleaning process (see http://wiki.eclipse.org/Bugzilla_Housecleaning_Processes), this enhancement/defect is verified/closed by the Project Lead since this enhancement/defect has been resolved and unverified for more than 1 year and considered to be fixed. If this enhancement/defect is still unresolved and reproducible in the latest TPTP release (http://www.eclipse.org/tptp/home/downloads/), please re-open.