14 Replies Latest reply on May 15, 2008 5:23 PM by tpoindex

    CodeSleuth fails to start

        • CodeSleuth fails to start
          Thanks for the log info and the VM info this really helps.

          Was CodeAnalyst running when you were using CodeSleuth? The intent is that one should not start CodeAnalyst (we share the same low level driver so execution is exclusive). The CodeAnalyst install is required so that CodeSleuth can find the required dlls.

          When the application was launched (from the CodeSleuth run dialog) did it create a file in your project directory called 'xxxxxx.ca' with a timestamp prefix?

          • CodeSleuth fails to start
            No, CodeAnalyst was not running at the time I launched the CodeSleuth profiling session. Yes, I have many *.ca files in my project directory.
            • CodeSleuth fails to start
              Open some CodeSleuth views.

              Specifically, Windows->Show View->Other->CodeSleuth->CodeSleuth Navigation

              Then click on one of the .ca files. This should open the .ca file in the Navigation view.

              • CodeSleuth fails to start
                None of the .ca files are listed in the CodeSleuth Navigation view, the view just shows "--No Data". My application did not run. The same error message appears when I try to run my app under CodeSleuth:

                CodeAnalyst for Windows:
                cadataanalyze control utility, version
                Unable to get the profile type from the specified file: data.prd

                So it seems that the 'cadataanalye' program is expecting a file 'data.prd', but CodeSleuth has not
                provided one to it.

                I can see (od -c ) that the .ca file appears to have serialize objects, here is a sample

                0000000 254 355 \0 005 s r \0 $ c o m . a m d .
                0000020 j a v a l a b s . t o o l s . c
                0000040 a m o d e l . M o d e l 350 ` t F
                0000060 D # 275 216 002 \0 006 L \0 027 a d d r e s
                0000100 s T o M e t h o d M o d e l M a
                0000120 p t \0 017 L j a v a / u t i l / M
                0000140 a p ; L \0 \r c o n f i g u r a t
                0000160 i o n t \0 3 L c o m / a m d / j
                0000200 a v a l a b s / t o o l s / c a
                0000220 m o d e l / M o d e l C o n f i
                0000240 g u r a t i o n ; L \0 032 d y n a
                0000260 m i c C o d e M e t h o d M o d
                0000300 e l R o o t t \0 ; L c o m / a m
                0000320 d / j a v a l a b s / t o o l s
                0000340 / c a m o d e l / D y n a m i c
                0000360 C o d e M e t h o d M o d e l R
                0000400 o o t ; L \0 \f m e t h o d M o d
                0000420 e l s t \0 020 L j a v a / u t i l
                0000440 / L i s t ; L \0 025 n a t i v e M
                0000460 e t h o d M o d e l R o o t t \0
                0000500 6 L c o m / a m d / j a v a l a
                0000520 b s / t o o l s / c a m o d e l
                0000540 / N a t i v e M e t h o d M o d

                The .ca file is 5,440 bytes in length.
                • CodeSleuth fails to start
                  Quick follow up, when I click on the .ca file, the CodeSleuth Navigation view changes to 'Dynamic Generated Code',
                  but there is no other data, which probably makes perfect sense, due to the error reported above and the fact that
                  my CodeSleuth did not start my program.
                    • CodeSleuth fails to start
                      Apologies for not getting back earlier.

                      If you see the 'Dynamic Methods' but none of your classes then this implies that that the workload (classes you wish to profile) did not get jitted.

                      CodeSleuth only see's jitted methods.

                      How long does your workload run for? If the code you are exercises runs just once consider placing it in a code harness that calls it multiple times (1000?) to try to force Jit compilation.

                    • CodeSleuth fails to start
                      thx for the reply.

                      Thus the crux of the problem, my application does not startup under CodeSleuth. I regularly run my application under Eclipse, including debug. The parameters I set for the RunAs CodeSleuth are exactly the same as my RunAs Java Application settings.

                      See my very first post in this thread for the Console output.
                      • CodeSleuth fails to start
                        With the CodeSleuth navigation view open. It will initially show "No Data". What do you see after you click on a .ca file.

                        You should see something similar to a package explorer view.

                        If so then you application did indeed run with codesleuth.

                        If you only see 'Dynamic methods' and no other java related packages then it appears that no methods were jitted, which is very unusual, and as you suggest does look like a bug.

                        When you run using a normal eclipse profile how long does our application run for? Does the app use jni?

                          • CodeSleuth fails to start
                            So it sure looks like the APP is not running under CodeSleuth.

                            I have not profiled a Swing app. Let me try that and come back here. I can see no reason why Swing would cause any issues.

                            In the meantime can you try creating a toy project with something like the following in and execute it using CodeSleuth and see if you get profiling data.

                            package main;

                            public class Main{

                            public static void main(String[] _args) {
                            Main main = new Main();
                            int total = 0;
                            for (int x = 0; x < 1000; x++) {
                            for (int y = 0; y < 1000; y++) {
                            if (x % 2 == 0 && y % 2 == 0) {
                            total += 1;

                            System.out.println("total " + total);

                          • CodeSleuth fails to start
                            Clicking on a .ca file, I see ".... + Dyname Generated Code", and nothing else. Just that single line.

                            Under Eclipse, my application runs about 45 seconds doing real work (100% cpu). It has a Swing front-end, which remains running after processing 14,000 messages (the 45 seconds of 100% cpu work). The Swing portion allows viewing and analysis of specific messages. We have no JNI components, although we do use a type-4 JDBC driver to a database (type-4 JDBC driver is pure java.) We also use code from other open Eclipse projects.

                            Under CS, my application does not start, does not process any messages, does not display the Swing app, etc. My Eclipse console window just shows the error message. Without CS, there are a number of startup messages and processing messages.
                            • CodeSleuth fails to start
                              That example does indeed run on my system, including running under CS. In the CS Navigation View, I see the 'main()' method, and percentage numbers for the time spent on two lines (the inner loop, and the following 'if'). I had to increase the number of loops to get the Jit to kick in. So perhaps something on my classpath? (which is listed above on my 2nd post on 04/23/2008). My project does use many third party jars and library jars from other Eclipse projects in my code base, there certainly might be some JNI code in one of those. Does CS not support JNI?
                                • CodeSleuth fails to start
                                  Sorry for the delay.

                                  I have been looking through the CodeAnalyst source and think I have the answer. Sadly the maximum length of a 'launch' command line is 256 characters. or _MAX_FNAME in C/C++.

                                  Unfortunately when we clip your command line (see below) we clearly lose most of the classpath and lose the actual class to launch. Clearly 256 is nowhere near reasonable for a Java launch. Especially considering that the classpath is included in the 'launch'.

                                  We will work with the CodeAnalyst team to try to solve this, in the meantime it looks like we have a limit of 256 to try to stayt below.

                                  One solution might be to create a jar with a CLASS_PATH manifest entry (pointing to all of your classpath dependencies) and then just include this one jar on the launch command line.

                                  I do apologies for taking so long to track this down.

                                  C:\jdk1.6.0_05\bin\javaw.exe -Xmx512m -Dcom.sun.management.jmxremo
                                  te -classpath C:\workspace\XXXXX\build\classes;C:\workspace\XXXXX\bin;C:\workspace
                                  ctions-3.2.jar -agentlib:C:\eclipse\configuration\org.eclipse.osgi\bundles\641\1
                                  .dat com.XXXXX.XXXXX.cmdline.apps.swing.XXXXXClient
                                • CodeSleuth fails to start
                                  Thanks for tracking this down. I'm always happy to help find bugs!

                                  Certainly the typical C/C++ command line rarely sees a command line longer than 256, but more the norm in Java, especially with lots of library jars.