Main /
HLAThis page is no longer maintained, see https://www.icyphy.org/hla/wiki/Main/HomePage Internal Resources
NotesHLA Test Case Failure
The test has been failing for some time on sisyphus. /home/hudson/jobs/ptII/workspace/ptolemy/apps/hlacerti/lib/test/HLATest.tcl testDefs.tcl: setting time out to 7200 seconds at Thu Jan 29 20:47:38 PST 2015 HLATest.tcl: Be sure to source certi/share/scripts/myCERTI_env.sh sleeping 1 seconds: sleeping 5 seconds: 339 ms. Memory: 310272K Free: 296450K (96%) 105 ms. Memory: 310272K Free: 296450K (96%) ==== $PTII/ptolemy/apps/hlacerti/lib/test/HLATest.tcl: HLATest-1.0 Run the HLA MultiDataTypes ==== Contents of test case: # Success is when the Test actor in the consumer gets all of its values. set consumerListenerOutput [java::new java.io.ByteArrayOutputStream] set consumer [runModel MultiDataTypesConsumer.xml $consumerListenerOutput] sleep 1 false set producerListenerOutput [java::new java.io.ByteArrayOutputStream] set producer [runModel MultiDataTypesProducer.xml $producerListenerOutput] # Return something useful as another check sleep 5 false list [$consumer getFullName] [$producer getFullName] [$consumerListenerOutput toString] [$producerListenerOutput toString] ==== Result was: .MultiDataTypesConsumer .MultiDataTypesProducer {preinitializing resolving types initializing } {preinitializing resolving types initializing } ---- Result should have been: .MultiDataTypesConsumer .MultiDataTypesProducer {preinitializing resolving types initializing } {preinitializing resolving types initializing executing number 1 } @@@@@ known results is more than 7 lines long, so we run diff 7d6 < executing number 1 @@@@@ Done running diffText ---- HLATest-1.0 FAILED Running the test under Mac OS passes some times. If > Execution error. > ptolemy.kernel.util.IllegalActionException: RTIinternalError > in .MultiDataTypesProducer.producer > Because: > Connection to RTIA failed. null It turns out that there were two errors
Building CERTI on the Mac1/30/2015 See cd ~/src wget http://download.savannah.gnu.org/releases/certi/CERTI-3.4.2-Source.tar.gz tar -zxf CERTI-3.4.2-Source.tar.gz cd CERTI-3.4.2-Source mkdir build_certi cd build_certi cmake -DCMAKE_INSTALL_PREFIX=/usr/local/certi-3.4.2 -DCERTI_USE_NULL_PRIME_MESSAGE_PROTOCOL=ON ../ make Problems building CERTI-3.4.2 on the MacProblem: implicit instantiation of undefined template 'std::auto_ptr<rti1516::LogicalTime>'[ 71%] Building CXX object libRTI/CMakeFiles/FedTime1516.dir/RTI1516fedTime.cpp.o /Users/cxh/src/CERTI-3.4.2-Source/libRTI/RTI1516fedTime.cpp:802:24: error: implicit instantiation of undefined template 'std::auto_ptr<rti1516::LogicalTime>' RTI1516fedTimeFactory::makeLogicalTime() ^ /Users/cxh/src/CERTI-3.4.2-Source/include/RTI/certiLogicalTimeFactory.h:36:28: note: template is declared here template <class T> class auto_ptr; ^ /Users/cxh/src/CERTI-3.4.2-Source/libRTI/RTI1516fedTime.cpp:807:9: error: implicit instantiation of undefined template 'std::auto_ptr<rti1516::LogicalTime>' return std::auto_ptr< rti1516::LogicalTime >(fedTime);
Solution: As root: cd /opt/local/bin ln -s g++-mp-4.9 c++ CERTI-3.4.2: fatal error: X11/bitmaps/cntr_ptr: No such file or directory[ 84%] Building CXX object test/libgraphc/CMakeFiles/graph.dir/graph_c.cc.o /Users/cxh/src/CERTI-3.4.2-Source/test/libgraphc/graph_c.cc:34:32: fatal error: X11/bitmaps/cntr_ptr: No such file or directory #include <X11/bitmaps/cntr_ptr> Solution: As root rtig: Bind Address already in usebash-3.2$ rtig CERTI RTIG 3.4.2 - Copyright 2002-2008 ONERA This is free software ; see the source for copying conditions. There is NO warranty ; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. SocketUDP: Bind: Address already in use CERTI RTIG aborted with a Network Error: [Cannot bind UDP Socket]. CERTI RTIG exiting. Solution: Use ps to find the other rtig process and kill it. Or export CERTI_UDP_PORT=1235 export CERTI_TCP_PORT=1237 export CERTI_HOST=127.0.0.1 rtig -l 127.0.0.1 FIXME: The CERTI code should prompt the user to use -l if there is an error. Running the Billiard demortig & In two separate windows: billard -f Test.fed -F Test.xml -n1 and billard -f Test.fed -F Test.xml -n2 An X11 window should appear. Problems under El CapitanAfter installing Ptolemy and CERTI in El Captain using the instructions in the demos using HLA/CERTI in
CertRtig: the os.name property is: Mac OS X CertiRtig: .fed1.HlaManager: About to invoke rtig: command: [/bin/sh, -c, /Users/cxh/pthla/certi-tools/bin/rtig, CoSimu.fed] environment: [DYLD_LIBRARY_PATH=/Users/cxh/pthla/certi-tools/lib] directory: /Users/cxh/pthla/ptII/org/hlacerti/demo/Billard _read(): dyld: Library not loaded: libCERTId.3.dylib Referenced from: /Users/cxh/pthla/certi-tools/bin/rtig Reason: image not found For other errors, please read section Appendix B (Error messages) of What was happening was that running the model as a non-root user was failing, but running the model as root would work. Even more interestingly, if the rtig process was run as a non-root user, then running the model as root would work, but as non-root would not. This probably has to do with SIP (details below). How to install CERTI under El Capitan:
If there are problems running the Ptolemy HLA demos under El Capitan
Notes about various efforts to get CERTI to work under El CapitanBelow are notes about various things that were tried. System Integrity Protection (SIP)System Integrity Protection (SIP) was introduced in El Capitan in an effort to increase the security of the Mac OS. Summary: To get CERTI to work, links need to be made for the shared libraries. It could be that installing CERTI in /usr/local would do the trick, see https://support.apple.com/en-us/HT204899: "Paths and applications that third-party apps and installers can write to include:
" BTW - For one user, the problem was not just SIP, but I also had multiple versions of CERTI installed.
One way to check is to run: $PTII/bin/vergil $PTII/org/hlacerti/demo/Billard/Billard.xml & Then start the model. Then check for rtig processes: bash-3.2$ ps auxgww | grep rtig cxh 2430 0.0 0.0 2444056 800 s007 S+ 4:30PM 0:00.00 grep rtig cxh 2423 0.0 0.0 2505276 2704 s007 S 4:23PM 0:00.98 /Users/cxh/pthla/certi-tools/bin/rtig bash-3.2$ Note that the rtig processes is running for me. Also, we can use bash-3.2$ telnet localhost 60400 Trying ::1... telnet: connect to address ::1: Connection refused Trying fe80::1... telnet: connect to address fe80::1: Connection refused Trying 127.0.0.1... Connected to localhost. Escape character is '^]'. ? ^] telnet> quit The fact that there is a process at port 60400 indicates that the process is running and that SIP is not totally blocking execution. As root, running the demo works: On a machine where SIP is Enabled (to check reboot, hold Command-R, run sh-3.2# bash bash-3.2# source ~cxh/pthla/certi-tools/share/scripts/myCERTI_env.sh CERTI version <3.5.1> Current machine architecture is <x86_64>. ========================================================== ** WARNING ** We hope you have made source myCERTI.sh ** ------ If yes your variables for CERTI are now : CERTI_HOST = localhost CERTI_HOME = /Users/cxh/pthla/certi-tools CERTI_FOM_PATH = /Users/cxh/pthla/certi-tools/share/federations PATH = /opt/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:\ /opt/X11/bin:/usr/texbin:/Users/cxh/pthla/certi-tools/share/scripts:/Users/cxh/\ pthla/certi-tools/bin:/opt/local/bin:/opt/local/sbin:/usr/local/certi-3.4.3/sha\ re/scripts:/usr/local/certi-3.4.3/bin:/Applications/MatlabR2015a/MATLAB_R2015a.\ app/bin:/Library/TeX/Root/bin/x86_64-darwin LD_LIBRARY_PATH = /Users/cxh/pthla/certi-tools/lib: DYLD_LIBRARY_PATH = /Users/cxh/pthla/certi-tools/lib: bash-3.2# export PTII=~cxh/ptII bash-3.2# $PTII/bin/vergil $PTII/org/hlacerti/demo/Billard/Billard.xml CertRtig: the os.name property is: Mac OS X CertiRtig: .TwoBilliardBalls.HlaManager: About to invoke rtig: command: [/bin/sh, -c, /Users/cxh/pthla/certi-tools/bin/rtig, Test.fed] environment: [DYLD_LIBRARY_PATH=/Users/cxh/pthla/certi-tools/lib] directory: /Users/cxh/ptII/org/hlacerti/demo/Billard CertRtig: the os.name property is: Mac OS X CertiRtig: .PoolTable2.display: About to invoke rtig: command: [/bin/sh, -c, /Users/cxh/pthla/certi-tools/bin/rtig, Test.fed] environment: [DYLD_LIBRARY_PATH=/Users/cxh/pthla/certi-tools/lib] directory: /Users/cxh/ptII/org/hlacerti/demo/Billard CertiRtig: .PoolTable2.display: About to terminate rtig. 7522 ms. Memory: 418304K Free: 95911K (23%) 6423 ms. Memory: 418304K Free: 95911K (23%) 7762 ms. Memory: 418304K Free: 95911K (23%) The results: However, running not as root with the above commands fails, the Ptolemy stack trace is: tolemy.kernel.util.IllegalActionException: Execution failed. in .Billard.PoolTable Because: RTIinternalError. If the error is "Connection to RTIA failed", then the problem is likely that the rtig binary could not be started by CertRtig. One way to debug this is to set the various environment variables by sourcing certi/share/scripts/myCERTI_env.sh, then invoking rtig on the .fed file then rerunning the model. in .PoolTable2.display Because: Connection to RTIA failed. null at ptolemy.actor.lib.hoc.ModelReference.fire(ModelReference.java:588) at ptolemy.vergil.actor.lib.VisualModelReference.fire(VisualModelReference.java:388) at ptolemy.actor.AtomicActor.iterate(AtomicActor.java:497) at ptolemy.actor.Director.fire(Director.java:360) at ptolemy.actor.CompositeActor.fire(CompositeActor.java:454) at ptolemy.actor.Manager.iterate(Manager.java:841) at ptolemy.actor.Manager.execute(Manager.java:367) at ptolemy.actor.Manager.run(Manager.java:1252) at ptolemy.actor.Manager$PtolemyRunThread.run(Manager.java:1903) Caused by: ptolemy.kernel.util.IllegalActionException: RTIinternalError. If the error is "Connection to RTIA failed", then the problem is likely that the rtig binary could not be started by CertRtig. One way to debug this is to set the various environment variables by sourcing certi/share/scripts/myCERTI_env.sh, then invoking rtig on the .fed file then rerunning the model. in .PoolTable2.display Because: Connection to RTIA failed. null at org.hlacerti.lib.HlaManager.initialize(HlaManager.java:580) at ptolemy.actor.CompositeActor.initialize(CompositeActor.java:906) at ptolemy.actor.Manager.initialize(Manager.java:715) at ptolemy.actor.Manager.execute(Manager.java:354) at ptolemy.actor.lib.hoc.ModelReference.fire(ModelReference.java:586) ... 8 more Caused by: hla.rti.RTIinternalError: Connection to RTIA failed. null serial:0 at certi.rti.impl.CertiRtiAmbassador.<init>(Unknown Source) at certi.rti.jlc.CertiRtiFactory.createRtiAmbassador(Unknown Source) at org.hlacerti.lib.HlaManager.initialize(HlaManager.java:578) ... 12 more Caused by: ptolemy.kernel.util.IllegalActionException: RTIinternalError. If the error is "Connection to RTIA failed", then the problem is likely that the rtig binary could not be started by CertRtig. One way to debug this is to set the various environment variables by sourcing certi/share/scripts/myCERTI_env.sh, then invoking rtig on the .fed file then rerunning the model. in .PoolTable2.display Because: Connection to RTIA failed. null at org.hlacerti.lib.HlaManager.initialize(HlaManager.java:580) at ptolemy.actor.CompositeActor.initialize(CompositeActor.java:906) at ptolemy.actor.Manager.initialize(Manager.java:715) at ptolemy.actor.Manager.execute(Manager.java:354) at ptolemy.actor.lib.hoc.ModelReference.fire(ModelReference.java:586) at ptolemy.vergil.actor.lib.VisualModelReference.fire(VisualModelReference.java:388) at ptolemy.actor.AtomicActor.iterate(AtomicActor.java:497) at ptolemy.actor.Director.fire(Director.java:360) at ptolemy.actor.CompositeActor.fire(CompositeActor.java:454) at ptolemy.actor.Manager.iterate(Manager.java:841) at ptolemy.actor.Manager.execute(Manager.java:367) at ptolemy.actor.Manager.run(Manager.java:1252) at ptolemy.actor.Manager$PtolemyRunThread.run(Manager.java:1903) Caused by: hla.rti.RTIinternalError: Connection to RTIA failed. null serial:0 at certi.rti.impl.CertiRtiAmbassador.<init>(Unknown Source) at certi.rti.jlc.CertiRtiFactory.createRtiAmbassador(Unknown Source) at org.hlacerti.lib.HlaManager.initialize(HlaManager.java:578) ... 12 more Caused by: hla.rti.RTIinternalError: Connection to RTIA failed. null serial:0 at certi.rti.impl.CertiRtiAmbassador.<init>(Unknown Source) at certi.rti.jlc.CertiRtiFactory.createRtiAmbassador(Unknown Source) at org.hlacerti.lib.HlaManager.initialize(HlaManager.java:578) at ptolemy.actor.CompositeActor.initialize(CompositeActor.java:906) at ptolemy.actor.Manager.initialize(Manager.java:715) at ptolemy.actor.Manager.execute(Manager.java:354) at ptolemy.actor.lib.hoc.ModelReference.fire(ModelReference.java:586) at ptolemy.vergil.actor.lib.VisualModelReference.fire(VisualModelReference.java:388) at ptolemy.actor.AtomicActor.iterate(AtomicActor.java:497) at ptolemy.actor.Director.fire(Director.java:360) at ptolemy.actor.CompositeActor.fire(CompositeActor.java:454) at ptolemy.actor.Manager.iterate(Manager.java:841) at ptolemy.actor.Manager.execute(Manager.java:367) at ptolemy.actor.Manager.run(Manager.java:1252) at ptolemy.actor.Manager$PtolemyRunThread.run(Manager.java:1903) As non-root, the bash-3.2$ cd $PTII/org/hlacerti/demo/Billard bash-3.2$ /bin/sh -c /Users/cxh/pthla/certi-tools/bin/rtig Test.fed CERTI RTIG 3.5.1 - Copyright 2002-2008 ONERA This is free software ; see the source for copying conditions. There is NO warranty ; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. CERTI RTIG up and running ... C-c C-cCERTI RTIG exiting. bash-3.2$ Note that bash-3.2$ otool -L /Users/cxh/pthla/certi-tools/bin/rtig /Users/cxh/pthla/certi-tools/bin/rtig: libCERTId.3.dylib (compatibility version 3.0.0, current version 3.5.1) /opt/local/lib/libxml2.2.dylib (compatibility version 12.0.0, current version 12.2.0) libHLAd.3.dylib (compatibility version 3.0.0, current version 3.5.1) /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 120.1.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1226.10.1) bash-3.2$ So, the problem is running Java and then trying to run Starting java.library.path = /Users/cxh/Library/Java/Extensions:/Library/Java/Extensions:/Network/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java:.:/Users/cxh/ptII/lib Note that the value of $DYLD_LIBRARY_PATH is ignored, but that Running rtig as non-root and Ptolemy as root worksHowever, it seems that running rtig from the command line as non-root works, if the Java process as run as root. To replicate: Edit As non-root: bash-3.2$ cd $PTII/org/hlacerti/demo/Billard bash-3.2$ ls Autorun.xml PoolTable2.xml Synchro.xml Billard.xml PoolTable3.xml Test.fed DisplayWithFedName.xml README.txt TwoBilliardBalls.xml DisplayWithoutPort.xml RTIG.log makefile FederationBillard.xml SingleBillardBall.xml bash-3.2$ /Users/cxh/pthla/certi-tools/bin/rtig Test.fed CERTI RTIG 3.5.1 - Copyright 2002-2008 ONERA This is free software ; see the source for copying conditions. There is NO warranty ; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. CERTI RTIG up and running ... As root: bash-3.2# $PTII/bin/vergil $PTII/org/hlacerti/demo/Billard/Billard.xml CertRtig: the os.name property is: Mac OS X CertiRtig: .TwoBilliardBalls.HlaManager: About to invoke rtig: command: [/bin/sh, -c, /Users/cxh/pthla/certi-tools/bin/rtig, Test.fed] environment: [DYLD_LIBRARY_PATH=/Users/cxh/pthla/certi-tools/lib] directory: /Users/cxh/ptII/org/hlacerti/demo/Billard _read(): CERTI RTIG 3.5.1 - Copyright 2002-2008 ONERA This is free software ; see the source for copying conditions. There is NO warranty ; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. CERTI RTIG exiting. _read(): CERTI RTIG aborted with a Network Error: [Cannot bind UDP SocketAddres\ s already in use]. CertRtig: the os.name property is: Mac OS X CertiRtig: .PoolTable2.display: About to invoke rtig: command: [/bin/sh, -c, /Users/cxh/pthla/certi-tools/bin/rtig, Test.fed] environment: [DYLD_LIBRARY_PATH=/Users/cxh/pthla/certi-tools/lib] directory: /Users/cxh/ptII/org/hlacerti/demo/Billard _read(): CERTI RTIG 3.5.1 - Copyright 2002-2008 ONERA This is free software ; see the source for copying conditions. There is NO warranty ; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. CERTI RTIG exiting. _read(): CERTI RTIG aborted with a Network Error: [Cannot bind UDP SocketAddress already in use]. CertiRtig: .PoolTable2.display: About to terminate rtig. 7357 ms. Memory: 433152K Free: 378193K (87%) 6258 ms. Memory: 433152K Free: 378193K (87%) 7591 ms. Memory: 433152K Free: 378193K (87%) Note that root tries to start up Recompiling JCERTI
Debugging JCERTI
It looks like this message is getting sent: CertiRtiAmbassador.processRequest(): sending: OPEN_CONNEXION, NO_EXCEPTION, federation time: null, versionMajor: 1, versionMinor: 0 And no message is being received: MessageFactory.readMessage(): certi.communication.MessageBuffer@6711fccbsize: 0 Sockets in RAW Mode?It could be that we are opening sockets in RAW mode, which probably only works for root. It turns out that this probably not the case. I'm guessing that the issue was with the environment of my account and accidentally having a slightly different version of CERTI in my path Can someone elaborate on the OS X 10.11 feature called 'Rootless'? says: "The list of programs is really, really long. Anything that accesses /dev/mem or /dev/kmem or some other devices. Anything that opens sockets in RAW mode" Possible SolutionLooking at the console and then running vergil, I saw: 5/10/16 4:13:14.677 PM ReportCrash[2218]: Saved crash report for rtia[2217] version 0 to /Users/cxh/Library/Logs/DiagnosticReports/rtia_2016-05-10-161314_ealmac23.crash Clicking on the report: Process: rtia [2217] Path: /usr/local/certi-3.4.3/bin/rtia Identifier: rtia Version: 0 Code Type: X86-64 (Native) Parent Process: java [2193] Responsible: Terminal [484] User ID: 503 Date/Time: 2016-05-10 16:13:14.426 -0700 OS Version: Mac OS X 10.11.4 (15E65) Report Version: 11 Anonymous UUID: FFB0C42D-C30C-C2CA-DBCA-5A8AE184FC69 Time Awake Since Boot: 19000 seconds System Integrity Protection: enabled Crashed Thread: 0 Dispatch queue: com.apple.main-thread Exception Type: EXC_BAD_ACCESS (SIGSEGV) Exception Codes: KERN_INVALID_ADDRESS at 0xffffffffffffffe8 VM Regions Near 0xffffffffffffffe8: --> shared memory 00007ffffff1c000-00007ffffff1d000 [ 4K] r-x/r-x SM=SHM Thread 0 Crashed:: Dispatch queue: com.apple.main-thread 0 libstdc++.6.dylib 0x000000010bef0b51 std::string::assign(char const*, unsigned long) + 23 1 rtia 0x000000010ba1c067 PrettyDebug::setFederateName(char const*) + 41 2 rtia 0x000000010ba1bc9c main + 219 3 libdyld.dylib 0x00007fff91cab5ad start + 1 It looks like I had another copy of rtia and rtig: bash-3.2$ which rtia /usr/local/certi-3.4.3/bin/rtia My solution was to remove Then, the model worked as non-root! getHostByName() returns Null |