Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 46607 - sun-j2sdk-1.4.2 fails because of mistake in source
Summary: sun-j2sdk-1.4.2 fails because of mistake in source
Status: RESOLVED WORKSFORME
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High blocker (vote)
Assignee: Java team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-04-02 07:59 UTC by Marcin Wojtczuk
Modified: 2004-07-18 08:11 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
moves one '#ifdef DEBUG' statement one line up (j2sdk-1.4.2-numEventsHandled.patch,669 bytes, patch)
2004-04-02 08:03 UTC, Marcin Wojtczuk
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Marcin Wojtczuk 2004-04-02 07:59:04 UTC
Build fails stating that variable numEventsHandled is undefined. This is true because it is defined this way:
#ifdef DEBUG 
  int32_t  numEventsHandled
#endif
then used OUTSIDE of #ifdef DEBUG. This in done once in j2se/src/solaris/native/sun/awt/awt_MToolkit.c file, line 937. I have a tested (works for me) patch for this.

Reproducible: Always
Steps to Reproduce:
1.
2.
3.
Comment 1 Marcin Wojtczuk 2004-04-02 08:03:18 UTC
Created attachment 28579 [details, diff]
moves one '#ifdef DEBUG' statement one line up

Using variable numEventsHandled outside of scope defined by DEBUG makes no
sense. I haven't investigated this issue, this just works. Please check my work
if you understand JVM code as a whole. IMHO though function DTRACE_PRINT1 is
used solely for debugging purpose.
Comment 2 Thomas Matthijs (RETIRED) gentoo-dev 2004-06-22 14:36:41 UTC
i can't reproduce this, are you still having this issue?
can you provide some more info?
Comment 3 Marcin Wojtczuk 2004-06-23 07:19:22 UTC
This is not anything that needs reproducing. This is simple mistake in sources. If it works for you, then probably something went wrong during decompressing my sources. Maybe my hardware is buggy, dunno.

Look at mentioned file, line 936:

        /* print the number of events handled in parens */                                                        
        DTRACE_PRINT1("(%d events)",(int32_t)numEventsHandled);                                                   
#ifdef DEBUG                                                                                                      
        if (++debugPrintLineCount > 8) {                                                                          
            DTRACE_PRINTLN("");                                                                                   
            debugPrintLineCount = 0;                                                                              
        }                                                                                                         
#endif

Does it make sense ? No, look at DTRACE_PRINT and DTRACE_PRINTLN macros usage. Does it make sense to always print numEvents and in case of debug build add only new line ? Does it make sense to print always the same number and increase it only in case of debug ? Please read sources, don't try to reproduce - you might be building debug version (I don't remember now how to turn debug on/off). I was bulding normal version, DEBUG was undefined.

Please look at Makefiles to find out that -DDEBUG is not a default option.

My gcc version is: gcc (GCC) 3.3.3 20040217 (Gentoo Linux 3.3.3, propolice-3.3-7)
What else would you like to know ?
Comment 4 Thomas Matthijs (RETIRED) gentoo-dev 2004-07-18 08:11:39 UTC
Closing, since it works fine for everyone i know, and i'm not willing to touch that source, since it'd take me ages to figure it out to make sure it doesn't break anything else, and by the looks of how long this bug has been open, nobody else wants too