Code Generation and Optimization

hi,
we have been looking into a problem with our app, running in a JRockit JVM, pausing. Sometimes for up to a second or so at a time.
We enabled the verbose logging of codegen and opt.
And we see entries like:
[Fri Sep  3 09:51:38 2004][28810][opt    ] #114 0x200 o com/abco/util/Checker.execute(Lcom/abco/util/;)V
[Fri Sep  3 09:51:39 2004][28810][opt    ] #114 0x200 o @0x243c4000-0x243c7740 1186.23 ms (14784.88 ms)
So the optimization took 1186 ms.
Does this optimization happen in the main thread?
I.e., is the above message an indication that the app had to stop for 1186ms while the optimization occurred?
Any help on this would be greatly appreciated!
Also, does anyone have any more pointers to info on the code generation and optimization in JRockit?
I have only managed to find the following:
http://edocs.beasys.com/wljrockit/docs142/intro/understa.html#1015273
thanks,
JN

Hi,
The optimization is done in its own thread and should not cause pauses in your application.
The probable cause for long pause times is garbage collection. Enable verbose output for gc (-Xverbose:memory), or use the JRockit Management Console to monitor your application. Try using the generational concurrent gc, -Xgc:gencon, or the gc strategy -Xgcprio:pausetime. Read more on: http://edocs.beasys.com/wljrockit/docs142/userguide/memman.html
If you allocate a lot of small, shortlived objects, you might want to configure a nursery where small objects are allocated. When the nursery is full, only that small part of the heap is garbage collected at a smaller cost than scanning the whole heap.
If you need help tuning your application, you could make a JRA recording and send to us: http://e-docs.bea.com/wljrockit/docs142/userguide/jra.html.
Good luck,
Cecilia
BEA WebLogic JRockit

Similar Messages

  • IOS Code Generation and Decompile?

    So I am doing an evaluation of Flash Builder for our mobile applications.
    I love it so far.  Here's the catch. At a minimum, I need to be able to have the native code or my architects will not let me use the tool simply on principle.
    I realize the .apk file is basically a swf and I can decompile that swf and see the actionscript.
    However, I need to be able to see the generated iOS native Objective C code.
    How do I go about decompiling?  I've been searching and thus far have come up empty.
    Just to be clear, this isn't to decompile an code other than our own.

    Jack,
    The time shown is the "time when the optimization ended" - "time when the
    optimization started". If does not say that the CPU time used was 1186 ms.
    One should probably not read too much into these numbers, I guess. The
    optimization does not happen in the main thread, but in a special
    optimizer thread that does these things asynchronously. If you do a
    Ctrl-Break (or kill -QUIT), you'll see a specific thread assigned for this.
    I don't think I have any pointers. Did you have any specific questions
    in mind?
    Cheers,
    olof
    Jack Nicklaus wrote:
    hi,
    > And we see entries like: [Fri Sep 3 09:51:38 2004][28810][opt ] #114 0x200 o
    com/abco/util/Checker.execute(Lcom/abco/util/;)V [Fri Sep 3 09:51:39
    2004][28810][opt ] #114 0x200 o @0x243c4000-0x243c7740 1186.23 ms (14784.88
    ms)
    So the optimization took 1186 ms.
    Does this optimization happen in the main thread?
    I.e., is the above message an indication that the app had to stop for 1186ms
    while the optimization occurred?
    Any help on this would be greatly appreciated!
    Also, does anyone have any more pointers to info on the code generation and
    optimization in JRockit?

  • [svn:osmf:] 12659: A few code cleanup and optimization tasks for the Manifest.

    Revision: 12659
    Revision: 12659
    Author:   [email protected]
    Date:     2009-12-08 10:56:56 -0800 (Tue, 08 Dec 2009)
    Log Message:
    A few code cleanup and optimization tasks for the Manifest.
    Modified Paths:
        osmf/trunk/framework/MediaFramework/org/osmf/net/F4MLoader.as
        osmf/trunk/framework/MediaFramework/org/osmf/net/ManifestParser.as

    Many thanks for the fast reply.
    I've got a follow up question.
    What will happen if I modify the reconnect Code in the OSMF Netloader Class as recommended and then load multiple third party OSMF plugins,
    which may have included the origin OSMF version of the Netloader class.
    Which one will be used at runtime?
    Thanks in advance!

  • Runtime Code Generation and operations on unknown types

    (Post split in two) - Part 1
    Hello,
    The problem is a bit more complex so I will try to explain it as good as possible. Let's consider the following classes and interfaces (trimmed to the essential parts):
    public abstract class Binding {
      private String name;
      public Binding(String name) {
        this.name = name;
      abstract Object getValue();
      // getters & setters
    public interface ExpressionImpl {
      public Object evaluate();
    public class DirectBinding extends Binding {
      private String expression;
      private ExpressionImpl exprImpl;
      public DirectBinding(String name, String expression) {
        super(name);
        this.expression = expression;
        this.exprImpl = /* Call to some code which will generate and load a a class that implements "ExpressionImpl" */
      public Object getValue() {
        return exprImpl.evaluate();
    public class RecursiveBinding extends Binding {
      private String initializationExpression;
      private String recursiveExpression;
      private ExpressionImpl exprImpl;
      public RecursiveBinding(String name, String initializationExpression, String recursiveExpression)  {
        super(name);
        this.initializationExpression= initializationExpression;
        this.recursiveExpression= recursiveExpression;
        this.exprImpl = /* Call to some code which will generate and load a a class that implements "ExpressionImpl" */
      public Object getValue() {
        return exprImpl.evaluate();
    public class Element {
      private List<Element> children;
      private Element parent;
      private List<Binding> bindings;
      // constructor, add, remove, getters and setters
    }So:
    1. Element models a tree node structure (reference to children and parent) and a binding container.
    2. Bindings know their parent element.
    3. A Binding can search and access Bindings from it's parent element or this element's ancestors.
    4. To observe that Bindings return Object values.
    5. Bindings are initialized from top to bottom. So if a child element's binding requires the value of a parent element binding, this is allready available.
    6. Valid expressions for DirectBindings are for example:
    - "100"
    - "3.5D + (new java.util.Random().nextDouble())"
    - "$parent_binding + $ancestor_binding"
    7. Valid expressions for RecursiveBindings are (initialization expression, recursive expression) (for a Binding called "this_binding"):
    - "$parent_binding" , "$this_binding + 1"
    - "100", "$this_binding * $ancestor_binding"
    8. A Binding object deals with values of the same type in it's expression(s) -> only numeric, only boolean. You cannot have "$parent_binding && true" if "parent_binding" returns an Integer object (through it's "Object getValue()" method).
    9. Instead of parsing and evaluating the expressions as strings, classes are generated which return the natural (Java) evaluation of the expressions. Of course valid code will be generated for the expression, so if a binding reference is found, in the generated class it will be replaced with the equivalent "binding.getValue()".

    Part 2
    Let's consider the following code snippet:
    Element parent = new Element("parent");
    parent.addBinding(new DirectBinding("parent_binding", "3.5D"); // Will call this Binding 1
    Element child = new Element("child");
    child.addBinding(new DirectBinding("child_direct_binding", "$parent_binding + 1"); // Will call this Binding 2
    child.addBinding(new RecursiveBinding("child_recursive_binding", "10", "$child_recursive_binding + Math.PI"); // Will call this Binding 3
    parent.add(child);
    parent.initialize(); // this is where the code generation starts (top to bottom)Now the following classes are generated:
    Binding 1 expression implementation:
    public class EMC_parent_binding implements ExpressionImpl {
         public EMC_parent_binding(final BindingCache bindingCache) {
         public Object evaluate() {
              return 3.5D;
    //Binding 2 expression implementation:
    public class EMC_child_direct_binding implements ExpressionImpl {
         private Binding m_parent_binding;
         public EMC_child_direct_binding(final BindingCache bindingCache) {
              m_parent_binding = bindingCache.getBinding("parent_binding");
         public Object evaluate() {
              return (java.lang.Double)(m_parent_binding.getValue()) + 1;
    // Binding 3 expression implementation:
    public class EMC_child_recursive_binding implements ExpressionImpl {
         private boolean firstEvaluation = true;
         private Binding m_child_recursive_binding;
         public EMC_child_recursive_binding(final BindingCache bindingCache) {
              m_child_recursive_binding = bindingCache.getBinding("child_recursive_binding");
         public Object evaluate() {
              if (firstEvaluation) {
                   firstEvaluation = false;
                   return 10;
              } else {
                   return (UnkownType)(m_child_recursive_binding.getValue()) + Math.PI;  // <-------- This is where the problem appears
    }Notice the casts in the evaluate() methods. Since I cannot do operations on "Object" I needed to cast to the appropriate types. This is easy to notice in Binding 2. It's easy to cast to "java.lang.Double" since when generating the code I allready have the value of "parent_binding" and thereby know it's type.
    Now the problem appears at recursive bindings (code for Binding 3). The binding for which I currently generate the code has a value of "null" and cannot find an appropriate type to cast to. How can I find a type to cast to, or what other solutions do I have?
    I sincerely thank you for reading this whole post, and am looking forward for some replies.
    Kind regards,
    Cosmin.

  • Unique 4 digit alphanumeric code generation.

    Hi Everyone,
    Please look into this code and suggest me, how should I approach to change this streak.
    My DB version is
    BANNER                                                       
    Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bi
    PL/SQL Release 10.2.0.1.0 - Production                         
    CORE 10.2.0.1.0 Production                                       
    TNS for Linux: Version 10.2.0.1.0 - Production                 
    NLSRTL Version 10.2.0.1.0 - Production         
    Please look into this unique 4 digit alphanumeric code generation.
    9999999999999 is just for reference. This is the current behavior.
    If I will put round instead of trunc, will it work for long run, though it's working for few sequence numbers.
    Can I change the order of numbers and alphabets? Please suggest something.
    As per the requirement these alphabets are restricted for the code generation and they are (I, L O, B, Q)
    If you run this code this will give the value as 3688. But 3688 is already exists so it should return something else and it should be full proof in the long run.
    Declare
    VC_SEQ_NUMBER varchar2(4) := NULL;
    BEGIN
    -- First digit (highest) of the alphanumeric
    vc_seq_NUMBER := vc_seq_NUMBER ||
       CASE TO_CHAR (MOD (TRUNC (TRUNC (TRUNC (9999999999999 / 31, 0) / 31,0) /31,0),31))
                    WHEN '0' THEN '0'
                    WHEN '1' THEN '1'
                    WHEN '2' THEN '2'
                    WHEN '3' THEN '3'
                    WHEN '4' THEN '4'
                    WHEN '5' THEN '5'
                    WHEN '6' THEN '6'
                    WHEN '7' THEN '7'
                    WHEN '8' THEN '8'
                    WHEN '9' THEN '9'
                    WHEN '10' THEN 'A'
                    WHEN '11' THEN 'C'
                    WHEN '12' THEN 'D'
                    WHEN '13' THEN 'E'
                    WHEN '14' THEN 'F'
                    WHEN '15' THEN 'G'
                    WHEN '16' THEN 'H'
                    WHEN '17' THEN 'J'
                    WHEN '18' THEN 'K'
                    WHEN '19' THEN 'M'
                    WHEN '20' THEN 'N'
                    WHEN '21' THEN 'P'
                    WHEN '22' THEN 'R'
                    WHEN '23' THEN 'S'
                    WHEN '24' THEN 'T'
                    WHEN '25' THEN 'U'
                    WHEN '26' THEN 'V'
                    WHEN '27' THEN 'W'
                    WHEN '28' THEN 'X'
                    WHEN '29' THEN 'Y'
                    WHEN '30' THEN 'Z'
                 END;
    -- Second digit of the alphanumeric
    vc_seq_NUMBER := vc_seq_NUMBER ||
              CASE TO_CHAR (MOD (TRUNC (TRUNC (9999999999999 / 31, 0) / 31, 0), 31))
                 WHEN '0' THEN '0'
                 WHEN '1' THEN '1'
                 WHEN '2' THEN '2'
                 WHEN '3' THEN '3'
                 WHEN '4' THEN '4'
                 WHEN '5' THEN '5'
                 WHEN '6' THEN '6'
                 WHEN '7' THEN '7'
                 WHEN '8' THEN '8'
                 WHEN '9' THEN '9'
                 WHEN '10' THEN 'A'
                 WHEN '11' THEN 'C'
                 WHEN '12' THEN 'D'
                 WHEN '13' THEN 'E'
                 WHEN '14' THEN 'F'
                 WHEN '15' THEN 'G'
                 WHEN '16' THEN 'H'
                 WHEN '17' THEN 'J'
                 WHEN '18' THEN 'K'
                 WHEN '19' THEN 'M'
                 WHEN '20' THEN 'N'
                 WHEN '21' THEN 'P'
                 WHEN '22' THEN 'R'
                 WHEN '23' THEN 'S'
                 WHEN '24' THEN 'T'
                 WHEN '25' THEN 'U'
                 WHEN '26' THEN 'V'
                 WHEN '27' THEN 'W'
                 WHEN '28' THEN 'X'
                 WHEN '29' THEN 'Y'
                 WHEN '30' THEN 'Z'
              END;
    -- Third digit  of the alphanumeric
    vc_seq_NUMBER := vc_seq_NUMBER ||
              CASE TO_CHAR (MOD (TRUNC (9999999999999 / 31, 0), 31))
                 WHEN '0' THEN '0'
                 WHEN '1' THEN '1'
                 WHEN '2' THEN '2'
                 WHEN '3' THEN '3'
                 WHEN '4' THEN '4'
                 WHEN '5' THEN '5'
                 WHEN '6' THEN '6'
                 WHEN '7' THEN '7'
                 WHEN '8' THEN '8'
                 WHEN '9' THEN '9'
                 WHEN '10' THEN 'A'
                 WHEN '11' THEN 'C'
                 WHEN '12' THEN 'D'
                 WHEN '13' THEN 'E'
                 WHEN '14' THEN 'F'
                 WHEN '15' THEN 'G'
                 WHEN '16' THEN 'H'
                 WHEN '17' THEN 'J'
                 WHEN '18' THEN 'K'
                 WHEN '19' THEN 'M'
                 WHEN '20' THEN 'N'
                 WHEN '21' THEN 'P'
                 WHEN '22' THEN 'R'
                 WHEN '23' THEN 'S'
                 WHEN '24' THEN 'T'
                 WHEN '25' THEN 'U'
                 WHEN '26' THEN 'V'
                 WHEN '27' THEN 'W'
                 WHEN '28' THEN 'X'
                 WHEN '29' THEN 'Y'
                 WHEN '30' THEN 'Z'
              END;
    --Fourth digit OF the alphanumeric
    vc_seq_NUMBER  := vc_seq_NUMBER ||
              CASE TO_CHAR (TRUNC (MOD (9999999999999 , 31), 0) )
                 WHEN '0' THEN '0'
                 WHEN '1' THEN '1'
                 WHEN '2' THEN '2'
                 WHEN '3' THEN '3'
                 WHEN '4' THEN '4'
                 WHEN '5' THEN '5'
                 WHEN '6' THEN '6'
                 WHEN '7' THEN '7'
                 WHEN '8' THEN '8'
                 WHEN '9' THEN '9'
                 WHEN '10' THEN 'A'
                 WHEN '11' THEN 'C'
                 WHEN '12' THEN 'D'
                 WHEN '13' THEN 'E'
                 WHEN '14' THEN 'F'
                 WHEN '15' THEN 'G'
                 WHEN '16' THEN 'H'
                 WHEN '17' THEN 'J'
                 WHEN '18' THEN 'K'
                 WHEN '19' THEN 'M'
                 WHEN '20' THEN 'N'
                 WHEN '21' THEN 'P'
                 WHEN '22' THEN 'R'
                 WHEN '23' THEN 'S'
                 WHEN '24' THEN 'T'
                 WHEN '25' THEN 'U'
                 WHEN '26' THEN 'V'
                 WHEN '27' THEN 'W'
                 WHEN '28' THEN 'X'
                 WHEN '29' THEN 'Y'
                 WHEN '30' THEN 'Z'
              END;
      DBMS_OUTPUT.PUT_LINE('vc_seq_NUMBER : ' || vc_seq_NUMBER);
    END;
    Regards,
    BS2012.

    BluShadow has demonstrated a way to generate Four digit base 36 alphanumeric sequence. I am not sure how much can it scale in a multi user environment. You can take it as a reference to use Sequences in order to be useful in a Multi user env.
    Alphanumeric sequence number generator

  • FPGA Code Generation fails with error codes 7 and -1

    Hi all,
    I have been having a weird issue with my LV FPGA compilation in the last couple of days, no matter what I try to compile LV fails to generate the FPGA code files and returns with errors 7 and -1 and complains that the file is not found. This happens no matter what I am trying to compile even a VI with just a while loop. I followed the discussion forum here without any luck, also followed the NI article here and that did not help either. The error codes always get generated at the start of the Generating Intermediate files step #7 (out of 7).
    Attached to this post is a screenshot of the error I am getting (error -1 just says internal error and to contact NI support), bellow is basically the error I get for error code 7
    An internal software error has occurred. Please contact National Instruments technical support at ni.com/support with the following information:
    Error 7 occurred at Read from Text File in nirviGetInstantiation_cRIO-IDSel_Timer.vi->nirviGetInstantiation_cRIO-IDSel_Timer.vi.ProxyCaller
    Possible reason(s):
    LabVIEW: File not found. The file might have been moved or deleted, or the file path might be incorrectly formatted for the operating system. For example, use \ as path separators on Windows, : on Mac OS X, and / on Linux. Verify that the path is correct using the command prompt or file explorer.
    =========================
    NI-488: Nonexistent GPIB interface.
    C:\NIFPGA\compilation\cRioController_8-SlotFPGA_FPGA-TriggerTest_C06156E2\IDSel_Timer.vhd
    I tried to do some digging to see what could possibly be happening, and I noticed that LV is looking for the vhdl files in the wrong folder (see the line highlighted in red above), when generating the vhdl files, LV will place them inside the "source_files" folder under the compilation project, but for some reason it is trying to find them under the root folder not inside the source_files folder!!!
    Does anyone have any idea why LV would be looking for these files in the wrong subfolder? 
    Thank you,
    Aws
    Attachments:
    Code Generation Errors.png ‏35 KB

    Hi Aws_Khudhair,
    What version of LabVIEW are you using? And what version of the FPGA module? From what I found, it seems as though this is primarily an issue with LabVIEW 8.6 and 8.6.1.
    http://digital.ni.com/public.nsf/allkb/A711119FE89E39E78625754E00075E92
    This forum also discusses a similar issue:
     http://forums.ni.com/t5/Real-Time-Measurement-and/FPGA-compile-errors-after-generating-intemediate-f...
    It may also be worth repairing/reinstalling the FPGA Module and the Xilinx compile tools.
    Catherine B.
    Applications Engineer
    National Instruments

  • Please help block my ipod touch second generation and forget the code, try putting the code so many times that now says connect to itunes, I connect but will not let me do anything that tells me this should unlock with key and I should do for Please help!

    please helpme i block my ipod touch second generation and forget the code, try putting the code so many times that now says connect to itunes, I connect but will not let me do anything that tells me this  should unlock with key and I should do for Please help!. thanks

    Place the iPOd in recovery mode and then restore. For recovery mode:
    iPhone and iPod touch: Unable to update or restore

  • I have a ipod nano 1st and 2nd generation and am trying to put music on it but every time windows says one of the usb devices attached to this computer has malufunctioned and windows does not recognize it code 43 can someone help me please

    i have a ipod nano 1st and 2nd generation and am trying to put music on it but every time windows says one of the usb devices attached to this computer has malufunctioned and windows does not recognize it code 43 can someone help me please

    Try putting it into "Disk Mode" http://docs.info.apple.com/article.html?artnum=93651
    Then with it in this mode connect it to the PC and try to run the latest iPod updater to do a restore and update software if you have the option. the latest iPod updater is 2006-03-23 and can be downloaded here http://www.apple.com/ipod/download/

  • UML associations and code generation don't work

    Hello,
    I've maid a Class Diagramm in JSE 8, class generation works great, but I have a problem with associations : they are not generated (ie no attributes in class files). I've tried to give association name and also named both ends, but nothing better.
    Thanks for your help.
    PS : navigable association seems to work great.

    Thanks for your valuable feedback and sorry for the inconvenience.
    I already submitted a request for enhancement (RFE) for automatic code generation for Association links. As for the documentation issue, I'm not able to replicate your problem. I'm seeing all comments in the source that I entered in the documentation panel. Could you please kindly provide me detail steps to reproduce the case that you don't see documentation generated in the code and I'll try to help you. Thanks!
    --Peter                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • TS3694 I am trying to restore an Ipod Touch 1st generation and I am receiving an error code of 1, How can I resolve?

    I am trying to restore an Ipod Touch 1st generation and I am receiving an error code of 1, How can I resolve?

    i have the same problem ipod touch 1st gen and its 1 not -1
    can you help please??

  • APT and Java source code generation

    Hi all,
    In many articles about APT tool, I read that it is possible to generate Java source code from annotations read by AnnotationProcessorFactory.
    I am very interesting by this possibility but I can't find an exemple (all exemples I found display informations only).
    Where can I find a concrete exemple of this functionnality ?
    Thanks
    Micka�l

    Micka�l
    I have a project on java.net that has several examples of code generation.
    Go to the project source code here.
    https://rapt.dev.java.net/source/browse/rapt/
    The ones here are quite simple
    https://rapt.dev.java.net/source/browse/rapt/src/net/java/dev/rapt/proposed/generators/
    and these packages are more complex
    https://rapt.dev.java.net/source/browse/rapt/src/net/java/dev/rapt/exploratory/#dirlist
    Check out the javadoc to see how they should be used.
    One pointer is, work out exactly what you want to generate first. Then code an example by hand, then make sure it compiles and does what you want it to do. That way you know exactly what you need to generate. It is much quicker to fix compiler and functional errors in your hand coded example, than to change the generator, recompile that, then run it to generate and compile the code.
    If you do find errors in your generated code, tweak the generated code by hand till it works, then go back and change the generator to do the right thing.
    A second point is: generate nicely formatted code, indented etc, then when it doesn't work, or doesn't even compile, you can at least read the generated code to debug it.
    Bruce

  • Catalyst Plugins and Code Generation?

    Hey,
    Does/will Flash Catalyst support custom plugins, or can we modify how the code generation works.  That would be very helpful on the developers end.
    Thanks!
    Lance

    We don't have any plans for either of these things in the first version of Catalyst. How would you want to modify the code generation?
    -Adam

  • Code generation bug in Sun Studio 12

    Hi,
    The following program prints `Failure' when compiled with -xO4 where nothing should be printed (when compiled with no optimization or -xO2). It looks to me that the first comparison `buggy_routine' against 0x80 is returning True where it should return False.
    #include <stdlib.h>
    #include <stdio.h>
    typedef unsigned long long int      EIF_NATURAL_64;
    typedef unsigned char   EIF_BOOLEAN;
    typedef int EIF_INTEGER_32;
    typedef char * EIF_REFERENCE;
    char s[] = "9223372036854775808";
    void buggy_routine (EIF_REFERENCE Current, EIF_NATURAL_64 arg1)
        EIF_NATURAL_64 tu8_1;
        tu8_1 = (EIF_NATURAL_64) ((EIF_INTEGER_32) 128L);
        if ((EIF_BOOLEAN) (arg1 <= tu8_1)) {
        } else {
            if ((EIF_BOOLEAN) (arg1 <= ((EIF_NATURAL_64)  9223372036854775808ull ))) {
            } else {
                  printf("Failure\n");
    int main (int argc, char ** argv, char **envp ) {
        EIF_NATURAL_64 loc2 = (EIF_NATURAL_64) 0;
        loc2 = (EIF_NATURAL_64) atoll(s);
        buggy_routine ("s", loc2);
    }To reproduce:
    cc -xO4 bug.c -o bug ; ./bug
    It fails on both 32 and 64-bit code generation for x86. I haven't tried on Sparc as I need to install Sun Studio 12. Is this a known issue? Is there an easy workaround?
    I tried with Sun Studio 11 and it worked just fine there.
    Regards,
    Manu
    PS: I've tried with both version (the first is the one from the default installation) and the second after I noticed there were some patches available:
    cc: Sun C 5.9 SunOS_i386 Patch 124868-01 2007/07/12
    cc: Sun C 5.9 SunOS_i386 Patch 124868-02 2007/11/27

    An issue filed at bugs.sun.com does not go directly into the bug database. It is evaluated, and if it turns out the report is actually a bug not previously reported, goes into the database. You get a notification and chance to reply after the report is evaluated.
    In this case, I picked up your report myself, and filed the bug. The bug ID is 6654314, and will be visible at bugs.sun.com in a day or two.

  • Code generation bug in C++ 5.0

    The enclosed test program generates incorrect code
    with C++ 5.0 when -g is not used.
    The problem showed up in our production code
    and concerns any reference counted smart pointer
    implementation.
    The test program is specifically written to demonstrate
    the problem and diagnose a reference miscount.
    With any optimization at all (without -g, and/or with
    any level of -O including no -O) it generates
    incorrect results. With -g the results are correct.
    gcc compiles this correctly with any optimizations
    selected.
    // main.cc
    // test program to demonstrate code generation bug in
    // Sun WorkShop Compilers C++ 5.0
    // bug exhibited as of 27th April 2001
    // relevant patches applied:
    // 107289-05 Packages: SPROcc
    // 107390-12 Packages: SPROtl7x, SPROsclx, SPROtll7x, SPROcplx, SPROlgcx
    // 107311-12 Packages: SPROscl, SPROtll7, SPROtlbn7, SPROcpl, SPROgc, SPROlgc
    // 107357-11 Packages: SPROlang
    // correct behaviour with CC -g:
    // CC -g main.cc -o main; ./main
    // incorrect behaviour with CC (no -g):
    // CC main.cc -o main; ./main
    #include <stdio.h>
    class O {
    public:
    inline O() : m_refCount(0) { };
    inline void ref() { m_refCount++; }
    inline void deref() { m_refCount--; }
    inline int refCount() { return(m_refCount); }
    private:
    int m_refCount;
    class R {
    public:
    inline R() : m_object(0) { };
    inline R(const R &r) : m_object(r.m_object) { if (m_object) m_object->ref(); }
    inline R(O *o) : m_object(o) { if (o) o->ref(); };
    inline ~R() { if (m_object) m_object->deref(); }
    inline R &operator =(const R &r) {
    if (this == &r) return(*this);
    O *o = m_object;
    if (m_object = r.m_object) m_object->ref();
    if (o) o->deref();
    return(*this);
    inline R &operator =(O *n) {
    if (m_object == n) return(*this);
    O *o = m_object;
    if (m_object = n) n->ref();
    if (o) o->deref();
    return(*this);
    inline operator O *() const { return(m_object); }
    inline O *operator ->() const { return(m_object); }
    private:
    O *m_object;
    class B {
    public:
    inline B(const R &r) : m_ref(r) { };
    inline const R &ref() { return(m_ref); }
    private:
    R m_ref;
    R buggy(int notnull, B &b)
    return(notnull ? b.ref() : 0); // BUG HERE
    int main()
    O o;
    R r(&o);
    B b(r);
    int i;
    for (i = 0; i < 20; i++) {
    R s;
    s = buggy(!0, b);
    printf("refCount: %d (should be 2)\n", o.refCount());

    How do I file a bug report for this and get
    a bug ID assigned?

  • Error in code generation for deleting table BUT000_TD

    Hi,
    Did anyone encounter this error while working on EEWB ?
    I created the project extension via EEWB and completed the wizard setting with the package (dev. class) value as $temp as I wanted to test it locally.
    One of the errors, that I got is:
    Error in code generation for deleting table BUT000_TD
        Message no. DA464
    Diagnosis
        This error message indicates that internal inconsistencies exist.
    Procedure
        Please consult SAP.

    Hi,
    As I mentioned in my previous post kindly check the consistency of the structure BUT000_TD.
    Regards,
    Sudheer.

Maybe you are looking for