Re: Harmony passes all tests of Maven 2.0.4

2006-11-12 Thread Leo Li

Ok. Posted it on wiki.

On 11/10/06, Geir Magnusson Jr. <[EMAIL PROTECTED]> wrote:


w00t!

Log it on the wiki!

(and please prefix your subject lines with ???  right now, we have
[testing] listed on

  http://incubator.apache.org/harmony/mailing.html

but maybe we need to add [app-testing] ?

geir

Leo Li wrote:
> Hi, all:
> Harmony classlib at revision 473150 passes all tests of Maven 2.0.4on
> windows xp, redhat enterprise 4, unbuntu 6.0.6 and suse 10.
> As for drlvm, it passes on windows xp but fails on redhat linux
> enterprise 4. If somebody can reproduce it, I will report it as a
> application-oriented bug to jira.
> For detailed information, pls refer to
> http://wiki.apache.org/harmony/Apache_Maven.
>





--
Leo Li
China Software Development Lab, IBM


Harmony passes all tests of Maven 2.0.4

2006-11-10 Thread Leo Li

Hi, all:
Harmony classlib at revision 473150 passes all tests of Maven 2.0.4 on
windows xp, redhat enterprise 4, unbuntu 6.0.6 and suse 10.
As for drlvm, it passes on windows xp but fails on redhat linux
enterprise 4. If somebody can reproduce it, I will report it as a
application-oriented bug to jira.
For detailed information, pls refer to
http://wiki.apache.org/harmony/Apache_Maven.

--
Leo Li
China Software Development Lab, IBM


Re: [general] Sun will take GPL License?

2006-11-08 Thread Leo Li

Is it a good news for Harmony?

On 11/9/06, Andrew Zhang <[EMAIL PROTECTED]> wrote:



http://www.crn.com/sections/breakingnews/breakingnews.jhtml;?articleId=193600331

--
Best regards,
Andrew Zhang





--
Leo Li
China Software Development Lab, IBM


Re: [classlib]Harmony classlib with J9 VM passes all the tests provided by JUnit4.1

2006-11-03 Thread Leo Li

Ya, I think we can.
I would like the new features in JUnit4, but it is written in a quite
different style from current harmony test codes. Migrate them?
Besides, it is related with the thread of JUnit best practice discussing
now. We need to make a decision since we can merge the task of migration
with the action to enforce JUnit best practice.:)


On 11/4/06, Nathan Beyer <[EMAIL PROTECTED]> wrote:


Assuming we get this functioning, does this mean we can use JUnit 4
testing?

-Nathan

On 11/3/06, Leo Li <[EMAIL PROTECTED]> wrote:
> Hi, all
>  I have just tested JUnit4.1 on Harmony.
>  With J9 VM, harmony passes both on windows xp2 and redhat
enterprise
> 4.0. While drlvm fails on linux, which fails to create new thread
becauseof
> out-of-memory-error. Since it can always be reproduced, I think actually
> system doesnot lack memory at the time. So I reported it as an
> application-oriented bugs as JIRA [1].
>  Besides I have got the time used in these tests which shows there
is
> space for us to improve our performance.
>
>
>
> VM
>
> Windows xp2
>
>   Redhat Enterprise4
>
> RI
>
> 0.985+0.921
>
>   0.75+0.717
>
> J9
>
> 4.25+2.61
>
>   2.888+2.897
>
> drlvm
>
> 8.437+5.359
>
> /
>
> *The former data represents the time to run junit.tests.AllTests The
latter,
> junit.samples.AllTests.
> For detailed information, including how to run tests, I have posted
it
> on Harmony wiki[2].
>
>
>
> [1]http://issues.apache.org/jira/browse/HARMONY-2060
> [2]http://wiki.apache.org/harmony/JUnit
> --
> Leo Li
> China Software Development Lab, IBM
>
>





--
Leo Li
China Software Development Lab, IBM


Re: [classlib]Harmony classlib with J9 VM passes all the tests provided by JUnit4.1

2006-11-03 Thread Leo Li

Oh...
I will try it on another machine on next Monday.
Actually these days I have encountered several similar problems on linux
that can be produce on one machine but not another. Both are related with
thread/process creation and memory...


On 11/3/06, Alexey Varlamov <[EMAIL PROTECTED]> wrote:


Leo,
I've just tried and could not reproduce DRLVM failure (svn = r470676,
(Nov  3 2006), Linux/ia32/gcc 3.3.3, debug build, SUSE9).
I have only JRockit installed and got the following timings:

BEA JRockit 1.5.0
4.6/4.6

Harmony j9
1.4/1.4

Harmony DRLVM (debug)
6.5/6.5


2006/11/3, Leo Li <[EMAIL PROTECTED]>:
> They are the total test run times and I really feel that harmony
launches
> slower than RI. It is the most abvious difference not only from the
above
> result.
> I have once tested the performance about net and the result ensures me
that
> harmony performances almost as good as RI although the test I run cannot
be
> said a formal performance test.:)
>
>
> On 11/3/06, Alexey Varlamov <[EMAIL PROTECTED]> wrote:
> >
> > 2006/11/3, Alexey Petrenko <[EMAIL PROTECTED]>:
> > > More and more good new from day to day :)
> > >
> > > Thanks, Leo!
> > >
> > > SY, Alexey
> > >
> > > 2006/11/3, Leo Li <[EMAIL PROTECTED]>:
> > > > Hi, all
> > > >  I have just tested JUnit4.1 on Harmony.
> > > >  With J9 VM, harmony passes both on windows xp2 and redhat
> > enterprise
> > > > 4.0. While drlvm fails on linux, which fails to create new thread
> > becauseof
> > > > out-of-memory-error. Since it can always be reproduced, I think
> > actually
> > > > system doesnot lack memory at the time. So I reported it as an
> > > > application-oriented bugs as JIRA [1].
> > > >  Besides I have got the time used in these tests which shows
there
> > is
> > > > space for us to improve our performance.
> > > >
> > > > VM
> > > >
> > > > Windows xp2
> > > >
> > > >   Redhat Enterprise4
> > > >
> > > > RI
> > > >
> > > > 0.985+0.921
> > > >
> > > >   0.75+0.717
> > > >
> > > > J9
> > > >
> > > > 4.25+2.61
> > > >
> > > >   2.888+2.897
> > > >
> > > > drlvm
> > > >
> > > > 8.437+5.359
> > > >
> > > > /
> > > >
> > > > *The former data represents the time to run junit.tests.AllTestsThe
> > latter,
> > > > junit.samples.AllTests.
> > > > For detailed information, including how to run tests, I have
> > posted it
> > > > on Harmony wiki[2].
> > > >
> >
> > Looking at this times, I'd say they are mostly about startup time, not
> > steady performance per se. I wonder how different these numbers are
> > for release vs debug builds - guess Leo used debug versions.
> > And surely there are some tricks RI does to achieve this momentary
> > startup - as ClassDataSharing or resident-in-memory VM core after very
> > first start.
> > I eager to anticipate Harmony will compete strongly in this field soon
> > enough.
> >
> >
> > > >
> > > > [1]http://issues.apache.org/jira/browse/HARMONY-2060
> > > > [2]http://wiki.apache.org/harmony/JUnit
> > > > --
> > > > Leo Li
> > > > China Software Development Lab, IBM
> > > >
> > > >
> > >
> >
>
>
>
> --
> Leo Li
> China Software Development Lab, IBM
>
>





--
Leo Li
China Software Development Lab, IBM


Re: [classlib]Harmony classlib with J9 VM passes all the tests provided by JUnit4.1

2006-11-03 Thread Leo Li

They are the total test run times and I really feel that harmony launches
slower than RI. It is the most abvious difference not only from the above
result.
I have once tested the performance about net and the result ensures me that
harmony performances almost as good as RI although the test I run cannot be
said a formal performance test.:)


On 11/3/06, Alexey Varlamov <[EMAIL PROTECTED]> wrote:


2006/11/3, Alexey Petrenko <[EMAIL PROTECTED]>:
> More and more good new from day to day :)
>
> Thanks, Leo!
>
> SY, Alexey
>
> 2006/11/3, Leo Li <[EMAIL PROTECTED]>:
> > Hi, all
> >  I have just tested JUnit4.1 on Harmony.
> >  With J9 VM, harmony passes both on windows xp2 and redhat
enterprise
> > 4.0. While drlvm fails on linux, which fails to create new thread
becauseof
> > out-of-memory-error. Since it can always be reproduced, I think
actually
> > system doesnot lack memory at the time. So I reported it as an
> > application-oriented bugs as JIRA [1].
> >  Besides I have got the time used in these tests which shows there
is
> > space for us to improve our performance.
> >
> > VM
> >
> > Windows xp2
> >
> >   Redhat Enterprise4
> >
> > RI
> >
> > 0.985+0.921
> >
> >   0.75+0.717
> >
> > J9
> >
> > 4.25+2.61
> >
> >   2.888+2.897
> >
> > drlvm
> >
> > 8.437+5.359
> >
> > /
> >
> > *The former data represents the time to run junit.tests.AllTests The
latter,
> > junit.samples.AllTests.
> > For detailed information, including how to run tests, I have
posted it
> > on Harmony wiki[2].
> >

Looking at this times, I'd say they are mostly about startup time, not
steady performance per se. I wonder how different these numbers are
for release vs debug builds - guess Leo used debug versions.
And surely there are some tricks RI does to achieve this momentary
startup - as ClassDataSharing or resident-in-memory VM core after very
first start.
I eager to anticipate Harmony will compete strongly in this field soon
enough.


> >
> > [1]http://issues.apache.org/jira/browse/HARMONY-2060
> > [2]http://wiki.apache.org/harmony/JUnit
> > --
> > Leo Li
> > China Software Development Lab, IBM
> >
> >
>





--
Leo Li
China Software Development Lab, IBM


[classlib]Harmony classlib with J9 VM passes all the tests provided by JUnit4.1

2006-11-02 Thread Leo Li

Hi, all
I have just tested JUnit4.1 on Harmony.
With J9 VM, harmony passes both on windows xp2 and redhat enterprise
4.0. While drlvm fails on linux, which fails to create new thread becauseof
out-of-memory-error. Since it can always be reproduced, I think actually
system doesnot lack memory at the time. So I reported it as an
application-oriented bugs as JIRA [1].
Besides I have got the time used in these tests which shows there is
space for us to improve our performance.



VM

Windows xp2

 Redhat Enterprise4

RI

0.985+0.921

 0.75+0.717

J9

4.25+2.61

 2.888+2.897

drlvm

8.437+5.359

   /

*The former data represents the time to run junit.tests.AllTests The latter,
junit.samples.AllTests.
   For detailed information, including how to run tests, I have posted it
on Harmony wiki[2].



[1]http://issues.apache.org/jira/browse/HARMONY-2060
[2]http://wiki.apache.org/harmony/JUnit
--
Leo Li
China Software Development Lab, IBM


[classlib][luni]HttpURLConnection.getRequestProperty(String) and HttpURLConnection.getRequestProperties() should throw IllegalStateException while connected or not?

2006-11-01 Thread Leo Li

Hi, all

While cleaning the jira 1687, I found that the spec says if connected,
both functions should throw IllegalStateException, while RI throws it in
HttpURLConnection.getRequestProperties()  but
HttpURLConnection.getRequestProperty(String) not.

Although personally I would like not to throw exception in both cases
since it will not do harm to get properties for request after connected, I
will still follow RI although the manner is a little odd if no one objects.


Leo Li
China Software Development Lab, IBM


Re: [classlib]Harmony passes 100% testcases of Tomcat5.5

2006-11-01 Thread Leo Li

Yes, I have posted it on http://wiki.apache.org/harmony/Apache_Tomcat.:)

On 11/1/06, Geir Magnusson Jr. <[EMAIL PROTECTED]> wrote:


Nice!  Post it on the wiki?

Leo Li wrote:
> Hi, all:
>  Harmony now has been able to pass 100% testcases on Tomcat5.5. I
ran
> them both on WindowsXP and Unbuntu, with J9 VM and drlvm.
>  The detailed information about how to build and run tests have been
> put on http://wiki.apache.org/harmony/Apache_Tomcat.
>
> Note:
>  1. Harmony launches slower than RI, so I add the interval between
the
> launch of Tomcat Server and  tests from 8 seconds to 30 seconds to
ensure
> the server has been running.
>  2. Runtime.exec fails on linux with J9 vm, as discussed on[1], so I
> have altered the usage of fork to vfork as a workround despite of the
> possible side-effect of the latter.
> mailing thread
> [1]
>
http://www.mail-archive.com/harmony-dev@incubator.apache.org/msg16002.html





--
Leo Li
China Software Development Lab, IBM


Re: [classlib]Harmony passes 100% testcases of Tomcat5.5

2006-11-01 Thread Leo Li

3754ms on RI versus 5740ms on Harmony to startup Tomcat.
Seems about 50% slower as well.


On 11/1/06, Leo Li <[EMAIL PROTECTED]> wrote:


 I have not got the precise number. I will try it.:)

On 11/1/06, Mikhail Fursov <[EMAIL PROTECTED]> wrote:
>
> Good news! However I never believe in 100% :)
>
> You mentioned that startup with Harmony is slower then RI. I measured
> Eclipse3.1.1 startup some time ago and DRLVM+classlib was ~50% slower (7
> secs against 5 sec with SUN) then RI.
> What are your numbers?
>
> On 11/1/06, Leo Li <[EMAIL PROTECTED] > wrote:
> >
> > Hi, all:
> >   Harmony now has been able to pass 100% testcases on Tomcat5.5. I
> ran
> > them both on WindowsXP and Unbuntu, with J9 VM and drlvm.
> >   The detailed information about how to build and run tests have
> been
> > put on http://wiki.apache.org/harmony/Apache_Tomcat.
> >
> > Note:
> >   1. Harmony launches slower than RI, so I add the interval
> between
> > the
> > launch of Tomcat Server and  tests from 8 seconds to 30 seconds to
> ensure
> > the server has been running.
> >   2. Runtime.exec fails on linux with J9 vm, as discussed on[1],
> so I
> > have altered the usage of fork to vfork as a workround despite of the
> > possible side-effect of the latter.
> > mailing thread
> > [1]
> > http://www.mail-archive.com/harmony-dev@incubator.apache.org/msg16002.html
>
> > --
> > Leo Li
> > China Software Development Lab, IBM
> >
> >
>
>
> --
> Mikhail Fursov
>
>


--
Leo Li
China Software Development Lab, IBM





--
Leo Li
China Software Development Lab, IBM


Re: [classlib]Harmony passes 100% testcases of Tomcat5.5

2006-11-01 Thread Leo Li

I have not got the precise number. I will try it.:)

On 11/1/06, Mikhail Fursov <[EMAIL PROTECTED]> wrote:


Good news! However I never believe in 100% :)

You mentioned that startup with Harmony is slower then RI. I measured
Eclipse3.1.1 startup some time ago and DRLVM+classlib was ~50% slower (7
secs against 5 sec with SUN) then RI.
What are your numbers?

On 11/1/06, Leo Li <[EMAIL PROTECTED]> wrote:
>
> Hi, all:
>   Harmony now has been able to pass 100% testcases on Tomcat5.5. I
ran
> them both on WindowsXP and Unbuntu, with J9 VM and drlvm.
>   The detailed information about how to build and run tests have
been
> put on http://wiki.apache.org/harmony/Apache_Tomcat.
>
> Note:
>   1. Harmony launches slower than RI, so I add the interval between
> the
> launch of Tomcat Server and  tests from 8 seconds to 30 seconds to
ensure
> the server has been running.
>   2. Runtime.exec fails on linux with J9 vm, as discussed on[1], so
I
> have altered the usage of fork to vfork as a workround despite of the
> possible side-effect of the latter.
> mailing thread
> [1]
>
http://www.mail-archive.com/harmony-dev@incubator.apache.org/msg16002.html
> --
> Leo Li
> China Software Development Lab, IBM
>
>


--
Mikhail Fursov





--
Leo Li
China Software Development Lab, IBM


[classlib]Harmony passes 100% testcases of Tomcat5.5

2006-10-31 Thread Leo Li

Hi, all:
 Harmony now has been able to pass 100% testcases on Tomcat5.5. I ran
them both on WindowsXP and Unbuntu, with J9 VM and drlvm.
 The detailed information about how to build and run tests have been
put on http://wiki.apache.org/harmony/Apache_Tomcat.

Note:
 1. Harmony launches slower than RI, so I add the interval between the
launch of Tomcat Server and  tests from 8 seconds to 30 seconds to ensure
the server has been running.
 2. Runtime.exec fails on linux with J9 vm, as discussed on[1], so I
have altered the usage of fork to vfork as a workround despite of the
possible side-effect of the latter.
mailing thread
[1]
http://www.mail-archive.com/harmony-dev@incubator.apache.org/msg16002.html
--
Leo Li
China Software Development Lab, IBM


Re: "ant fetch-depends" while building DRLVM got error

2006-10-26 Thread Leo Li

The filenames in CLASSLIB_ROOT/make/depends.properties has really been
outdated since new snapshots has replaced the original ones.

Maybe you can rewrite the names in the property files as a workaround. For
example, change
yoko-rmi.url=http://people.apache.org/maven-snapshot-repository/org/apache/yoko/yoko-rmi/1.0-incubating-M1-SNAPSHOT/yoko-rmi-1.0-incubating-M1-20060925.152805-3.jar

To
yoko-rmi.url=http://people.apache.org/maven-snapshot-repository/org/apache/yoko/yoko-rmi/1.0-incubating-M1-SNAPSHOT/yoko-rmi-1.0-incubating-M1-20060810.145814-1.jar

We does need a automatic synchronizing mechanism with the outerspace
resources, since it will be a disaster for manually updated the URL of them
to download.


On 10/27/06, Leo Li <[EMAIL PROTECTED]> wrote:


It seems that the jar is not at the URL. I will have a look at the ant
script.:)

On 10/27/06, harmony hla <[EMAIL PROTECTED]> wrote:
>
> Hi guys,
>
>
> I just checked out the trunk of DRLVM and follow the instructions in
> http://incubator.apache.org/harmony/quickhelp_contributors.html.
>
> While I executed "ant fetch-depends" in working_classlib, it dumped the
> following error messages:
>
> 
=
>
>  [get] Error opening connection java.io.FileNotFoundException:
>
> 
http://people.apache.org/maven-snapshot-repository/org/apache/yoko/yoko-spec-corba/1.0-incubating-M1-SNAPSHOT/yoko-spec-corba-1.0-incubating-M1-20060925.152805-4.jar
>  [get] Error opening connection java.io.FileNotFoundException :
> 
http://people.apache.org/maven-snapshot-repository/org/apache/yoko/yoko-spec-corba/1.0-incubating-M1-SNAPSHOT/yoko-spec-corba-1.0-incubating-M1-20060925.152805-4.jar
>
>  [get] Error opening connection java.io.FileNotFoundException:
>
> 
http://people.apache.org/maven-snapshot-repository/org/apache/yoko/yoko-spec-corba/1.0-incubating-M1-SNAPSHOT/yoko-spec-corba-1.0-incubating-M1-20060925.152805-4.jar
> 
=
>
>
> I checked the page at
> 
http://people.apache.org/maven-snapshot-repository/org/apache/yoko/yoko-spec-corba/1.0-incubating-M1-SNAPSHOT/
>
> and only found 
yoko-spec-corba-1.0-incubating-M1-20060810.145814-1.jar<http://people.apache.org/maven-snapshot-repository/org/apache/yoko/yoko-spec-corba/1.0-incubating-M1-SNAPSHOT/yoko-spec-corba-1.0-incubating-M1-20060810.145814-1.jar
> >
> .
>
> What's wrong with trunk? Which revision/branch should I select ?
>
> My system is running suse10 for x86-64, the verson of gcc is 4.0.2.
>
> Thanks.
>
> He Jin
>
>


--
Leo Li
China Software Development Lab, IBM





--
Leo Li
China Software Development Lab, IBM


Re: [classlib][sql]Is it RI's bug about java.sql.Timestamp.compareTo

2006-10-26 Thread Leo Li

Ya, I also recognized it. Harmony's java.util.Date is not the same as that
of java.sql.Timestamp, just following RI.


I think if the toString result is reliable, the compareTo is false. I will
let the compareTo to follow toString since the latter gives detailed
information of the TimeStamp.


On 10/27/06, Andrew Zhang <[EMAIL PROTECTED]> wrote:


Hi Leo,

I think the problem is caused by negative value. java.util.Date and
java.sql.Timestamp handles differently on negative value. Following code
shows the difference:

public static void main(String[] args) {
   Long l1 = Long.MIN_VALUE;
   Long l2 = Long.MIN_VALUE -1;

   Timestamp timestamp1 = new Timestamp(l1);
   Timestamp timestamp2 = new Timestamp(l2);
   Date date1 = new Date(l1);
   Date date2 = new Date(l2);
   System.out.println(timestamp1);
   System.out.println(timestamp2);
   System.out.println(date1);
   System.out.println(date2);
}
The output of RI is:
292278994-08-17 15:12:55.192
292278994-08-17 15:12:55.807
Mon Dec 03 00:47:04 CST 292269055
Sun Aug 17 15:12:55 CST 292278994

Spec doesn't say how to handle negative value. (do i miss something here?)

How would you like to fix this problem?


On 10/27/06, Leo Li <[EMAIL PROTECTED]> wrote:
>
> Hi, all:
> When fixing jira 1703,  I found that at an extreme situation,
> TimeStamp.compareTo behaves differently from its semantic: the time it
> represents:
> Here is the example:
>
> public static void main(String[] args) {
>Long l1 = Long.MIN_VALUE;
>Long l2 = Long.MIN_VALUE -1;
>
>Timestamp timestamp1 = new Timestamp(l1);
>Timestamp timestamp2 = new Timestamp(l2);
>System.out.println(timestamp1);
>System.out.println(timestamp2);
>System.out.println(timestamp1.compareTo(timestamp2));
>}
>
>We get:
>292278994-08-17 15:12:55.192
>292278994-08-17 15:12:55.807
>1
>
>   From the times the timestamps represent, timestamp1 than timestamp2,
> which indicate that timestamp1.compareTo(timestamp2) should be -1, while
> the
> actual result is 1, which indicate the reversed time sequence.
>
>   Furthermore, as the spec says java.sql.Timestamp wraps the
> java.util.Date:"A thin wrapper around java.util.Date that allows the
JDBC
> API to identify this as an SQL TIMESTAMP value. It adds the ability to
> hold
> the SQL TIMESTAMP nanos value and provides formatting and parsing
> operations
> to support the JDBC escape syntax for timestamp values".
>   I apply the same long value to java.util.Date:
>Long l1 = Long.MIN_VALUE;
>Long l2 = Long.MIN_VALUE -1;
>
>Date date1 = new Date(l1);
>Date date2 = new Date(l2);
>System.out.println(date1.compareTo(date2));
> I got -1, which indicate that date1 is earlier than date2 as we
expected.
> The samething happens on java.sql.Date.
>
> If no one objects, I will regard  it as RI's bug and go on with my
patch.
> --
> Leo Li
> China Software Development Lab, IBM
>
>


--
Best regards,
Andrew Zhang





--
Leo Li
China Software Development Lab, IBM


Re: "ant fetch-depends" while building DRLVM got error

2006-10-26 Thread Leo Li

It seems that the jar is not at the URL. I will have a look at the ant
script.:)

On 10/27/06, harmony hla <[EMAIL PROTECTED]> wrote:


Hi guys,


I just checked out the trunk of DRLVM and follow the instructions in
http://incubator.apache.org/harmony/quickhelp_contributors.html.

While I executed "ant fetch-depends" in working_classlib, it dumped the
following error messages:


=
 [get] Error opening connection java.io.FileNotFoundException:

http://people.apache.org/maven-snapshot-repository/org/apache/yoko/yoko-spec-corba/1.0-incubating-M1-SNAPSHOT/yoko-spec-corba-1.0-incubating-M1-20060925.152805-4.jar
 [get] Error opening connection java.io.FileNotFoundException:

http://people.apache.org/maven-snapshot-repository/org/apache/yoko/yoko-spec-corba/1.0-incubating-M1-SNAPSHOT/yoko-spec-corba-1.0-incubating-M1-20060925.152805-4.jar
 [get] Error opening connection java.io.FileNotFoundException:

http://people.apache.org/maven-snapshot-repository/org/apache/yoko/yoko-spec-corba/1.0-incubating-M1-SNAPSHOT/yoko-spec-corba-1.0-incubating-M1-20060925.152805-4.jar

=

I checked the page at

http://people.apache.org/maven-snapshot-repository/org/apache/yoko/yoko-spec-corba/1.0-incubating-M1-SNAPSHOT/
and only found yoko-spec-corba-1.0-incubating-M1-20060810.145814-1.jar<
http://people.apache.org/maven-snapshot-repository/org/apache/yoko/yoko-spec-corba/1.0-incubating-M1-SNAPSHOT/yoko-spec-corba-1.0-incubating-M1-20060810.145814-1.jar
>
.

What's wrong with trunk? Which revision/branch should I select ?

My system is running suse10 for x86-64, the verson of gcc is 4.0.2.

Thanks.

He Jin





--
Leo Li
China Software Development Lab, IBM


[classlib][sql]Is it RI's bug about java.sql.Timestamp.compareTo

2006-10-26 Thread Leo Li

Hi, all:
When fixing jira 1703,  I found that at an extreme situation,
TimeStamp.compareTo behaves differently from its semantic: the time it
represents:
Here is the example:

public static void main(String[] args) {
   Long l1 = Long.MIN_VALUE;
   Long l2 = Long.MIN_VALUE -1;

   Timestamp timestamp1 = new Timestamp(l1);
   Timestamp timestamp2 = new Timestamp(l2);
   System.out.println(timestamp1);
   System.out.println(timestamp2);
   System.out.println(timestamp1.compareTo(timestamp2));
   }

   We get:
   292278994-08-17 15:12:55.192
   292278994-08-17 15:12:55.807
   1

  From the times the timestamps represent, timestamp1 than timestamp2,
which indicate that timestamp1.compareTo(timestamp2) should be -1, while the
actual result is 1, which indicate the reversed time sequence.

  Furthermore, as the spec says java.sql.Timestamp wraps the
java.util.Date:"A thin wrapper around java.util.Date that allows the JDBC
API to identify this as an SQL TIMESTAMP value. It adds the ability to hold
the SQL TIMESTAMP nanos value and provides formatting and parsing operations
to support the JDBC escape syntax for timestamp values".
  I apply the same long value to java.util.Date:
   Long l1 = Long.MIN_VALUE;
   Long l2 = Long.MIN_VALUE -1;

   Date date1 = new Date(l1);
   Date date2 = new Date(l2);
   System.out.println(date1.compareTo(date2));
 I got -1, which indicate that date1 is earlier than date2 as we expected.
The samething happens on java.sql.Date.

 If no one objects, I will regard  it as RI's bug and go on with my patch.
--
Leo Li
China Software Development Lab, IBM


Re: Harmony passes 94% on derby tests.

2006-10-26 Thread Leo Li

So I recommend to delay putting formal derby tests in Harmony project util
they are ported to junit. Since there will be quite some trouble to build
them and to test them. Furthermore, current tests which are large and
compared by console output are not so easy for debugging.:)

Besides, I will put my patch on Harmony wiki page and give some instructions
about how to build and test for those who are interested in this topic right
now.


On 10/26/06, Daniel John Debrunner <[EMAIL PROTECTED]> wrote:


Geir Magnusson Jr. wrote:
> Nice work!
>
> More inline..
>
> Leo Li wrote:
>> 467 Tests Run
>> 94% Pass (443 tests passed)
>> 6% Fail (24 tests failed)
>> 5 Suites skipped
>>
>> The main progress focuses here:
>> 1. Harmony classlib fails to load class when user-defined security
policy
>> exists. It is due to the sequence of library loading of VM, which has
>> been
>> resolved now.
>> 2. A new workround for derby tests which allow useprocess to run test
or
>> else several testcases might fail due to derby lack these tests when
>> useprocess = false.
>> 3. Derby source code uses the version and the name of java vm to
>> decide what
>> to do, while current IBM VM has the version of "1.4.2" and the name of
>> "j9",
>> which has different output on the screen from that of standard RI 1.5.
At
>> the same time Derby test compares the output of the iteractive test
>> scripts
>> to that of expected. I have made some slight modification in its source
>> code, but I have not throughly change this odd behavior, ...,too much:(
>
> Have you approached the derby community with the changes?

Derby is moving to a pure JUnit based world, so it is probably not worth
a lot of effort patching up the old harness to run with Harmony. One of
the reasons to kill the old harness is that how to run with a new vm is
not obvious.

http://wiki.apache.org/db-derby/KillDerbyTestHarness


Dan.





--
Leo Li
China Software Development Lab, IBM


Re: Harmony passes 94% on derby tests.

2006-10-26 Thread Leo Li

Hi, Vladimir:
Sorry for the delay.
I am willing to share my script. It will be great if we can use real
application as a supplement for our testcase.
   But...actually, I am not quite sure about what the script is.:)


On 10/25/06, Vladimir Ivanov <[EMAIL PROTECTED]> wrote:


Excellent!



I have one more idea: we already have buildtest module. Some time ago we
agreed to extends it by coverage and japi scripts (I hope it happens
soon:)
). May be we extend it one more time and store here some scripts for
automatic run of other-projects unit tests? Seems, in this case we can
easily reproduce tests run and enable new platforms.

Of cause, we can not cover all application but we can define some list of
'most important application'.

Is it OK?

Leo, could you share your script for Derby?

Tony, could you share your scripts for ant and log4j?



thanks, Vladimir


PS. The directory structure may be something like that:
builtest
   - trunk
   - cc
   - coverage
   - japi
   - application_test
   - derby
   - ant
   - etc
   - misc (some other scripts)
On 10/25/06, Geir Magnusson Jr. <[EMAIL PROTECTED]> wrote:
>
> Nice work!
>
> More inline..
>
> Leo Li wrote:
> > 467 Tests Run
> > 94% Pass (443 tests passed)
> > 6% Fail (24 tests failed)
> > 5 Suites skipped
> >
> > The main progress focuses here:
> > 1. Harmony classlib fails to load class when user-defined security
> policy
> > exists. It is due to the sequence of library loading of VM, which has
> been
> > resolved now.
> > 2. A new workround for derby tests which allow useprocess to run test
or
> > else several testcases might fail due to derby lack these tests when
> > useprocess = false.
> > 3. Derby source code uses the version and the name of java vm to
decide
> > what
> > to do, while current IBM VM has the version of "1.4.2" and the name of
> > "j9",
> > which has different output on the screen from that of standard RI 1.5.
> At
> > the same time Derby test compares the output of the iteractive test
> scripts
> > to that of expected. I have made some slight modification in its
source
> > code, but I have not throughly change this odd behavior, ...,too
much:(
>
> Have you approached the derby community with the changes?
>
> >
> > Besides, some testcase fails even on RI. I exclude
> > a "derbynetclientmats" test suit since it will hang both RI and
Harmony.
> > Currently all the failure is irrelevant to Harmony. Hope I can find
> > something in the left.
> >
> > I have updated the wiki of derby on Hamony:
> > http://wiki.apache.org/harmony/Apache_Derby.
> >
>





--
Leo Li
China Software Development Lab, IBM


Re: [announcement] Apache Board approved Apache Harmony as a Top Level Project of the ASF

2006-10-25 Thread Leo Li

Congratulations!

On 10/26/06, Xiao-Feng Li <[EMAIL PROTECTED]> wrote:


All my congratulations!!

Thanks,
xiaofeng

On 10/26/06, Geir Magnusson Jr. <[EMAIL PROTECTED]> wrote:
> I am happy to report that the Apache Board was willing to consider our
> proposal and voted to accept it at today's board meeting.
>
> As stated in the Incubation vote, this is a necessary condition for
> graduation from the Incubator.
>
> Therefore, upon a successful outcome of the Incubator PMC vote, we are
> Apache Harmony, project of the Apache Software Foundation!
>
>
>Congratulations to everyone!
>
>
> When the vote is complete, we'll get to work on the transition
> activities, but until then, just give yourself a well-deserved pat on
> the back.
>
> Thanks all!
>
> geir
>
>





--
Leo Li
China Software Development Lab, IBM


Re: [classlib][General]Problem in plug-in dependencies

2006-10-24 Thread Leo Li

Thank you, Nathan. It is ok now.:)

On 10/25/06, Nathan Beyer <[EMAIL PROTECTED]> wrote:


I've updated the build scripts, so the manifests of the source JARs
shouldn't be causing anymore conflicts. Let me know if this fixes the
issue.

-Nathan

On 10/24/06, Nathan Beyer <[EMAIL PROTECTED]> wrote:
> Ouch. Yeah, the source JARs don't need to use the same MANIFEST file.
> I'll take a look at that. This explains some of the issues I've been
> having. Nice catch
>
> -Nathan
>
> On 10/24/06, Leo Li <[EMAIL PROTECTED]> wrote:
> > It seems that eclipse wrongly load the required jar for a certain
bundle,
> > since, for example, luni.jar and luni-src.jar both have the same
manifest in
> > which the jar claims it has the require classes for the bundle and
thus
> > fuddles eclipse. After I have deleted the manifest from the source
jar,
> > every thing recovers. So I recommend to make some modification in
build
> > script not to have source jar also claim exporting packages.
> >
> > On 10/24/06, Leo Li <[EMAIL PROTECTED]> wrote:
> > >
> > > Hi, all:
> > >  After rebuilt current Harmony classlib, I found several source
jars
> > > have replaced the binary jar in the classpath of  plug-in
dependencies, for
> > > example, the nio-char_src.jar instead of nio-char.jar. Thus it lead
to the
> > > failure of project building in eclipse.
> > >
> > > --
> > > Leo Li
> > > China Software Development Lab, IBM
> > >
> >
> >
> >
> > --
> > Leo Li
> > China Software Development Lab, IBM
> >
> >
>





--
Leo Li
China Software Development Lab, IBM


Re: [classlib][General]Problem in plug-in dependencies

2006-10-24 Thread Leo Li

It seems that eclipse wrongly load the required jar for a certain bundle,
since, for example, luni.jar and luni-src.jar both have the same manifest in
which the jar claims it has the require classes for the bundle and thus
fuddles eclipse. After I have deleted the manifest from the source jar,
every thing recovers. So I recommend to make some modification in build
script not to have source jar also claim exporting packages.

On 10/24/06, Leo Li <[EMAIL PROTECTED]> wrote:


Hi, all:
 After rebuilt current Harmony classlib, I found several source jars
have replaced the binary jar in the classpath of  plug-in dependencies, for
example, the nio-char_src.jar instead of nio-char.jar. Thus it lead to the
failure of project building in eclipse.

--
Leo Li
China Software Development Lab, IBM





--
Leo Li
China Software Development Lab, IBM


[classlib][General]Problem in plug-in dependencies

2006-10-23 Thread Leo Li

Hi, all:
After rebuilt current Harmony classlib, I found several source jars
have replaced the binary jar in the classpath of  plug-in dependencies, for
example, the nio-char_src.jar instead of nio-char.jar. Thus it lead to the
failure of project building in eclipse.

--
Leo Li
China Software Development Lab, IBM


Re: [classlib][luni] java.io.File bug?

2006-10-23 Thread Leo Li

Have you tested it on windows, for example, signing in as admin, and the
file which is set read only is still writable?:)

It is always good to follow RI or else we might encounter odd problems in
real applications.

Furthermore, "root" is the concept of OS, so I do not think the role should
be treated specially in the layer of java. We can delegate it to OS service
naturally if possible. I guess RI uses another implementation, for example,
the system call which itself deals with the user account.


On 10/20/06, Spark Shen <[EMAIL PROTECTED]> wrote:


Tony Wu 写道:
> you mean it fails when f.setReadOnly();?
Hi Tony:

No, setReadOnly is used to change the access privilege. After this
change harmony and RI behaves differently.

Best regards
>
> On 10/20/06, Spark Shen <[EMAIL PROTECTED]> wrote:
>> Hi All:
>>
>> When login as 'root' under Linux, the following test case fails on
>> Harmony while passes on RI.
>> public void test_canWrite() throws IOException{
>> File f = File.createTempFile("test", null);
>> f.setReadOnly();
>> assertTrue(f.canWrite());
>> f.deleteOnExit();
>> }
>>
>> I think RI's behavior is more reasonable since the 'root' account does
>> have read/write privilege for temp files. However, Harmony only treats
>> 'root' as ordinary other users.
>> It seems that similar problem happens on java.io.File.canRead().
>>
>> As we all know, File class deals with many different file object on
many
>> different file system, would any one test File behavior on other file
>> systems.
>>
>> Best regards
>>
>> --
>> Spark Shen
>> China Software Development Lab, IBM
>>
>>
>> -
>> Terms of use : http://incubator.apache.org/harmony/mailing.html
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
>
>


--
Spark Shen
China Software Development Lab, IBM


-
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





--
Leo Li
China Software Development Lab, IBM


Harmony passes 94% on derby tests.

2006-10-23 Thread Leo Li

467 Tests Run
94% Pass (443 tests passed)
6% Fail (24 tests failed)
5 Suites skipped

The main progress focuses here:
1. Harmony classlib fails to load class when user-defined security policy
exists. It is due to the sequence of library loading of VM, which has been
resolved now.
2. A new workround for derby tests which allow useprocess to run test or
else several testcases might fail due to derby lack these tests when
useprocess = false.
3. Derby source code uses the version and the name of java vm to decide what
to do, while current IBM VM has the version of "1.4.2" and the name of "j9",
which has different output on the screen from that of standard RI 1.5. At
the same time Derby test compares the output of the iteractive test scripts
to that of expected. I have made some slight modification in its source
code, but I have not throughly change this odd behavior, ...,too much:(

Besides, some testcase fails even on RI. I exclude
a "derbynetclientmats" test suit since it will hang both RI and Harmony.
Currently all the failure is irrelevant to Harmony. Hope I can find
something in the left.

I have updated the wiki of derby on Hamony:
http://wiki.apache.org/harmony/Apache_Derby.

--
Leo Li
China Software Development Lab, IBM


Re: [vote] Graduate Apache Harmony podling from the Incubator

2006-10-20 Thread Leo Li

+1
Let's go further!


On 10/21/06, Geir Magnusson Jr. <[EMAIL PROTECTED]> wrote:


We're trying something a little different.  I think Roy Fielding one
said something along the lines of "when a community gets organized
enough to vote itself out of the Incubator, it's appropriate."

So to bring the Harmony community and the Incubator community together
for this important event in Harmony's life, I'm calling for a vote on
graduating Harmony here on our own -dev list.  The objective is for all
in both the Harmony community and the Incubator community that have an
opinion to vote together, in the same place, and have it "hosted" by the
Harmony podling.

This is an unconventional way to do this, but I think that it's valid
and could provide one example to the Incubator on how it can work going
forward.

So, without any further ado :

[ ] +1 Graduate Apache Harmony from incubation, and let it petition the
board for Top Level Project status

[ ] 0 No opinion

[ ] -1 No, don't graduate Harmony.  Here's why :


This vote will end 72 hours from now + time of Apache mail outage.  It
will therefore end on Monday, October 23, at 3:30 PM eastern, + delta
for mail outage.

Thanks

geir


-
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





--
Leo Li
China Software Development Lab, IBM


Re: [classlib][kernel]A bug or non-bug difference?

2006-10-19 Thread Leo Li

But I do not think it is a bug: It is not prohibited that printStackTrace
can use print instead of println.

I think it is log4j  that inappropriately assumes that println is used in
printStackTrace. :)



On 10/19/06, Andrew Zhang <[EMAIL PROTECTED]> wrote:


On 10/19/06, Tony Wu <[EMAIL PROTECTED]> wrote:
>
> Hi all,
> please note that the Throwable is a kernel class. It comes with VME.


Then let's report it as IBM VME bug. (Oliver should be interested?)

I checked DRLVM Throwable#printStackTrace(PrintStream) implementation[1].
It's ok and prints "println" as well. So we needn't fix anything here. :)

[1]
public void printStackTrace(PrintStream ps) {
ps.println(makeThrowableString());
}

On 10/19/06, Andrew Zhang <[EMAIL PROTECTED]> wrote:
> > On 10/19/06, Tony Wu <[EMAIL PROTECTED]> wrote:
> > >
> > > I've tried Log4j on Harmony and found there are many failures caused
> > > by one difference between RI and Harmony. The
> > > Throwable.printStackTrace(PrintWriter) calls the *println* method of
> > > PrinterWriter on RI whereas calls *print* twice(Obviously print
> > > msssage then print a line separator) on Harmony. It will cause
> > > different behavior when a user inherit the PrinterWriter and
override
> > > these two methods. Shall we fix it or leave as an non-bug
difference?
> >
> >
> > For this case, RI doesn't conflict with spec, and is reasonable, so I
> think
> > we'd better follow RI.  Additionally, log4j has shown its dependency
of
> this
> > feature!
> >
> > refer to testcase below,
> > >
> > > public class TestThrow {
> > >public static void main(String[] args) {
> > >MyWriter mw = new MyWriter(System.out);
> > >Throwable throwable = new Exception("Just Testing");
> > >throwable.printStackTrace(mw);
> > >}
> > > }
> > > class MyWriter extends PrintWriter {
> > >public MyWriter(OutputStream out) {
> > >super(out);
> > >}
> > >
> > >public void print(String s) {
> > >System.out.println("print");
> > >}
> > >
> > >public void println(String s) {
> > >System.out.println("println");
> > >}
> > > }
> > > OUTPUTS:
> > > RI
> > > println
> > > HARMONY
> > > print
> > > print
> > >
> > > --
> > > Tony Wu
> > > China Software Development Lab, IBM
> > >
> > >
-
> > > Terms of use : http://incubator.apache.org/harmony/mailing.html
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail:
[EMAIL PROTECTED]
> > >
> > >
> >
> >
> > --
> > Best regards,
> > Andrew Zhang
> >
> >
>
>
> --
> Tony Wu
> China Software Development Lab, IBM
>
> -
> Terms of use : http://incubator.apache.org/harmony/mailing.html
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


--
Best regards,
Andrew Zhang





--
Leo Li
China Software Development Lab, IBM


Re: [classlib][archive]Security policy leads to vm crashes in loading class of JarFile

2006-10-18 Thread Leo Li

It is ok if we have made a decision.
I just want to avoid adding more contract between classlib and vm, for
example, the vm have to read some property files or other ways.:)

On 10/19/06, Alexey Varlamov <[EMAIL PROTECTED]> wrote:


2006/10/19, Leo Li <[EMAIL PROTECTED]>:
> But there really contains code about launcher in Harmony/luni, and this
> part is maintained by Harmony classlib but not VM. :)
Um, I thought all Harmony code is maintained by us community ;)
As discussed in an older thread, launcher will be moved to "tools" some
day.

>
> On 10/19/06, Alexey Varlamov <[EMAIL PROTECTED]> wrote:
> >
> > 2006/10/19, Leo Li <[EMAIL PROTECTED]>:
> > >  It is quite a dilemma: VM is free to choose the strategy of loading
> > library
> > > while the sequence is related to classlib.
> > >  In my opinion, it is classlib that has enough information and the
> > > responsibility to decide the library loading sequence.
> > >  Since the launcher is in the control of classlib, is it possible
that
> > after
> > > getting the JavaVM, manually load the required library then run the
main
> > > method?
> >
> > Nope, the launcher is not a part of classlib and will not present in
> > all configurations (e.g. browser plugin or direct use of Invocation
> > API).
> > IMHO #3 is too crooked therefore inacceptable, and indeed we have to
> > state a VMI contract for loading natives needed by classlib: #1, #4 or
> > some other. I may suggest:
> > 5. Reuse "bootclasspath.properties" solution. That is, there is always
> > mandatory hyluni lib, which can set up some property value indicating
> > a list of required libraries - as it is done now for bootclasspath
> > jars. After loading hyluni and calling its JNI_OnLoad, VM can read
> > this list and load other libs.
> >
> > NB. Currently DRLVM follows #1, that's why it works.
> >
> > >
> > >
> > > On 10/18/06, Paulex Yang <[EMAIL PROTECTED]> wrote:
> > > >
> > > > Alexey Varlamov wrote:
> > > > > Can't we use lazy initialization here? I had similar experience
with
> > > > > this class in the past, and think it should not be so fragile to
> > > > > initialization sequence. And definitely it should not affect
whole
> > VM
> > > > > run.
> > > > Hmm...lazily loading for Msg class is good, but I'm afraid it's
not
> > the
> > > > "sweet point" of this problem, because in this case, the exception
is
> > > > *really* thrown by j.n.URL, so that you cannot avoid loading
resource
> > > > bundle(btw, I just found that the full stacktrace hasn't been
pasted
> > > > yet[1]).  lI suspect the issue is that the hyarchive.dll/so has
not
> > been
> > > > loaded yet when this exception happens, so I added this line to
the
> > > > static initialization part of ZipFile
> > > >
> > > >static {
> > > > +System.loadLibrary("hyarchive"); //$NON-NLS-1$
> > > >ntvinit();
> > > >}
> > > >
> > > > The test codes pass happily. I want to commit this as work around
if
> > no
> > > > one objects, but I still think a general solution for this kind of
> > issue
> > > > is necessary. There are several classes in archive module need
native
> > > > library, Adler32, CRC32, Deflater, Inflater and ZipFile, only
> > explicitly
> > > > load hyarchive here cannot guarantee bug free, and some other
modules
> > > > (nio, text etc) have same risk. I have some proposals:
> > > >
> > > > 1. Load classlib native libraries as early as possible in VM, as
what
> > we
> > > > do for hyluni, this is safe but the concern is all the Harmony
> > > > compatible VM needs to do this, unacceptable.
> > > > 2. Load them early enough, like what we do now in IBM VME, the
> > hyarchive
> > > > is loaded during j.l.System static init, it was considered early
> > enough,
> > > > but sadly this case shows that we cannot image all cases, even for
a
> > > > relative general case
> > > > 3. Create an init class like below, and all classes needs native
> > library
> > > > must load this init class at first, this works but works in ugly
> > way...
> > > >   public class Init{
> > > >  static{
> > > > System.loadLibrary("blabla");
> > > &g

Re: [classlib][archive]Security policy leads to vm crashes in loading class of JarFile

2006-10-18 Thread Leo Li

But there really contains code about launcher in Harmony/luni, and this
part is maintained by Harmony classlib but not VM. :)

On 10/19/06, Alexey Varlamov <[EMAIL PROTECTED]> wrote:


2006/10/19, Leo Li <[EMAIL PROTECTED]>:
>  It is quite a dilemma: VM is free to choose the strategy of loading
library
> while the sequence is related to classlib.
>  In my opinion, it is classlib that has enough information and the
> responsibility to decide the library loading sequence.
>  Since the launcher is in the control of classlib, is it possible that
after
> getting the JavaVM, manually load the required library then run the main
> method?

Nope, the launcher is not a part of classlib and will not present in
all configurations (e.g. browser plugin or direct use of Invocation
API).
IMHO #3 is too crooked therefore inacceptable, and indeed we have to
state a VMI contract for loading natives needed by classlib: #1, #4 or
some other. I may suggest:
5. Reuse "bootclasspath.properties" solution. That is, there is always
mandatory hyluni lib, which can set up some property value indicating
a list of required libraries - as it is done now for bootclasspath
jars. After loading hyluni and calling its JNI_OnLoad, VM can read
this list and load other libs.

NB. Currently DRLVM follows #1, that's why it works.

>
>
> On 10/18/06, Paulex Yang <[EMAIL PROTECTED]> wrote:
> >
> > Alexey Varlamov wrote:
> > > Can't we use lazy initialization here? I had similar experience with
> > > this class in the past, and think it should not be so fragile to
> > > initialization sequence. And definitely it should not affect whole
VM
> > > run.
> > Hmm...lazily loading for Msg class is good, but I'm afraid it's not
the
> > "sweet point" of this problem, because in this case, the exception is
> > *really* thrown by j.n.URL, so that you cannot avoid loading resource
> > bundle(btw, I just found that the full stacktrace hasn't been pasted
> > yet[1]).  lI suspect the issue is that the hyarchive.dll/so has not
been
> > loaded yet when this exception happens, so I added this line to the
> > static initialization part of ZipFile
> >
> >static {
> > +System.loadLibrary("hyarchive"); //$NON-NLS-1$
> >ntvinit();
> >}
> >
> > The test codes pass happily. I want to commit this as work around if
no
> > one objects, but I still think a general solution for this kind of
issue
> > is necessary. There are several classes in archive module need native
> > library, Adler32, CRC32, Deflater, Inflater and ZipFile, only
explicitly
> > load hyarchive here cannot guarantee bug free, and some other modules
> > (nio, text etc) have same risk. I have some proposals:
> >
> > 1. Load classlib native libraries as early as possible in VM, as what
we
> > do for hyluni, this is safe but the concern is all the Harmony
> > compatible VM needs to do this, unacceptable.
> > 2. Load them early enough, like what we do now in IBM VME, the
hyarchive
> > is loaded during j.l.System static init, it was considered early
enough,
> > but sadly this case shows that we cannot image all cases, even for a
> > relative general case
> > 3. Create an init class like below, and all classes needs native
library
> > must load this init class at first, this works but works in ugly
way...
> >   public class Init{
> >  static{
> > System.loadLibrary("blabla");
> >  }
> >   }
> >   public class SomeClassNeedsNative{
> >  static{
> > Class.forName("Init"); // the class loading should only
> > happen once so that the native library is loaded only once.
> >  }
> >   }
> > 4. Produce some contract like Jar_OnLoad() which is described in
> > MANIFEST.MF, so that any class loader loading the jar at first time
will
> > execute that method, like JNI_OnLoad or so. This solution seems
general
> > and elegant, but needs yet another agreement between Harmony VM and
> > classlib, further it may make the jar not compatible with other VM.
> >
> > Comments? More ideas?
> >
> > [1] java.lang.UnsatisfiedLinkError: java/util/zip/ZipFile.ntvinit()V
> >at java.util.zip.ZipFile.(ZipFile.java:50)
> >at java.lang.J9VMInternals.initializeImpl(Native Method)
> >at java.lang.J9VMInternals.initialize(J9VMInternals.java:177)
> >at java.lang.J9VMInternals.initialize(J9VMInternals.java:144)
> >at
> > com.ibm.oti.vm.AbstractClassLoader.fillCache(AbstractClassLoader.java
:95)
> >at
> > com.ibm.oti.vm.Abst

Re: [classlib][archive]Security policy leads to vm crashes in loading class of JarFile

2006-10-18 Thread Leo Li
.getPolicy(Policy.java:132)
   at org.apache.harmony.luni.util.PriviAction.run(PriviAction.java:133)
   at
java.security.AccessController.doPrivileged(AccessController.java:179)
   at java.lang.System.setSecurityManager(System.java:825)
   at java.lang.System.installSecurityManager(System.java:155)
   at java.lang.System.completeInitialization(System.java:117)
   at java.lang.Thread.(Thread.java:129)
>
> 2006/10/18, Paulex Yang <[EMAIL PROTECTED]>:
>> A little further hack shows that, the cause is o.a.h.luni.util.Msg
>> cannot be initialized so early, which is the exception message i18n
>> helper class. Its static init codes try to load ResourceBundle but
>> failed. The new i18n helper o.a.h.l.internal.nls.Messages has same
>> issue. I modified the java.net.URL ln.296 as below, and the test
passed.
>> -throw new MalformedURLException(
>> -org.apache.harmony.luni.util.Msg.getString(
>> -        "K00d8", spec)); //$NON-NLS-1$
>> +   throw new MalformedURLException("exception message
>> here");
>>
>> Leo Li wrote:
>> > Hi, all:
>> > During the self-hosting of Derby, I found a security policy  if
is
>> > applied will lead to errors in loading the class of JarFile. IBM vm
>> > will throw java/lang/UnsatisfiedLinkError: java/util/zip/ZipFile.ntvi
>> > while
>> > drlvm will crash with "SEH handler: shutdown errorSEH handler: too
>> many
>> > shutdown errors..."
>> >
>> > Here is the testcase:
>> >
>> >
>> > import java.util.jar.*;
>> > public class TestJarFile {
>> >
>> > public static void main(String[] args) throws Exception{
>> >  System.out.println(JarFile.CENATT);
>> >   }
>> >
>> > }
>> >
>> > And the attachment is the derby_tests.policy.
>> >
>> > Then run:
>> >
>> > java -Djava.security.manager
>> > -Djava.security.policy=derby_tests.policyTestJarFile
>> >
>> > Run passes,
>> >
>> > Harmony on IBM VM fails with java/lang/UnsatisfiedLinkError:
>> > java/util/zip/ZipFile.ntvi
>> >
>> > Harmony on Drlvm fails with SEH handler: shutdown errorSEH handler:
>> > too many
>> > shutdown errors
>> >
>> > If the security manager is not specified, Harmony passes.
>> >
>> >
>>
>>
>> --
>> Paulex Yang
>> China Software Development Lab
>> IBM
>>
>>
>> -
>> Terms of use : http://incubator.apache.org/harmony/mailing.html
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
>
> -
> Terms of use : http://incubator.apache.org/harmony/mailing.html
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


--
Paulex Yang
China Software Development Lab
IBM



-
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





--
Leo Li
China Software Development Lab, IBM


Re: [classlib]Harmony passes 73% on Derby.

2006-10-18 Thread Leo Li

Hi, all:
One thing to correct:
Occasionally,  I found that the decreased rate of pass is mainly due to
the wrongly stastics that derby team uses in tests.
The number of failed tests are calculated by the lines of a fail file,
whereas several failed tests with error message uses two lines !!!
After some tedious manual work, the passing rate is actually about 80%,
with 110 fails and 428 passses.:)



On 10/17/06, Sian January <[EMAIL PROTECTED]> wrote:


Hi Leo,

I have had a look at your patch and it looks fine.  I have also run the
tests once or twice since April when I first did it and I saw a lower pass
rate too, so I don't think you've done anything wrong.  I did run fewer
tests in April as I think I was using a 1.4 target, but even so there are
still fewer passes in total (437 in April vs. 428 now) so I think there
must
have been some changes in Harmony to cause this.

Regards,

Sian


On 17/10/06, Leo Li <[EMAIL PROTECTED]> wrote:
>
> Hi, all:
>  I have ran the tests of Derby on Harmony, both on windows xp and
> ubuntu. The result is similar.
>
>On windows,
> 579 Tests Run
> 73% Pass (428 tests passed)
> 27% Fail (151 tests failed)
> 9 Suites skipped
>On linux,
> 579 Tests Run
> 74% Pass (430 tests passed)
>26% Fail (149 tests failed)
>9 Suites skipped
>
>  The result seems a little frustrating since Sian had 82% passed
> several months before. The version of derby I ran is at revision 464429.
> The lost passing rate may be due to the modified code and added
testcases.
>
>  To Sian: I made a new patch in the attachment which is an updated
> version of the patch Sian provides. I will be appreciate if Sian helps
to
> check its validity and thus I will be assured that the lost passing rate
is
> irrelevant to our modification.
>
>  When I can confirm everything is all right, I will then put the
> ongoing progress result on Harmony's wiki page.
>
>  Thank you.
>
> --
> Leo Li
> China Software Development Lab, IBM
>
> -
> Terms of use : http://incubator.apache.org/harmony/mailing.html
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>


--
Sian January

IBM Java Technology Centre, UK





--
Leo Li
China Software Development Lab, IBM


Re: [classlib]Harmony passes 73% on Derby.

2006-10-17 Thread Leo Li

Mikhail, unfortunately derby test cannot run on drlvm.

An assert fail exception will be thrown out.

I have talked about it in another thread
http://www.mail-archive.com/harmony-dev@incubator.apache.org/msg15643.html
and raised jira as 1836.

On 10/17/06, Mikhail Fursov <[EMAIL PROTECTED]> wrote:


Leo, just a simple interest, could you try to run harmony with -Xem:opt,
-Xem:jet, -Xem:server, -Xem:server_static options? These are all modes
drlvm
supports today except the default one (-Xem:client)

For example if the test passes with Jitrino.JET (-Xem:jet) and fails with
Jitrino.OPT (-Xem:opt) this is a good candidate for JIT bug

On 10/17/06, Leo Li <[EMAIL PROTECTED]> wrote:
>
> Hi,
> The result of Derby is not so obvious, since its test is not junit
but
> some a serial of stand-alone java program calling each other. And the
> comparing result is a pre-stored data file. So I have to use sometime to
> set
> aside all the irrelevant code to spot those related with Harmony
classlib.
> What makes things worse is that as a product, all the exception has
> been
> caught...
> Is there someone who has good idea to pick up problem quickly in
this
> issue?
>
>
> On 10/17/06, Nathan Beyer <[EMAIL PROTECTED]> wrote:
> >
> > Are there any obvious bugs in Harmony that are of note? Perhaps some
> > unexpected NPEs?
> >
> > On 10/16/06, Leo Li <[EMAIL PROTECTED]> wrote:
> > > Hi, all:
> > >  I have ran the tests of Derby on Harmony, both on windows xp
and
> > > ubuntu. The result is similar.
> > >
> > >On windows,
> > > 579 Tests Run
> > > 73% Pass (428 tests passed)
> > > 27% Fail (151 tests failed)
> > > 9 Suites skipped
> > >On linux,
> > > 579 Tests Run
> > > 74% Pass (430 tests passed)
> > >26% Fail (149 tests failed)
> > >9 Suites skipped
> > >
> > >  The result seems a little frustrating since Sian had 82% passed
> > several
> > > months before. The version of derby I ran is at revision 464429. The
> > lost
> > > passing rate may be due to the modified code and added testcases.
> > >
> > >  To Sian: I made a new patch in the attachment which is an
updated
> > > version of the patch Sian provides. I will be appreciate if Sian
helps
> > to
> > > check its validity and thus I will be assured that the lost passing
> rate
> > is
> > > irrelevant to our modification.
> > >
> > >  When I can confirm everything is all right, I will then put the
> > ongoing
> > > progress result on Harmony's wiki page.
> > >
> > >  Thank you.
> > >
> > > --
> > > Leo Li
> > > China Software Development Lab, IBM
> > >
-
> > > Terms of use :
> > > http://incubator.apache.org/harmony/mailing.html
> > > To unsubscribe, e-mail:
> > > [EMAIL PROTECTED]
> > > For additional commands, e-mail:
> > > [EMAIL PROTECTED]
> > >
> > >
> > >
> >
> > -
> > Terms of use : http://incubator.apache.org/harmony/mailing.html
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>
>
> --
> Leo Li
> China Software Development Lab, IBM
>
>


--
Mikhail Fursov





--
Leo Li
China Software Development Lab, IBM


Re: [classlib][luni]Runtime.exec fails on Linux

2006-10-17 Thread Leo Li

Hi, Alexey:
 Thank you.
 I have started to build the system.
 Besides, I think the problem is not related to classlib. Since I have
let fork called in a native function, but it fails on J9.

On 10/17/06, Alexey Varlamov <[EMAIL PROTECTED]> wrote:


This is due to incorrect classlib location specified. Please ensure
you provide correct (better absolute) path in build\drlvm.properties
(if you use it) or "external.dep.CLASSLIB.loc" property value in
cmdline:
sh build.sh -Dexternal.dep.CLASSLIB.loc=$classlib
This should point to the root of (pre-)built classlib WS.

2006/10/17, Leo Li <[EMAIL PROTECTED]>:
> Hi, all:
> I tried to build drlvm on linux, but when build update, it reports
such
> error:
>
> [echo] downloading XALAN from no_settings_in_config_or_environment
> [echo] no_settings_in_config_or_environment
>
> BUILD FAILED
> /root/workspaces/workspace/drlvm/build/make/build.xml:240: The following
> error occurred while executing this line:
> /root/workspaces/workspace/drlvm/build/make/setup.xml:273: The following
> error occurred while executing this line:
> /root/workspaces/workspace/drlvm/build/make/setup.xml:275: The following
> error occurred while executing this line:
> /root/workspaces/workspace/drlvm/build/make/setup.xml:442: Warning:
Could
> not find file
>
/root/workspaces/workspace/drlvm/build/make/no_settings_in_config_or_environment
> to copy.
>
> How can I do with it?
> Thanks.
>
>
>
> On 10/17/06, Alexey Varlamov <[EMAIL PROTECTED]> wrote:
> >
> > 2006/10/16, Leo Li <[EMAIL PROTECTED]>:
> > > It seems not quite related to actual memory stress although the
reported
> > > error is ENOMEM.
> > > I have run it both in eclipse and console. And there are enough
memory
> > > available.
> > >
> > > Furthermore, the case can be repeated even though in the same time a
C
> > > program runs well when using fork().
> > >
> > > I suspect that it is related with VM since it can be only reproduced
by
> > VM
> > > calling it. I am not sure whether vm does something behind me, but I
> > have
> > > not thought out of a way that a user-space program have such
effect.:)
> > >
> > Actually drlvm provides own impl of j.l.Process. Interesting, would it
> > work if switched to classlib's impl - then this should be process impl
> > issue. Could you please try the following patch with DRLVM and see if
> > it works?
> >
> > Index: vm/vmcore/src/kernel_classes/javasrc/java/lang/Runtime.java
> > ===
> > --- vm/vmcore/src/kernel_classes/javasrc/java/lang/Runtime.java
> > (revision 464817)
> > +++ vm/vmcore/src/kernel_classes/javasrc/java/lang/Runtime.java
(working
> > copy)
> > @@ -743,14 +743,15 @@
> >  //#IN004# Should we check: envp != null ?
> >  //#IN004# Should we check envp's direction values: envp[i] !=
> > null ?
> >
> > -String dirPathName = (dir != null ? dir.getPath() : null);
> > +//String dirPathName = (dir != null ? dir.getPath() : null);
> >
> > -SubProcess sp = new SubProcess();
> > +//SubProcess sp = new SubProcess();
> >
> > -sp.execVM(cmdarray, envp, dirPathName);
> > +//sp.execVM(cmdarray, envp, dirPathName);
> >
> > -return sp;
> > -
> > +//return sp;
> > +return org.apache.harmony.luni.internal.process.SystemProcess
.
> > + create(cmdarray, envp == null ? new String[0] : envp,
dir);
> >  }
> >
> >
> > --
> > Alexey
> >
> > >
> > > On 10/16/06, Geir Magnusson Jr. <[EMAIL PROTECTED]> wrote:
> > > >
> > > > I'm confused.  Didn't you just report this on Ubuntu?
> > > >
> > > > I have had similar forking problems on Ubuntu 6 (I once found a
bug in
> > > > classlib related to forking...).
> > > >
> > > > I never figured out why Unbuntu does this, but it seemed that
under
> > > > memory stress, Ubuntu's fork() fails.  Try this - close Eclipse
and
> > run
> > > > the test again...
> > > >
> > > > geir
> > > >
> > > >
> > > > Leo Li wrote:
> > > > > Thank you.
> > > > > I have just run it on drlvm of unbuntu, it works.
> > > > > What a qurious problem!
> > > > >
> > > > >
> > > > > On 10/16/06, Alexey Varlamov <[EMAIL PROTECTED]>
wrote:
> > > &

Re: [classlib][luni][charset]Strange behavior of UnicodeBig

2006-10-17 Thread Leo Li

I think Harmony is more reasonable.

As spec says, if  Charset.forName("UnicodeBig") throws
.UnsupportedCharsetException then no support for the named charset is
available in this instance of the Java virtual machine. Then how can we get
new String(b, "UnicodeBig") without throwing UnsupportedCharsetException on
the same jvm? The spec for String(byte[] bytes,String charsetName) also says
if the named charset is not supported, UnsupportedCharsetException should be
thrown out.



On 10/17/06, Tony Wu <[EMAIL PROTECTED]> wrote:


Hi all,
I found this when I tried to debug the failure tests of ant on
harmony. Note the output of testcases below.

import java.io.UnsupportedEncodingException;
import java.nio.charset.Charset;
import junit.framework.TestCase;

public class TestCharset extends TestCase {
   public void test1() throws UnsupportedEncodingException {
   byte[] b = new byte[] { 'a', 'b', 'c' };
   String s = new String(b, "UnicodeBig");
   assertEquals("abc", s);
   }

   public void test2() {
   Charset.forName("UnicodeBig");
   }
}

RI:
test1: junit.framework.ComparisonFailure: expected: but was:<>
test2: java.nio.charset.UnsupportedCharsetException: UnicodeBig

Harmony:
test1:java.nio.charset.UnsupportedCharsetException: UnicodeBig
test2:
java.nio.charset.UnsupportedCharsetException: The unsupported charset
name is "UnicodeBig"

seems RI can recognize the *UnicodeBig* in Constructor of j.l.String,
whereas Harmony does not support this alias at all.

Do you have any concern about that?
--
Tony Wu
China Software Development Lab, IBM

-
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





--
Leo Li
China Software Development Lab, IBM


Re: [classlib][luni]Runtime.exec fails on Linux

2006-10-16 Thread Leo Li

Hi, all:
I tried to build drlvm on linux, but when build update, it reports such
error:

[echo] downloading XALAN from no_settings_in_config_or_environment
[echo] no_settings_in_config_or_environment

BUILD FAILED
/root/workspaces/workspace/drlvm/build/make/build.xml:240: The following
error occurred while executing this line:
/root/workspaces/workspace/drlvm/build/make/setup.xml:273: The following
error occurred while executing this line:
/root/workspaces/workspace/drlvm/build/make/setup.xml:275: The following
error occurred while executing this line:
/root/workspaces/workspace/drlvm/build/make/setup.xml:442: Warning: Could
not find file
/root/workspaces/workspace/drlvm/build/make/no_settings_in_config_or_environment
to copy.

How can I do with it?
Thanks.



On 10/17/06, Alexey Varlamov <[EMAIL PROTECTED]> wrote:


2006/10/16, Leo Li <[EMAIL PROTECTED]>:
> It seems not quite related to actual memory stress although the reported
> error is ENOMEM.
> I have run it both in eclipse and console. And there are enough memory
> available.
>
> Furthermore, the case can be repeated even though in the same time a C
> program runs well when using fork().
>
> I suspect that it is related with VM since it can be only reproduced by
VM
> calling it. I am not sure whether vm does something behind me, but I
have
> not thought out of a way that a user-space program have such effect.:)
>
Actually drlvm provides own impl of j.l.Process. Interesting, would it
work if switched to classlib's impl - then this should be process impl
issue. Could you please try the following patch with DRLVM and see if
it works?

Index: vm/vmcore/src/kernel_classes/javasrc/java/lang/Runtime.java
===
--- vm/vmcore/src/kernel_classes/javasrc/java/lang/Runtime.java
(revision 464817)
+++ vm/vmcore/src/kernel_classes/javasrc/java/lang/Runtime.java (working
copy)
@@ -743,14 +743,15 @@
 //#IN004# Should we check: envp != null ?
 //#IN004# Should we check envp's direction values: envp[i] !=
null ?

-String dirPathName = (dir != null ? dir.getPath() : null);
+//String dirPathName = (dir != null ? dir.getPath() : null);

-SubProcess sp = new SubProcess();
+//SubProcess sp = new SubProcess();

-sp.execVM(cmdarray, envp, dirPathName);
+//sp.execVM(cmdarray, envp, dirPathName);

-return sp;
-
+//return sp;
+return org.apache.harmony.luni.internal.process.SystemProcess.
+ create(cmdarray, envp == null ? new String[0] : envp, dir);
 }


--
Alexey

>
> On 10/16/06, Geir Magnusson Jr. <[EMAIL PROTECTED]> wrote:
> >
> > I'm confused.  Didn't you just report this on Ubuntu?
> >
> > I have had similar forking problems on Ubuntu 6 (I once found a bug in
> > classlib related to forking...).
> >
> > I never figured out why Unbuntu does this, but it seemed that under
> > memory stress, Ubuntu's fork() fails.  Try this - close Eclipse and
run
> > the test again...
> >
> > geir
> >
> >
> > Leo Li wrote:
> > > Thank you.
> > > I have just run it on drlvm of unbuntu, it works.
> > > What a qurious problem!
> > >
> > >
> > > On 10/16/06, Alexey Varlamov <[EMAIL PROTECTED]> wrote:
> > >>
> > >> Both DRLVM and J9 works for me (SUSE9).
> > >>
> > >> --
> > >> Alexey
> > >>
> > >> 2006/10/16, Leo Li <[EMAIL PROTECTED]>:
> > >> > Hi, all:
> > >> > The harmony Runtime.exec fails on Linux with ENOMEM.
> > >> > Here is the testcase:
> > >> >
> > >> > public class Exec {
> > >> >public static void main(String[] args) throws Exception {
> > >> >
> > >> >   Runtime.getRuntime().exec("ls");}
> > >> > }
> > >> >
> > >> >I have tried it on RedHat Enterprise 4 and Unbuntu, both get
> > ENOMEM
> > >> in
> > >> > native code.
> > >> >
> > >> >After digging into it, I found it fails in procimpl.c, line
135:
> > >> >
> > >> >grdpid = fork ();
> > >> >
> > >> >If the call to fork is changed to vfork, the testcase will
pass
> > but
> > >> > still get exitcode = 1 which indicates that some error has
happened.
> > >> The
> > >> > difference between fork and vfork is just whether page tables is
> > copied
> > >> to
> > >> > child process or not. But I do not think it is the main cause.
> > 

Re: [announce] New Apache Harmony Committers : Oliver Deakin, Richard Liang, Alexey Petrenko, Gregory Shimansky, Alexey Varlamov, Alexei Zakharov

2006-10-16 Thread Leo Li

Congratulations!

On 10/17/06, Geir Magnusson Jr <[EMAIL PROTECTED]> wrote:


Please join the Apache Harmony PPMC in welcoming the project's newest
committers, in alphabetical order  :

Oliver Deakin
Richard Liang
Alexey Petrenko
Gregory Shimansky
Alexey Varlamov
Alexei Zakharov

These six individuals have shown sustained dedication to the project, an
ability to work well with others, and share the common vision we have
for Harmony. We all continue to expect great things from them.

Gentlemen, you don't have accounts yet.  When you finally receive your
new committer account information, as a first step to test your almighty
powers of committitude, please update the committers page on the
website.  That should be a good  (and harmless) exercise to test if
everything is working.

Things to do :

1) test ssh-ing to the server people.apache.org.
2) Change your login password on the machine
3) Add a public key to .ssh so you can stop using the password
4) Set your SVN password  : just type 'svnpasswd'

At this point, you should be good to go.  Checkout the website from svn
and update it.  See if you can figure out how.

Also, anything checked out of SVN, be sure that you have checked out via
'https' and not 'http' or you can't check in. You can switch using "svn
switch". (See the manual)

Finally, although you now have the ability to commit, please remember :

1) continue being as transparent and communicative as possible.  You
earned committer status in part because of your engagement with others.
While it was a  "have to" situation because you had to submit patches
and defend them, but we believe it is a "want to".  Community is the key
to any Apache project.

2)We don't want anyone going off and doing lots of work locally, and
then committing.  Committing is like voting in Chicago - do it early and
often.  Of course, you don't want to break the build, but keep the
"commit bombs" to an absolute minimum, and warn the community if you are
going to do it - we may suggest it goes into a branch at first.  Use
branches if you need to.

3) Always remember that you can **never** commit code that comes from
someone else, even a co-worker.  All code from someone else must be
submitted by the copyright holder (either the author or author's
employer, depending) as a JIRA, and then follow up with the required
ACQs and BCC.

Again, thanks for your hard work so far, and welcome.

The Apache Harmony PPMC



-
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





--
Leo Li
China Software Development Lab, IBM


Re: [build] build failed with latest harmony classlib

2006-10-16 Thread Leo Li

Hi, Nathan:
I also encountered the problem this morning. After some study, I found
the method which compiler calls ""undefined" really exists there.  And the
fact that we uses a new compiler of eclipse today. Thus I think of the
options we need to set in eclipse to develop Harmony or else the build will
fail:
Eclpise ->Compiler->Building->Build Path Problems ->Circular Dependency
= warning
Eclpise ->Compiler->Building->Build Path Problems ->Incomplete Build
Path = warning
Eclipse->Plug- in Development->Compilers->Unresolved Dependency =
warning.

I think it is related to the behavior of  eclipse compiler.:)

On 10/17/06, Nathan Beyer <[EMAIL PROTECTED]> wrote:


On 10/16/06, Leo Li <[EMAIL PROTECTED]> wrote:
> Seems we use a new compiler today.:)
>
> The first problem Andrew encountered is quite like the unresolved
dependency
> in eclipse's compiler option which is manually set off by us.  I do not
know
> whether it should be  or how can be turned off in current Harmony build
> system.

Can you expand on this comment? Have you seen this before?

>
> Besides, after I clean the project, build succeeds.
>
> To Andrew:
> Maybe you can roll back the build script to use old javac to see
whether
> it works.
>
>
> On 10/17/06, Andrew Zhang <[EMAIL PROTECTED]> wrote:
> >
> > On 10/17/06, Nathan Beyer <[EMAIL PROTECTED] > wrote:
> > >
> > > try to either a 'rebuild' or 'clean' then 'build'
> >
> >
> > Thanks, Nathan. I tried "ant clean" and then "ant build", but I got a
> > weird
> > error message:
> >
> > -compile:
> >[javac] Since compiler setting isn't classic or modern,ignoring
fork
> > setting
> > .
> >[javac] Compiling 3223 source files to D:\Harmony\build\classes
> >[javac] Since compiler setting isn't classic or modern,ignoring
fork
> > setting
> > .
> >
> > BUILD FAILED
> > D:\Harmony\build.xml:108: The following error occurred while executing

> > this
> > line
> > :
> > D:\Harmony\make\build-java.xml:143:
> > java.lang.reflect.InvocationTargetException
> >
> > Total time: 34 seconds
> >
> > On 10/16/06, Andrew Zhang <[EMAIL PROTECTED]> wrote:
> > > > Hi, I get a compile error when building latest harmony classlib.
> > Anyone
> > > has
> > > > the same problem? or just my local problem?
> > > >
> > > > Error message:
> > > >
> > > > -compile:
> > > > [javac] Since compiler setting isn't classic or
modern,ignoring
> > fork
> > > > setting
> > > > .
> > > > [javac] Compiling 1 source file to D:\Harmony\build\classes
> > > > [javac] Since compiler setting isn't classic or
modern,ignoring
> > fork
> > > > setting
> > > > .
> > > > [javac] --
> > > > [javac] 1. ERROR in
> > > > D:\Harmony\modules\logging\src\main\java\java\util\loggi
> > > > ng\Logger.java
> > > > [javac]  (at line 431)
> > > > [javac] Handler handler =
> > > > (Handler)LogManager.getInstanceByClass(handler
> > > > Name);
> > > > [javac]
> > ^^
> > > > [javac] The method getInstanceByClass(String) is undefined for
the
> > > type
> > > > LogM
> > > > anager
> > > > [javac] --
> > > > [javac] 1 problem (1 error)
> > > >
> > > > BUILD FAILED
> > > > D:\Harmony\build.xml:108: The following error occurred while
executing
> > > this
> > > > line
> > > > :
> > > > D:\Harmony\make\build-java.xml:143: Compile failed; see the
compiler
> > > error
> > > > outpu
> > > > t for details.
> > > >
> > > > Total time: 1 minute 9 seconds
> > > >
> > > >
> > > > --
> > > > Best regards,
> > > > Andrew Zhang
> > > >
> > > >
> > >
> > >
-
> > > Terms of use : http://incubator.apache.org/harmony/mailing.html
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]

> > > For additional commands, e-mail:
[EMAIL PROTECTED]
> > >
> > >
> >
> >
> > --
> > Best regards,
> > Andrew Zhang
> >
> >
>
>
> --
> Leo Li
> China Software Development Lab, IBM
>
>

-
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





--
Leo Li
China Software Development Lab, IBM


Re: [build] build failed with latest harmony classlib

2006-10-16 Thread Leo Li

Seems we use a new compiler today.:)

The first problem Andrew encountered is quite like the unresolved dependency
in eclipse's compiler option which is manually set off by us.  I do not know
whether it should be  or how can be turned off in current Harmony build
system.

Besides, after I clean the project, build succeeds.

To Andrew:
   Maybe you can roll back the build script to use old javac to see whether
it works.


On 10/17/06, Andrew Zhang <[EMAIL PROTECTED]> wrote:


On 10/17/06, Nathan Beyer <[EMAIL PROTECTED]> wrote:
>
> try to either a 'rebuild' or 'clean' then 'build'


Thanks, Nathan. I tried "ant clean" and then "ant build", but I got a
weird
error message:

-compile:
   [javac] Since compiler setting isn't classic or modern,ignoring fork
setting
.
   [javac] Compiling 3223 source files to D:\Harmony\build\classes
   [javac] Since compiler setting isn't classic or modern,ignoring fork
setting
.

BUILD FAILED
D:\Harmony\build.xml:108: The following error occurred while executing
this
line
:
D:\Harmony\make\build-java.xml:143:
java.lang.reflect.InvocationTargetException

Total time: 34 seconds

On 10/16/06, Andrew Zhang <[EMAIL PROTECTED]> wrote:
> > Hi, I get a compile error when building latest harmony classlib.
Anyone
> has
> > the same problem? or just my local problem?
> >
> > Error message:
> >
> > -compile:
> > [javac] Since compiler setting isn't classic or modern,ignoring
fork
> > setting
> > .
> > [javac] Compiling 1 source file to D:\Harmony\build\classes
> > [javac] Since compiler setting isn't classic or modern,ignoring
fork
> > setting
> > .
> > [javac] --
> > [javac] 1. ERROR in
> > D:\Harmony\modules\logging\src\main\java\java\util\loggi
> > ng\Logger.java
> > [javac]  (at line 431)
> > [javac] Handler handler =
> > (Handler)LogManager.getInstanceByClass(handler
> > Name);
> > [javac]
^^
> > [javac] The method getInstanceByClass(String) is undefined for the
> type
> > LogM
> > anager
> > [javac] --
> > [javac] 1 problem (1 error)
> >
> > BUILD FAILED
> > D:\Harmony\build.xml:108: The following error occurred while executing
> this
> > line
> > :
> > D:\Harmony\make\build-java.xml:143: Compile failed; see the compiler
> error
> > outpu
> > t for details.
> >
> > Total time: 1 minute 9 seconds
> >
> >
> > --
> > Best regards,
> > Andrew Zhang
> >
> >
>
> -
> Terms of use : http://incubator.apache.org/harmony/mailing.html
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


--
Best regards,
Andrew Zhang





--
Leo Li
China Software Development Lab, IBM


Re: [classlib]Harmony passes 73% on Derby.

2006-10-16 Thread Leo Li

Hi,
   The result of Derby is not so obvious, since its test is not junit but
some a serial of stand-alone java program calling each other. And the
comparing result is a pre-stored data file. So I have to use sometime to set
aside all the irrelevant code to spot those related with Harmony classlib.
   What makes things worse is that as a product, all the exception has been
caught...
   Is there someone who has good idea to pick up problem quickly in this
issue?


On 10/17/06, Nathan Beyer <[EMAIL PROTECTED]> wrote:


Are there any obvious bugs in Harmony that are of note? Perhaps some
unexpected NPEs?

On 10/16/06, Leo Li <[EMAIL PROTECTED]> wrote:
> Hi, all:
>  I have ran the tests of Derby on Harmony, both on windows xp and
> ubuntu. The result is similar.
>
>On windows,
> 579 Tests Run
> 73% Pass (428 tests passed)
> 27% Fail (151 tests failed)
> 9 Suites skipped
>On linux,
> 579 Tests Run
> 74% Pass (430 tests passed)
>26% Fail (149 tests failed)
>9 Suites skipped
>
>  The result seems a little frustrating since Sian had 82% passed
several
> months before. The version of derby I ran is at revision 464429. The
lost
> passing rate may be due to the modified code and added testcases.
>
>  To Sian: I made a new patch in the attachment which is an updated
> version of the patch Sian provides. I will be appreciate if Sian helps
to
> check its validity and thus I will be assured that the lost passing rate
is
> irrelevant to our modification.
>
>  When I can confirm everything is all right, I will then put the
ongoing
> progress result on Harmony's wiki page.
>
>  Thank you.
>
> --
> Leo Li
> China Software Development Lab, IBM
> -
> Terms of use :
> http://incubator.apache.org/harmony/mailing.html
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
>
>
>

-
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





--
Leo Li
China Software Development Lab, IBM


[classlib]Harmony passes 73% on Derby.

2006-10-16 Thread Leo Li
Hi, all:
 I have ran the tests of Derby on Harmony, both on windows xp and ubuntu. The result is similar. 
 
   On windows,
    579 Tests Run    73% Pass (428 tests passed)    27% Fail (151 tests failed)    9 Suites skipped
   On linux,
579 Tests Run    74% Pass (430 tests passed)   26% Fail (149 tests failed)   9 Suites skipped
 
 The result seems a little frustrating since Sian had 82% passed several months before. The version of derby I ran is at revision 464429. The lost passing rate may be due to the modified code and added testcases.

  
 To Sian: I made a new patch in the attachment which is an updated version of the patch Sian provides. I will be appreciate if Sian helps to check its validity and thus I will be assured that the lost passing rate is irrelevant to our modification.

 
 When I can confirm everything is all right, I will then put the ongoing progress result on Harmony's wiki page.
 
 Thank you.   -- Leo LiChina Software Development Lab, IBM 
Index: java/testing/org/apache/derbyTesting/functionTests/harness/RunList.java
===
--- java/testing/org/apache/derbyTesting/functionTests/harness/RunList.java 
(revision 463544)
+++ java/testing/org/apache/derbyTesting/functionTests/harness/RunList.java 
(working copy)
@@ -349,7 +349,7 @@
 
 // Build command string for RunTest()
 StringBuffer sb = new StringBuffer();
-   jvm = jvm.getJvm(jvmName);
+   jvm = jvm.getJvm("jdk15");
Vector jvmProps = new Vector();
if ((javaCmd.length()>0) )
{
@@ -721,7 +721,7 @@

//System.out.println("RunList setTopSuiteProperties 
javaVersion: " + javaVersion);
 
-   javaCmd = suiteProperties.getProperty("javaCmd");
+// javaCmd = suiteProperties.getProperty("javaCmd");
if (javaCmd == null)
javaCmd = "java";
else if (javaCmd.equals("jview"))
@@ -729,9 +729,9 @@
 
// if j9, we need to check further
String javavmVersion;
-   if (System.getProperty("java.vm.name").equals("J9"))
-   javavmVersion = (System.getProperty("java.vm.version"));
-   else
+// if (System.getProperty("java.vm.name").equals("J9"))
+// javavmVersion = (System.getProperty("java.vm.version"));
+// else
javavmVersion = javaVersion;
 
 
Index: java/testing/org/apache/derbyTesting/functionTests/harness/RunTest.java
===
--- java/testing/org/apache/derbyTesting/functionTests/harness/RunTest.java 
(revision 463544)
+++ java/testing/org/apache/derbyTesting/functionTests/harness/RunTest.java 
(working copy)
@@ -102,7 +102,7 @@
 static String searchCP = "";
 static boolean useCommonDB = false;
static boolean keepfiles = false;
-   static boolean useprocess = true;
+   static boolean useprocess = false;
static boolean systemdiff = false; // can set true if there is a system 
diff
static boolean upgradetest = false;
static boolean encryption = false; // requires jdk12ext plus 
encryptionProtocol
@@ -983,9 +983,9 @@
 
//hang on a minute - if j9, we need to check further
String javavmVersion;
-   if (sp.getProperty("java.vm.name").equals("J9"))
-   javavmVersion = (sp.getProperty("java.vm.version"));
-   else
+   //if (sp.getProperty("java.vm.name").equals("J9"))
+   //javavmVersion = (sp.getProperty("java.vm.version"));
+   //else
javavmVersion = javaVersion;
 
 
@@ -995,43 +995,44 @@
 iminor = jvh.getMinorNumber();
 imajor = jvh.getMajorNumber();
 
-   if ( (jvmName == null) || (!jvmName.equals("jview")) )
-   {
-   if ( (iminor < 2) && (imajor < 2) )
-   jvmName = "currentjvm";
-   else
-   {
-if (System.getProperty("java.vm.vendor").startsWith("IBM"))
-{
-if (System.getProperty("java.vm.name").equals("J9"))
-{
-if 
(System.getProperty("com.ibm.oti.configuration").equals("foun10"))
-{
-jvmName = "j9_foundation";
-}
-else
-{
-// for reporting; first extend javaVersion
-javaVersion = javaVersion + " - " + majorVersion + 
"." + minorVersion;
-// up to j9 2.1 (jdk 1.3.1 subset) the results are 
the same for all versions,
-// or we

Re: [classlib]Self-host of Derby

2006-10-16 Thread Leo Li

1. Pls see if the command-line has security management on. Current Harmony
seems not compatible with such option.

2. Pls try this stand-alone java program if it runs to set aside the
environment of Derby test:

public class testConnection {
private static final String dbURL ="jdbc:derby:MyDbTest";
private static Connection conn = null;

public static void main(String[] args) throws Exception{

 Class.forName("org.apache.derby.jdbc.EmbeddedDriver").newInstance();
 conn = DriverManager.getConnection(dbURL+";create=true");
 System.out.println("DB created");
  conn.close();
  }

}

*add the classes you built to the classpath



On 10/16/06, Spark Shen <[EMAIL PROTECTED]> wrote:


Alex Luo 写道:
> Hello:
> I have build derby successfully on RI. But when I tried to run the
> following derby's test on Harmony, it failed.
> *java -Dframework=DerbyNetClient
> org.apache.derbyTesting.functionTests.harness.RunTest
> lang/supersimple.sql *
> Btw, this test passed on RI.
Would you try eliminate -Dframework=DerbyNetClient?

Best regards
>
> (1) If the VM is J9vm, at first the test can't even be launched. After
> applying the Sian's patch, this error seems to be fixed.
> But the test still failed because of a strange reason, the error
> report is described as following:
>
> *java.lang.ClassNotFoundException: org.apache.derby.jdbc.EmbeddedDriver
> at java.lang.Class.forName(Class.java:129)
> at org.apache.derby.impl.tools.ij.util.loadDriver(Unknown Source)
> at org.apache.derby.impl.tools.ij.util.startJBMS(Unknown Source)
> at org.apache.derby.impl.tools.ij.util.startJBMS(Unknown Source)
> at org.apache.derby.impl.tools.ij.ConnectionEnv.init(Unknown Source)
> at org.apache.derby.impl.tools.ij.utilMain.(Unknown Source)
> at org.apache.derby.impl.tools.ij.utilMain14.(Unknown Source)
> at org.apache.derby.impl.tools.ij.Main14.getutilMain(Unknown Source)
> at org.apache.derby.impl.tools.ij.Main.(Unknown Source)
> at org.apache.derby.impl.tools.ij.Main14.getMain(Unknown Source)
> at org.apache.derby.impl.tools.ij.Main.mainCore(Unknown Source)
> at org.apache.derby.impl.tools.ij.Main14.main(Unknown Source)
> at org.apache.derby.tools.ij.main(Unknown Source)
> at org.apache.derbyTesting.functionTests.harness.RunIJ.run(RunIJ.java
:45)
> at java.lang.Thread.run(Thread.java:872)
> ij version 10.1
> ij> -- by default, holdability of ResultSet objects created using this
> Connection object is true. Following will set it to false for this
> connection.
> NoHoldForConnection;
> IJ ERROR: Unable to establish connection
> ij> create table a (a int);
> IJ ERROR: Unable to establish connection *
>
> I find that the class *org.apache.derby.jdbc.EmbeddedDriver * exists,
> and I have included this class in ClassPath.
> I write a simple test to load this class, it works.
>
>
> (2) If the VM is DRLVM, the test can't be launched, I paste the error
> report in command line here:
>
> *Failure to open JIT dll
> D:\Harmony\drlvm\trunk\build\win_ia32_msvc_debug\deploy\
> jre\bin/default/\jitrino.dll-1073021795
> apr code: Unknown error
>
> An unhandled error (4) has occurred.
> HyGeneric_Signal_Number=0004
> ExceptionCode=c005
> ExceptionAddress=006FC875
> ContextFlags=0001003f
> Handler1=00401010
> Handler2=11105CE0
> InaccessibleAddress=CDCDCDD1
> EDI=0013F178
> ESI=0013F0CC
> EAX=01301794
> EBX=0002
> ECX=CDCDCDCD
> EDX=CDCDCDCD
> EIP=006FC875
> ESP=0013F0C8
> EBP=0013F0D4
>
Module=D:\Harmony\drlvm\trunk\build\win_ia32_msvc_debug\deploy\jre\bin\default\h
>
> armonyvm.dll
> Module_base_address=0051
> Offset_in_DLL=001ec875
>
> This application has requested the Runtime to terminate it in an
> unusual way.
> Please contact the application's support team for more information. *
>
> Has anybody ever met the same problem?
>
>
> Leo Li wrote:
>> Hi, all:
>> I now plan to make the self-host of Derby on Harmony.
>> Is there anyone interested in this topic?
>>
>> Here is what I encountered in the process. Hope it will be helpful to
>> anybody who is interested in it.
>>
>> At first, the testcases even fails on RI both on windows and ubuntu and
>> the result are different.???
>> After some struggiling, I have successfully passed the provided
>> testcases on RI after I rebuild the source on my machine.
>> But there still remains a problem:
>> The derby team kindly rewrite the launcher for testcases in order to
>> treat J9 vm differently if the property java.vm.name starts with
>> "j9". But
>> the j9 vm used in Harmony has been customized thus is different from
>> traditional

Re: [classlib][luni]Runtime.exec fails on Linux

2006-10-16 Thread Leo Li

It seems not quite related to actual memory stress although the reported
error is ENOMEM.
I have run it both in eclipse and console. And there are enough memory
available.

Furthermore, the case can be repeated even though in the same time a C
program runs well when using fork().

I suspect that it is related with VM since it can be only reproduced by VM
calling it. I am not sure whether vm does something behind me, but I have
not thought out of a way that a user-space program have such effect.:)


On 10/16/06, Geir Magnusson Jr. <[EMAIL PROTECTED]> wrote:


I'm confused.  Didn't you just report this on Ubuntu?

I have had similar forking problems on Ubuntu 6 (I once found a bug in
classlib related to forking...).

I never figured out why Unbuntu does this, but it seemed that under
memory stress, Ubuntu's fork() fails.  Try this - close Eclipse and run
the test again...

geir


Leo Li wrote:
> Thank you.
> I have just run it on drlvm of unbuntu, it works.
> What a qurious problem!
>
>
> On 10/16/06, Alexey Varlamov <[EMAIL PROTECTED]> wrote:
>>
>> Both DRLVM and J9 works for me (SUSE9).
>>
>> --
>> Alexey
>>
>> 2006/10/16, Leo Li <[EMAIL PROTECTED]>:
>> > Hi, all:
>> > The harmony Runtime.exec fails on Linux with ENOMEM.
>> > Here is the testcase:
>> >
>> > public class Exec {
>> >public static void main(String[] args) throws Exception {
>> >
>> >   Runtime.getRuntime().exec("ls");}
>> > }
>> >
>> >I have tried it on RedHat Enterprise 4 and Unbuntu, both get
ENOMEM
>> in
>> > native code.
>> >
>> >After digging into it, I found it fails in procimpl.c, line 135:
>> >
>> >grdpid = fork ();
>> >
>> >If the call to fork is changed to vfork, the testcase will pass
but
>> > still get exitcode = 1 which indicates that some error has happened.
>> The
>> > difference between fork and vfork is just whether page tables is
copied
>> to
>> > child process or not. But I do not think it is the main cause.
Besides,
>> > vfork has become outdated since it main usage is supplied by fork
with
>> > copy-on-write function implemented in modern linux kernel.
Furthermore,
>> > vfork is also not so safe as fork. So I do not think it is the
accepted
>> way
>> > to solve the problem.
>> >
>> >   I will try whether it can be reproduced on drlvm of linux since I
am
>> not
>> > sure whether it is relevent to VM or classlib. If any drlvm man can
>> tell
>> me
>> > the result, it can avoid my trouble to build it on linux. :)
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> > --
>> > Leo Li
>> > China Software Development Lab, IBM
>> >
>> >
>>
>> -
>> Terms of use : http://incubator.apache.org/harmony/mailing.html
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
>
>

-
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





--
Leo Li
China Software Development Lab, IBM


Re: [classlib][luni]Runtime.exec fails on Linux

2006-10-16 Thread Leo Li

Ya.
What I found is that harmony and IBM VM fails when running Runtime.exec both
on RedHat and Unbuntu. But drlvm seems passes. I have not tried suse.


On 10/16/06, Paulex Yang <[EMAIL PROTECTED]> wrote:


Geir Magnusson Jr. wrote:
> I'm confused.  Didn't you just report this on Ubuntu?
Let Leo speak for himself, but I thought Leo meant IBM VME + Harmony
classlib failed on Ubuntu and Redhat, but Alexey just reported that both
(VME and DRLVM) works on SUSE, that's why it seems interesting.
>
> I have had similar forking problems on Ubuntu 6 (I once found a bug in
> classlib related to forking...).
>
> I never figured out why Unbuntu does this, but it seemed that under
> memory stress, Ubuntu's fork() fails.  Try this - close Eclipse and
> run the test again...
> geir
>
>
> Leo Li wrote:
>> Thank you.
>> I have just run it on drlvm of unbuntu, it works.
>> What a qurious problem!
>>
>>
>> On 10/16/06, Alexey Varlamov <[EMAIL PROTECTED]> wrote:
>>>
>>> Both DRLVM and J9 works for me (SUSE9).
>>>
>>> --
>>> Alexey
>>>
>>> 2006/10/16, Leo Li <[EMAIL PROTECTED]>:
>>> > Hi, all:
>>> > The harmony Runtime.exec fails on Linux with ENOMEM.
>>> > Here is the testcase:
>>> >
>>> > public class Exec {
>>> >public static void main(String[] args) throws Exception {
>>> >
>>> >   Runtime.getRuntime().exec("ls");}
>>> > }
>>> >
>>> >I have tried it on RedHat Enterprise 4 and Unbuntu, both get
>>> ENOMEM
>>> in
>>> > native code.
>>> >
>>> >After digging into it, I found it fails in procimpl.c, line 135:
>>> >
>>> >grdpid = fork ();
>>> >
>>> >If the call to fork is changed to vfork, the testcase will pass
>>> but
>>> > still get exitcode = 1 which indicates that some error has
>>> happened. The
>>> > difference between fork and vfork is just whether page tables is
>>> copied
>>> to
>>> > child process or not. But I do not think it is the main cause.
>>> Besides,
>>> > vfork has become outdated since it main usage is supplied by fork
>>> with
>>> > copy-on-write function implemented in modern linux kernel.
>>> Furthermore,
>>> > vfork is also not so safe as fork. So I do not think it is the
>>> accepted
>>> way
>>> > to solve the problem.
>>> >
>>> >   I will try whether it can be reproduced on drlvm of linux since
>>> I am
>>> not
>>> > sure whether it is relevent to VM or classlib. If any drlvm man
>>> can tell
>>> me
>>> > the result, it can avoid my trouble to build it on linux. :)
>>> >
>>> >
>>> >
>>> >
>>> >
>>> >
>>> >
>>> > --
>>> > Leo Li
>>> > China Software Development Lab, IBM
>>> >
>>> >
>>>
>>> -
>>> Terms of use : http://incubator.apache.org/harmony/mailing.html
>>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>>> For additional commands, e-mail: [EMAIL PROTECTED]
>>>
>>>
>>
>>
>
> -
> Terms of use : http://incubator.apache.org/harmony/mailing.html
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


--
Paulex Yang
China Software Development Lab
IBM


-
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





--
Leo Li
China Software Development Lab, IBM


Re: [classlib][luni]Runtime.exec fails on Linux

2006-10-16 Thread Leo Li

Thank you.
I have just run it on drlvm of unbuntu, it works.
What a qurious problem!


On 10/16/06, Alexey Varlamov <[EMAIL PROTECTED]> wrote:


Both DRLVM and J9 works for me (SUSE9).

--
Alexey

2006/10/16, Leo Li <[EMAIL PROTECTED]>:
> Hi, all:
> The harmony Runtime.exec fails on Linux with ENOMEM.
> Here is the testcase:
>
> public class Exec {
>public static void main(String[] args) throws Exception {
>
>   Runtime.getRuntime().exec("ls");}
> }
>
>I have tried it on RedHat Enterprise 4 and Unbuntu, both get ENOMEM
in
> native code.
>
>After digging into it, I found it fails in procimpl.c, line 135:
>
>grdpid = fork ();
>
>If the call to fork is changed to vfork, the testcase will pass but
> still get exitcode = 1 which indicates that some error has happened. The
> difference between fork and vfork is just whether page tables is copied
to
> child process or not. But I do not think it is the main cause. Besides,
> vfork has become outdated since it main usage is supplied by fork with
> copy-on-write function implemented in modern linux kernel. Furthermore,
> vfork is also not so safe as fork. So I do not think it is the accepted
way
> to solve the problem.
>
>   I will try whether it can be reproduced on drlvm of linux since I am
not
> sure whether it is relevent to VM or classlib. If any drlvm man can tell
me
> the result, it can avoid my trouble to build it on linux. :)
>
>
>
>
>
>
>
> --
> Leo Li
> China Software Development Lab, IBM
>
>

-
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





--
Leo Li
China Software Development Lab, IBM


[classlib][luni]Runtime.exec fails on Linux

2006-10-16 Thread Leo Li

Hi, all:
The harmony Runtime.exec fails on Linux with ENOMEM.
Here is the testcase:

public class Exec {
   public static void main(String[] args) throws Exception {

  Runtime.getRuntime().exec("ls");}
}

   I have tried it on RedHat Enterprise 4 and Unbuntu, both get ENOMEM in
native code.

   After digging into it, I found it fails in procimpl.c, line 135:

   grdpid = fork ();

   If the call to fork is changed to vfork, the testcase will pass but
still get exitcode = 1 which indicates that some error has happened. The
difference between fork and vfork is just whether page tables is copied to
child process or not. But I do not think it is the main cause. Besides,
vfork has become outdated since it main usage is supplied by fork with
copy-on-write function implemented in modern linux kernel. Furthermore,
vfork is also not so safe as fork. So I do not think it is the accepted way
to solve the problem.

  I will try whether it can be reproduced on drlvm of linux since I am not
sure whether it is relevent to VM or classlib. If any drlvm man can tell me
the result, it can avoid my trouble to build it on linux. :)







--
Leo Li
China Software Development Lab, IBM


Re: [classlib][archive]Security policy leads to vm crashes in loading class of JarFile

2006-10-15 Thread Leo Li

Ok. I will call it runing Derby on Harmony.:)

On 10/14/06, Tim Ellison <[EMAIL PROTECTED]> wrote:


Leo Li wrote:
> During the self-hosting of Derby...

Minor nit, but as Sian pointed out before we would usually reserve
'self-hosting' to mean using Harmony in development of the project
itself, i.e. self hosting in the build system or using Eclipse.  I don't
consider running other apps as self-hosting -- but then I'm just being
picky :-)

Keep up the good work!

Regards,
Tim


--

Tim Ellison ([EMAIL PROTECTED])
IBM Java technology centre, UK.


-
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





--
Leo Li
China Software Development Lab, IBM


Re: [classlib]Self-host of Derby

2006-10-13 Thread Leo Li

Hi, Sian:
Thank you for your patch. It really works. But seems a little
outdated.:)

I found another work around with useprocess=true , but ... after a lot
of trouble: If the useprocess is on, security manager is installed by
default, or else it is not. So, when to get command, it should be
"java"; when avoid to install security manager, it should be"j9" and the
complicated logic of the testcase as well.:(

Do you know why the suites will run without security manager installed
if the vm is spotted as j9 in the untact version from derby? Does the
derby_test.policy really mean something, from the goal of the derby
tests?Actually, I have manually forced the testcase not to set security
manager when useprocess = true, the tests fails even on RI.

I have tried to treat the current IBM VM as normal jdk and with -
Djava.security.manager, but it will report error in loading the class of
JarFile. Have you ever met this?:)



On 10/13/06, Sian January <[EMAIL PROTECTED]> wrote:


Hi Leo,

I have uploaded my patch to the Wiki.  However the patch just forces use
of
the jdk15 support class, in order to get the tests up and running.  As you

say, a better solution would be to have our own support class.

Regards,

Sian


On 13/10/06, Leo Li <[EMAIL PROTECTED]> wrote:
>
> Hi, Sian:
> After some study, I found that it is necessary to treat j9
> seperately,mmm about security and vm library loader. I have not spot
> the
> precise place.
> I think we have first to get a wrapper jvm class like j9_13 derby
> gives
> but not other standard wrapper class. Then we have to rewrite it java
> command-line as "java" but not "j9". Am I all right?
> Besides, it will be helpful if you can post your patch of Derby on
the
> http://wiki.apache.org/harmony/Apache_Derby.:)
> Thank you.
>
>
>
> On 10/12/06, Sian January < [EMAIL PROTECTED]> wrote:
> >
> > Hi Leo,
> >
> > I have previously run the Derby tests on Harmony with the IBM VME (see
> the
> > Wiki page - http://wiki.apache.org/harmony/Apache_Derby).  I had to
make
> > some changes to Derby to get it to run, but from reading the bug
report
> it
> > sounds like you found a way round it too.  If not then let me know and
I
> > could send you a patch or post one here or something.  I wasn't using
> > DRLVM
> > so I haven't seen the bug you're describing.  Running with the IBM VME
I
> > got
> > 82% of the tests passing.  I looked at some of the test failures but
not
> > in
> > very much depth.  However some of them seemed to be because the
> different
> > VMs had differently formatted output, so not necessarily a bug.  I
think
> > that's one of the reasons why the tests need to know what VM they are
> > using.  The tests have different output files for different VMs that
> they
> > compare with the actual output for each test.
> >
> > Just as a side point, several people have looked at applications in
the
> > past
> > including myself and have posted the results on the Wiki (
> > http://wiki.apache.org/harmony/Application_Status).  So if anyone is
> > having
> > a problem running a particular application it might be worth having a
> look
> > to check if someone has done it before.  Or we could suggest that
> everyone
> > posts this kind of thing to the mailing list in future if that's more
> > likely
> > to be found.
> >
> > Regards,
> >
> > Sian
> >
> >
> >
> > On 12/10/06, Leo Li < [EMAIL PROTECTED]> wrote:
> > >
> > > Hi, all:
> > > I now plan to make the self-host of Derby on Harmony.
> > > Is there anyone interested in this topic?
> > >
> > > Here is what I encountered in the process. Hope it will be
helpful
> > to
> > > anybody who is interested in it.
> > >
> > > At first, the testcases even fails on RI both on windows and
> ubuntu
> > > and
> > > the result are different.???
> > > After some struggiling, I have successfully passed the provided
> > > testcases on RI after I rebuild the source on my machine.
> > > But there still remains a problem:
> > > The derby team kindly rewrite the launcher for testcases in
order
> to
> > > treat J9 vm differently if the property java.vm.name starts with
"j9".
> > But
> > > the j9 vm used in Harmony has been customized thus is different from
> > > traditional j9 vm that is expected by derby. This leads to failure
to
> > > launch
> > > tests.
> > > I will talk on Derby's mailing list to find a solution.
> > >
> > > --
> > > Leo Li
> > > China Software Development Lab, IBM
> > >
> > >
> >
> >
> > --
> > Sian January
> >
> > IBM Java Technology Centre, UK
> >
> >
>
>
> --
> Leo Li
> China Software Development Lab, IBM
>
>


--
Sian January

IBM Java Technology Centre, UK





--
Leo Li
China Software Development Lab, IBM


Re: [classlib][archive]Security policy leads to vm crashes in loading class of JarFile

2006-10-13 Thread Leo Li
Sorry forget the security policy file.
And I add it as the attachment. 
On 10/13/06, Leo Li <[EMAIL PROTECTED]> wrote:

Hi, all:
 During the self-hosting of Derby, I found a security policy  if is applied will lead to errors in loading the class of JarFile. IBM vm will throw java/lang/UnsatisfiedLinkError: java/util/zip/ZipFile.ntvi  while drlvm will crash with "SEH handler: shutdown errorSEH handler: too many shutdown errors..." 

 
 Here is the testcase:
 
import java.util.jar.*;public class TestJarFile {
 public static void main(String[] args) throws Exception{  System.out.println(JarFile.CENATT);   }
}
And the attachment is the derby_tests.policy.
Then run:
java -Djava.security.manager -Djava.security.policy=derby_tests.policy TestJarFile
Run passes,
Harmony on IBM VM fails with java/lang/UnsatisfiedLinkError: java/util/zip/ZipFile.ntvi  
Harmony on Drlvm fails with SEH handler: shutdown errorSEH handler: too many shutdown errors
If the security manager is not specified, Harmony passes.
-- Leo LiChina Software Development Lab, IBM -- Leo LiChina Software Development Lab, IBM 
//
// Policy file with minimal set of permissions to run derby's
// functional tests.
//
// The test harness sets up three variables used by this policy file
//
// derbyTesting.codejar - URL to the jar files when they are in the classpath
// derbyTesting.codeclasses - URL to the classes directory when it is in the 
classpath
//
// Only one of derbyTesting.codejar and derbyTesting.codeclasses will be valid, 
the
// other will be set to a bogus URL like file://unused
//
// derbyTesting.codedir - File location of either derbyTesting.codejar or 
derbyTesting.codeclasses.
// Only required due to a BUG (see below for more info).
//
// 
// derbyTesting.serverhost - Host name or ip where network server is started 
// derbyTesting.clienthost - specifies the clients ip address/hostName. 
// when testing with networkserver on a remote host, this needs to be 
passed in 
// with the NetworkServerControl start command

//
// Permissions for the embedded engine (derby.jar)
//
grant codeBase "${derbyTesting.codejar}derby.jar" {
  permission java.util.PropertyPermission "derby.*", "read";
  permission java.util.PropertyPermission "java.class.path", "read";//sysinfo
  
  // unit tests (e.g. store/T_RecoverFullLog) set this property 
  // (called from derbyTesting.jar through code in derby.jar)
  permission java.util.PropertyPermission "derbyTesting.unittest.*", "write";

  permission java.lang.RuntimePermission "createClassLoader";
  
  permission java.io.FilePermission "${derby.system.home}${/}derby.properties", 
"read";
  permission java.io.FilePermission "${derby.system.home}${/}derby.log", "read, 
write, delete";
  permission java.io.FilePermission "${derby.system.home}", "read";
  
  // all databases under derby.system.home 
  permission java.io.FilePermission "${derby.system.home}${/}-", "read, write, 
delete";

  // Import/export and other support files from these locations in tests
  permission java.io.FilePermission "${user.dir}${/}extin${/}-", "read";
  permission java.io.FilePermission "${user.dir}${/}extinout${/}-", "read,  
write, delete";
  permission java.io.FilePermission "${user.dir}${/}extout${/}-", "write";
  permission java.io.FilePermission "${user.dir}${/}extinout", "read,write";
  
  // These permissions are needed to load the JCE for encryption with Sun and 
IBM JDK131.
  // JDK14 has the JCE  preloaded
  permission java.security.SecurityPermission "insertProvider.SunJCE";
  permission java.security.SecurityPermission "insertProvider.IBMJCE";
 
};

//
// Permissions for the network server (derbynet.jar)
//
grant codeBase "${derbyTesting.codejar}derbynet.jar" {
  permission java.util.PropertyPermission "java.class.path", "read";//sysinfo
  
  // accept is needed for the server accepting connections
  // connect is needed for ping command (which is in the server jar)
  permission java.net.SocketPermission "127.0.0.1", "accept,connect";
  permission java.net.SocketPermission "localhost", "accept,connect";
  permission java.net.SocketPermission "${derbyTesting.clienthost}", 
"accept,connect";
  permission java.net.SocketPermission "${derbyTesting.serverhost}", 
"accept,connect";
  
};

//
// Permissions for the network client (derbyclient.jar)
//
grant codeBase "${derbyTesting.clientjar}derbyclient.jar" {
  permission java.net.SocketPermission "127.0.0.1", "connect,resolve";
  permission java.net.SocketPermission "localhost", "connect,resolve";
  permission java.net.SocketP

[classlib][archive]Security policy leads to vm crashes in loading class of JarFile

2006-10-13 Thread Leo Li

Hi, all:
During the self-hosting of Derby, I found a security policy  if is
applied will lead to errors in loading the class of JarFile. IBM vm
will throw java/lang/UnsatisfiedLinkError: java/util/zip/ZipFile.ntvi  while
drlvm will crash with "SEH handler: shutdown errorSEH handler: too many
shutdown errors..."

Here is the testcase:


import java.util.jar.*;
public class TestJarFile {

public static void main(String[] args) throws Exception{
 System.out.println(JarFile.CENATT);
  }

}

And the attachment is the derby_tests.policy.

Then run:

java -Djava.security.manager
-Djava.security.policy=derby_tests.policyTestJarFile

Run passes,

Harmony on IBM VM fails with java/lang/UnsatisfiedLinkError:
java/util/zip/ZipFile.ntvi

Harmony on Drlvm fails with SEH handler: shutdown errorSEH handler: too many
shutdown errors

If the security manager is not specified, Harmony passes.


--
Leo Li
China Software Development Lab, IBM


Re: [classlib]Self-host of Derby

2006-10-13 Thread Leo Li

On 10/13/06, Geir Magnusson Jr. <[EMAIL PROTECTED]> wrote:


Derby has VM-specific features?

No. Seems the VM has some special bug...


Leo Li wrote:
> Hi, Sian:
> After some study, I found that it is necessary to treat j9
> seperately,mmm about security and vm library loader. I have not spot
> the
> precise place.
> I think we have first to get a wrapper jvm class like j9_13 derby
gives
> but not other standard wrapper class. Then we have to rewrite it java
> command-line as "java" but not "j9". Am I all right?
> Besides, it will be helpful if you can post your patch of Derby on
the
> http://wiki.apache.org/harmony/Apache_Derby.:)
> Thank you.
>
>
>
> On 10/12/06, Sian January <[EMAIL PROTECTED]> wrote:
>>
>> Hi Leo,
>>
>> I have previously run the Derby tests on Harmony with the IBM VME (see
>> the
>> Wiki page - http://wiki.apache.org/harmony/Apache_Derby).  I had to
make
>> some changes to Derby to get it to run, but from reading the bug
>> report it
>> sounds like you found a way round it too.  If not then let me know and
I
>> could send you a patch or post one here or something.  I wasn't using
>> DRLVM
>> so I haven't seen the bug you're describing.  Running with the IBM VME
I
>> got
>> 82% of the tests passing.  I looked at some of the test failures but
not
>> in
>> very much depth.  However some of them seemed to be because the
different
>> VMs had differently formatted output, so not necessarily a bug.  I
think
>> that's one of the reasons why the tests need to know what VM they are
>> using.  The tests have different output files for different VMs that
they
>> compare with the actual output for each test.
>>
>> Just as a side point, several people have looked at applications in the
>> past
>> including myself and have posted the results on the Wiki (
>> http://wiki.apache.org/harmony/Application_Status).  So if anyone is
>> having
>> a problem running a particular application it might be worth having a
>> look
>> to check if someone has done it before.  Or we could suggest that
>> everyone
>> posts this kind of thing to the mailing list in future if that's more
>> likely
>> to be found.
>>
>> Regards,
>>
>> Sian
>>
>>
>>
>> On 12/10/06, Leo Li <[EMAIL PROTECTED]> wrote:
>> >
>> > Hi, all:
>> > I now plan to make the self-host of Derby on Harmony.
>> > Is there anyone interested in this topic?
>> >
>> > Here is what I encountered in the process. Hope it will be
helpful
>> to
>> > anybody who is interested in it.
>> >
>> > At first, the testcases even fails on RI both on windows and
ubuntu
>> > and
>> > the result are different.???
>> > After some struggiling, I have successfully passed the provided
>> > testcases on RI after I rebuild the source on my machine.
>> > But there still remains a problem:
>> > The derby team kindly rewrite the launcher for testcases in
>> order to
>> > treat J9 vm differently if the property java.vm.name starts with
"j9".
>> But
>> > the j9 vm used in Harmony has been customized thus is different from
>> > traditional j9 vm that is expected by derby. This leads to failure to
>> > launch
>> > tests.
>> > I will talk on Derby's mailing list to find a solution.
>> >
>> > --
>> > Leo Li
>> > China Software Development Lab, IBM
>> >
>> >
>>
>>
>> --
>> Sian January
>>
>> IBM Java Technology Centre, UK
>>
>>
>
>

-
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





--
Leo Li
China Software Development Lab, IBM


Re: [classlib]Self-host of Derby

2006-10-12 Thread Leo Li

Hi, Sian:
After some study, I found that it is necessary to treat j9
seperately,mmm about security and vm library loader. I have not spot the
precise place.
I think we have first to get a wrapper jvm class like j9_13 derby gives
but not other standard wrapper class. Then we have to rewrite it java
command-line as "java" but not "j9". Am I all right?
Besides, it will be helpful if you can post your patch of Derby on the
http://wiki.apache.org/harmony/Apache_Derby.:)
Thank you.



On 10/12/06, Sian January <[EMAIL PROTECTED]> wrote:


Hi Leo,

I have previously run the Derby tests on Harmony with the IBM VME (see the
Wiki page - http://wiki.apache.org/harmony/Apache_Derby).  I had to make
some changes to Derby to get it to run, but from reading the bug report it
sounds like you found a way round it too.  If not then let me know and I
could send you a patch or post one here or something.  I wasn't using
DRLVM
so I haven't seen the bug you're describing.  Running with the IBM VME I
got
82% of the tests passing.  I looked at some of the test failures but not
in
very much depth.  However some of them seemed to be because the different
VMs had differently formatted output, so not necessarily a bug.  I think
that's one of the reasons why the tests need to know what VM they are
using.  The tests have different output files for different VMs that they
compare with the actual output for each test.

Just as a side point, several people have looked at applications in the
past
including myself and have posted the results on the Wiki (
http://wiki.apache.org/harmony/Application_Status).  So if anyone is
having
a problem running a particular application it might be worth having a look
to check if someone has done it before.  Or we could suggest that everyone
posts this kind of thing to the mailing list in future if that's more
likely
to be found.

Regards,

Sian



On 12/10/06, Leo Li <[EMAIL PROTECTED]> wrote:
>
> Hi, all:
> I now plan to make the self-host of Derby on Harmony.
> Is there anyone interested in this topic?
>
> Here is what I encountered in the process. Hope it will be helpful
to
> anybody who is interested in it.
>
> At first, the testcases even fails on RI both on windows and ubuntu
> and
> the result are different.???
> After some struggiling, I have successfully passed the provided
> testcases on RI after I rebuild the source on my machine.
> But there still remains a problem:
> The derby team kindly rewrite the launcher for testcases in order to
> treat J9 vm differently if the property java.vm.name starts with "j9".
But
> the j9 vm used in Harmony has been customized thus is different from
> traditional j9 vm that is expected by derby. This leads to failure to
> launch
> tests.
> I will talk on Derby's mailing list to find a solution.
>
> --
> Leo Li
> China Software Development Lab, IBM
>
>


--
Sian January

IBM Java Technology Centre, UK





--
Leo Li
China Software Development Lab, IBM


Re: [classlib]Self-host of Derby

2006-10-12 Thread Leo Li

Hi, Egor:
If you want just to reproduce the problem, I think it is possible to
start from binary.
But there are some issues:
1. Pls pack the wrapper class I gave in the HARMONY-1368 to the binary
you will run from. The RunTest requires it.
2. The testcase with the downloaded binary might fail, I am not sure,
due to the sorting of locale. But not the Error.:)


On 12 Oct 2006 16:57:06 +0700, Egor Pasko <[EMAIL PROTECTED]> wrote:


On the 0x200 day of Apache Harmony Leo Li wrote:
> Posted as *HARMONY-1836* <http://issues.apache.org/jira/browse/HARMONY-1836
>
> .

Thanks for the issue!
Is it possible to skip the building process and start from binaries?
Or I should not even try?

> On 10/12/06, Leo Li < [EMAIL PROTECTED]> wrote:
> >
> > Ok.:)
> >
> > On 12 Oct 2006 13:38:34 +0700, Egor Pasko <[EMAIL PROTECTED] >
wrote:
> > >
> > > On the 0x200 day of Apache Harmony Leo Li wrote:
> > > > Hi, Egor:
> > > >  I have tried to run it on drlvm, but it reported error:
> > > >
> > > >Assertion failed!
> > > >Progrma: ...java.exe
> > > >File:Object_handles.cpp
> > > >Line:99
> > > >
> > > >Expression: NULL==*p || (*p>=vm_heap_base_address() &&
> > > > *p > >
> > > There is a similar HARMONY-1560 open (ActiveMQ). Can you give a
> > > comment there (or create a separate JIRA with component
"App-Oriented
> > > Bug Reports"), with easy steps to reproduce?
> > >
> > > I'll try on Linux.
> > >
> > > > After I debug into it I got
> > > > (1)
> > > > Unhandled exception at 0x00711eed (harmonyvm.dll) in java.exe:
User
> > > > breakpoint.
> > > >
> > > > (2)The call stack is
> > > > > harmonyvm.dll!_assert(const char * expr=0x007bd848, const char *
> > > > filename=0x007bd800, unsigned int lineno=99)  Line 295 C
> > > >   harmonyvm.dll!GcFrame::add_object(ManagedObject * *
> > > p=0x0013e9cc)  Line 99
> > > > + 0x31 C++
> > > >   harmonyvm.dll!compile_protect_arguments(Method *
method=0x0393da50,
> > > > GcFrame * gc=0x0013e95c)  Line 113 C++
> > > >   harmonyvm.dll!compile_jit_a_method(Method *
method=0x0393da50)  Line
> > > 824 +
> > > > 0xd C++
> > > >   013900dd()
> > > >   harmonyvm.dll!VM_Statistics::get_vm_stats()  Line 325 + 0x14 C++
> > > >   harmonyvm.dll!rth_get_interface_vtable(ManagedObject * obj=,
Class *
> > > > iid=)  Line 674 + 0xc C++
> > > >
> > > > (3)object_handles.cpp
> > > >
> > > > void GcFrame::add_object(ManagedObject** p)
> > > > {
> > > > assert(p);
> > > >
> > > > //fails here:
> > > > *assert(NULL == *p || (*p >= vm_heap_base_address()
> > > > && *p < vm_heap_ceiling_address()));*
> > > >
> > > > *
> > > > *assert(!hythread_is_suspend_enabled());
> > > >
> > > > ensure_capacity();
> > > > nodes->elements[nodes->obj_size+nodes->mp_size] =
> > > > nodes->elements[nodes->obj_size];
> > > > nodes->elements[nodes->obj_size] = (void**)p;
> > > > nodes->obj_size++;
> > > > }
> > > >
> > > >
> > > > On 12 Oct 2006 11:55:27 +0700, Egor Pasko <[EMAIL PROTECTED] >
> > > wrote:
> > > > >
> > > > > On the 0x200 day of Apache Harmony Leo Li wrote:
> > > > > > Hi, all:
> > > > > >  I now plan to make the self-host of Derby on Harmony.
> > > > > >  Is there anyone interested in this topic?
> > > > > >
> > > > > >  Here is what I encountered in the process. Hope it will
be
> > > helpful
> > > > > to
> > > > > > anybody who is interested in it.
> > > > > >
> > > > > >  At first, the testcases even fails on RI both on windows
and
> > > ubuntu
> > > > > and
> > > > > > the result are different.???
> > > > > >  After some struggiling, I have successfully passed the
> > > provided
> > > > > > testcases on RI after I rebuild the source on my machine.
> > > > > >  But there still remains a problem:
> > > > > >  The derby team kind

Re: [classlib][launcher]shall we handle the parameter -version and -showversion in launcher or vm?

2006-10-12 Thread Leo Li

On 10/13/06, Geir Magnusson Jr. <[EMAIL PROTECTED]> wrote:




Tim Ellison wrote:
> Leo Li wrote:
>> Due to current VMI, we have to first create a java VM through
>> JNI_CreateJavaVM, then we can get property from functions defined by
>> VMI. It is possible not to change current vmi design and support java
>> -version, but
>> we have to create and then "kill" a new java vm. So I think it quite
>> wastes. I suggest the vmi.dll export another funciton to give out
>> some "static" property of the java vm implementation that is no
>> relevent to a live vm.
>
> What are you concerned about wasting?  It will take longer for sure, but
>  'java -version' doesn't need to be super fast (it prints to the console
> and quits).  In addition, we should consider gathering version
> information from the class library code too, i.e. to show each module
> version.  I don't think it warrants extending the VMI.

Yes - as Tim noted, we probably don't care if typing "java -version" is
slow (unless some bonehead puts that into a SPEC benchmark...) because
the user isn't trying to accomplish anything useful.




  Ya, "java -version" need not be so fast. And the version really is
related to classlib. I am to some degree too mad about performance:)

  If we have decided not to transfer version as an option into vm, we can
make some change in launcher:
  1.When create vm, "-version" is not included as part of vm argument, thus
our vm will not report error.
  2.When vm created, we uses a JNI call to System.getProperty("java.version")
or VMI funciton GetSystemProperty("java.version")to show it to user. I am
not sure which way is better.

  Is the plan all right?



--
Leo Li
China Software Development Lab, IBM


Re: [classlib]Self-host of Derby

2006-10-12 Thread Leo Li

On 10/12/06, Nathan Beyer <[EMAIL PROTECTED]> wrote:


On 10/11/06, Leo Li <[EMAIL PROTECTED]> wrote:
> Hi, all:
>  I now plan to make the self-host of Derby on Harmony.
>  Is there anyone interested in this topic?
>
>  Here is what I encountered in the process. Hope it will be helpful
to
> anybody who is interested in it.
>
>  At first, the testcases even fails on RI both on windows and ubuntu
and
> the result are different.???

What version of the RI?



  1.5


 After some struggiling, I have successfully passed the provided
> testcases on RI after I rebuild the source on my machine.
>  But there still remains a problem:
>  The derby team kindly rewrite the launcher for testcases in order
to
> treat J9 vm differently if the property java.vm.name starts with "j9".
But
> the j9 vm used in Harmony has been customized thus is different from
> traditional j9 vm that is expected by derby. This leads to failure to
launch
> tests.

Curious, why do Derby's test cases need to run differently for different
VMs?



  I am also curious. Just asking them.:)


 I will talk on Derby's mailing list to find a solution.
>
> --
> Leo Li
> China Software Development Lab, IBM
>
>

-
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





--
Leo Li
China Software Development Lab, IBM


Re: Hello everyone

2006-10-12 Thread Leo Li

Welcome Alex.
:)


On 10/12/06, Spark Shen <[EMAIL PROTECTED]> wrote:


Alex luo 写道:
> Hello everyone:
> I am a student from Nanjing University of China. I have great interest
> in Harmony
> project, and I want to make contribution to this project. Could anyone
> tell what
> I can do now. By the way, I have signed the CLA.
>
>
Hi Alex:

Welcome. There are many hot-spots on going on this project. Refer to
http://wiki.apache.org/harmony

Best regards

--
Spark Shen
China Software Development Lab, IBM


-
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





--
Leo Li
China Software Development Lab, IBM


Re: [classlib]Self-host of Derby

2006-10-12 Thread Leo Li

Posted as *HARMONY-1836* <http://issues.apache.org/jira/browse/HARMONY-1836>
.

On 10/12/06, Leo Li <[EMAIL PROTECTED]> wrote:


Ok.:)

On 12 Oct 2006 13:38:34 +0700, Egor Pasko <[EMAIL PROTECTED]> wrote:
>
> On the 0x200 day of Apache Harmony Leo Li wrote:
> > Hi, Egor:
> >  I have tried to run it on drlvm, but it reported error:
> >
> >Assertion failed!
> >Progrma: ...java.exe
> >File:Object_handles.cpp
> >Line:99
> >
> >Expression: NULL==*p || (*p>=vm_heap_base_address() &&
> > *p
> There is a similar HARMONY-1560 open (ActiveMQ). Can you give a
> comment there (or create a separate JIRA with component "App-Oriented
> Bug Reports"), with easy steps to reproduce?
>
> I'll try on Linux.
>
> > After I debug into it I got
> > (1)
> > Unhandled exception at 0x00711eed (harmonyvm.dll) in java.exe: User
> > breakpoint.
> >
> > (2)The call stack is
> > > harmonyvm.dll!_assert(const char * expr=0x007bd848, const char *
> > filename=0x007bd800, unsigned int lineno=99)  Line 295 C
> >   harmonyvm.dll!GcFrame::add_object(ManagedObject * *
> p=0x0013e9cc)  Line 99
> > + 0x31 C++
> >   harmonyvm.dll!compile_protect_arguments(Method * method=0x0393da50,
> > GcFrame * gc=0x0013e95c)  Line 113 C++
> >   harmonyvm.dll!compile_jit_a_method(Method * method=0x0393da50)  Line
> 824 +
> > 0xd C++
> >   013900dd()
> >   harmonyvm.dll!VM_Statistics::get_vm_stats()  Line 325 + 0x14 C++
> >   harmonyvm.dll!rth_get_interface_vtable(ManagedObject * obj=, Class *
> > iid=)  Line 674 + 0xc C++
> >
> > (3)object_handles.cpp
> >
> > void GcFrame::add_object(ManagedObject** p)
> > {
> > assert(p);
> >
> > //fails here:
> > *assert(NULL == *p || (*p >= vm_heap_base_address()
> > && *p < vm_heap_ceiling_address()));*
> >
> > *
> > *assert(!hythread_is_suspend_enabled());
> >
> > ensure_capacity();
> > nodes->elements[nodes->obj_size+nodes->mp_size] =
> > nodes->elements[nodes->obj_size];
> > nodes->elements[nodes->obj_size] = (void**)p;
> > nodes->obj_size++;
> > }
> >
> >
> > On 12 Oct 2006 11:55:27 +0700, Egor Pasko <[EMAIL PROTECTED] >
> wrote:
> > >
> > > On the 0x200 day of Apache Harmony Leo Li wrote:
> > > > Hi, all:
> > > >  I now plan to make the self-host of Derby on Harmony.
> > > >  Is there anyone interested in this topic?
> > > >
> > > >  Here is what I encountered in the process. Hope it will be
> helpful
> > > to
> > > > anybody who is interested in it.
> > > >
> > > >  At first, the testcases even fails on RI both on windows and
> ubuntu
> > > and
> > > > the result are different.???
> > > >  After some struggiling, I have successfully passed the
> provided
> > > > testcases on RI after I rebuild the source on my machine.
> > > >  But there still remains a problem:
> > > >  The derby team kindly rewrite the launcher for testcases in
> order
> > > to
> > > > treat J9 vm differently if the property java.vm.name starts with
> "j9".
> > > But
> > > > the j9 vm used in Harmony has been customized thus is different
> from
> > > > traditional j9 vm that is expected by derby. This leads to failure
> to
> > > launch
> > > > tests.
> > > >  I will talk on Derby's mailing list to find a solution.
> > >
> > > Is it real to run Derby on DRLVM without intelligent tweaking of
> > > Derby? I am looking forward at the moment when it is. Please, do not
>
> > > hesitate to file a bug against DRLVM if you find it performing not
> > > very well with Derby. That would be valuable!
> > >
> > > I tried: 'java org.apache.derby.tools.sysinfo' and it produced a
> > > quite-good output on my DRLVM snapshot, but I have no idea, how to
> run
> > > the tests :)
> > >
> > > P.S.: Congratulations, all! Today is the 0x200 day of Apache Harmony
> > > (if I count it right:) We made a significant progress since. I love
> > > the project! Let it keep going well! ;oP
> > >
> > > --
> > > Egor Pasko, Intel Managed Runtime Division
> > >
> > >
> > >
> -
> > > Terms of use : http://incubator.apache.org/harmony/mailing.html
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail:
> [EMAIL PROTECTED]
> > >
> > >
> >
> >
> > --
> > Leo Li
> > China Software Development Lab, IBM
>
> --
> Egor Pasko, Intel Managed Runtime Division
>
>
> -
> Terms of use : http://incubator.apache.org/harmony/mailing.html
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


--
Leo Li
China Software Development Lab, IBM





--
Leo Li
China Software Development Lab, IBM


Re: [classlib]Self-host of Derby

2006-10-11 Thread Leo Li

Ok.:)

On 12 Oct 2006 13:38:34 +0700, Egor Pasko <[EMAIL PROTECTED]> wrote:


On the 0x200 day of Apache Harmony Leo Li wrote:
> Hi, Egor:
>  I have tried to run it on drlvm, but it reported error:
>
>Assertion failed!
>Progrma: ...java.exe
>File:Object_handles.cpp
>Line:99
>
>Expression: NULL==*p || (*p>=vm_heap_base_address() &&
> *p After I debug into it I got
> (1)
> Unhandled exception at 0x00711eed (harmonyvm.dll) in java.exe: User
> breakpoint.
>
> (2)The call stack is
> > harmonyvm.dll!_assert(const char * expr=0x007bd848, const char *
> filename=0x007bd800, unsigned int lineno=99)  Line 295 C
>   harmonyvm.dll!GcFrame::add_object(ManagedObject * *
p=0x0013e9cc)  Line 99
> + 0x31 C++
>   harmonyvm.dll!compile_protect_arguments(Method * method=0x0393da50,
> GcFrame * gc=0x0013e95c)  Line 113 C++
>   harmonyvm.dll!compile_jit_a_method(Method * method=0x0393da50)  Line
824 +
> 0xd C++
>   013900dd()
>   harmonyvm.dll!VM_Statistics::get_vm_stats()  Line 325 + 0x14 C++
>   harmonyvm.dll!rth_get_interface_vtable(ManagedObject * obj=, Class *
> iid=)  Line 674 + 0xc C++
>
> (3)object_handles.cpp
>
> void GcFrame::add_object(ManagedObject** p)
> {
> assert(p);
>
> //fails here:
> *assert(NULL == *p || (*p >= vm_heap_base_address()
> && *p < vm_heap_ceiling_address()));*
>
> *
> *assert(!hythread_is_suspend_enabled());
>
> ensure_capacity();
> nodes->elements[nodes->obj_size+nodes->mp_size] =
> nodes->elements[nodes->obj_size];
> nodes->elements[nodes->obj_size] = (void**)p;
> nodes->obj_size++;
> }
>
>
> On 12 Oct 2006 11:55:27 +0700, Egor Pasko <[EMAIL PROTECTED]> wrote:
> >
> > On the 0x200 day of Apache Harmony Leo Li wrote:
> > > Hi, all:
> > >  I now plan to make the self-host of Derby on Harmony.
> > >  Is there anyone interested in this topic?
> > >
> > >  Here is what I encountered in the process. Hope it will be
helpful
> > to
> > > anybody who is interested in it.
> > >
> > >  At first, the testcases even fails on RI both on windows and
ubuntu
> > and
> > > the result are different.???
> > >  After some struggiling, I have successfully passed the provided
> > > testcases on RI after I rebuild the source on my machine.
> > >  But there still remains a problem:
> > >  The derby team kindly rewrite the launcher for testcases in
order
> > to
> > > treat J9 vm differently if the property java.vm.name starts with
"j9".
> > But
> > > the j9 vm used in Harmony has been customized thus is different from
> > > traditional j9 vm that is expected by derby. This leads to failure
to
> > launch
> > > tests.
> > >  I will talk on Derby's mailing list to find a solution.
> >
> > Is it real to run Derby on DRLVM without intelligent tweaking of
> > Derby? I am looking forward at the moment when it is. Please, do not
> > hesitate to file a bug against DRLVM if you find it performing not
> > very well with Derby. That would be valuable!
> >
> > I tried: 'java org.apache.derby.tools.sysinfo' and it produced a
> > quite-good output on my DRLVM snapshot, but I have no idea, how to run
> > the tests :)
> >
> > P.S.: Congratulations, all! Today is the 0x200 day of Apache Harmony
> > (if I count it right:) We made a significant progress since. I love
> > the project! Let it keep going well! ;oP
> >
> > --
> > Egor Pasko, Intel Managed Runtime Division
> >
> >
> > ---------
> > Terms of use : http://incubator.apache.org/harmony/mailing.html
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>
>
> --
> Leo Li
> China Software Development Lab, IBM

--
Egor Pasko, Intel Managed Runtime Division


-
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





--
Leo Li
China Software Development Lab, IBM


Re: [classlib]Self-host of Derby

2006-10-11 Thread Leo Li

Hi, Egor:
I have tried to run it on drlvm, but it reported error:

  Assertion failed!
  Progrma: ...java.exe
  File:Object_handles.cpp
  Line:99

  Expression: NULL==*p || (*p>=vm_heap_base_address() &&
*p
harmonyvm.dll!_assert(const char * expr=0x007bd848, const char *

filename=0x007bd800, unsigned int lineno=99)  Line 295 C
 harmonyvm.dll!GcFrame::add_object(ManagedObject * * p=0x0013e9cc)  Line 99
+ 0x31 C++
 harmonyvm.dll!compile_protect_arguments(Method * method=0x0393da50,
GcFrame * gc=0x0013e95c)  Line 113 C++
 harmonyvm.dll!compile_jit_a_method(Method * method=0x0393da50)  Line 824 +
0xd C++
 013900dd()
 harmonyvm.dll!VM_Statistics::get_vm_stats()  Line 325 + 0x14 C++
 harmonyvm.dll!rth_get_interface_vtable(ManagedObject * obj=, Class *
iid=)  Line 674 + 0xc C++

(3)object_handles.cpp

void GcFrame::add_object(ManagedObject** p)
{
   assert(p);

//fails here:
   *assert(NULL == *p || (*p >= vm_heap_base_address()
   && *p < vm_heap_ceiling_address()));*

*
*assert(!hythread_is_suspend_enabled());

   ensure_capacity();
   nodes->elements[nodes->obj_size+nodes->mp_size] =
nodes->elements[nodes->obj_size];
   nodes->elements[nodes->obj_size] = (void**)p;
   nodes->obj_size++;
}


On 12 Oct 2006 11:55:27 +0700, Egor Pasko <[EMAIL PROTECTED]> wrote:


On the 0x200 day of Apache Harmony Leo Li wrote:
> Hi, all:
>  I now plan to make the self-host of Derby on Harmony.
>  Is there anyone interested in this topic?
>
>  Here is what I encountered in the process. Hope it will be helpful
to
> anybody who is interested in it.
>
>  At first, the testcases even fails on RI both on windows and ubuntu
and
> the result are different.???
>  After some struggiling, I have successfully passed the provided
> testcases on RI after I rebuild the source on my machine.
>  But there still remains a problem:
>  The derby team kindly rewrite the launcher for testcases in order
to
> treat J9 vm differently if the property java.vm.name starts with "j9".
But
> the j9 vm used in Harmony has been customized thus is different from
> traditional j9 vm that is expected by derby. This leads to failure to
launch
> tests.
>  I will talk on Derby's mailing list to find a solution.

Is it real to run Derby on DRLVM without intelligent tweaking of
Derby? I am looking forward at the moment when it is. Please, do not
hesitate to file a bug against DRLVM if you find it performing not
very well with Derby. That would be valuable!

I tried: 'java org.apache.derby.tools.sysinfo' and it produced a
quite-good output on my DRLVM snapshot, but I have no idea, how to run
the tests :)

P.S.: Congratulations, all! Today is the 0x200 day of Apache Harmony
(if I count it right:) We made a significant progress since. I love
the project! Let it keep going well! ;oP

--
Egor Pasko, Intel Managed Runtime Division


-
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





--
Leo Li
China Software Development Lab, IBM


[classlib]Self-host of Derby

2006-10-11 Thread Leo Li

Hi, all:
I now plan to make the self-host of Derby on Harmony.
Is there anyone interested in this topic?

Here is what I encountered in the process. Hope it will be helpful to
anybody who is interested in it.

At first, the testcases even fails on RI both on windows and ubuntu and
the result are different.???
After some struggiling, I have successfully passed the provided
testcases on RI after I rebuild the source on my machine.
But there still remains a problem:
The derby team kindly rewrite the launcher for testcases in order to
treat J9 vm differently if the property java.vm.name starts with "j9". But
the j9 vm used in Harmony has been customized thus is different from
traditional j9 vm that is expected by derby. This leads to failure to launch
tests.
I will talk on Derby's mailing list to find a solution.

--
Leo Li
China Software Development Lab, IBM


Re: [classlib][launcher]shall we handle the parameter -version and -showversion in launcher or vm?

2006-10-11 Thread Leo Li

Due to current VMI, we have to first create a java VM through
JNI_CreateJavaVM, then we can get property from functions defined by VMI. It
is possible not to change current vmi design and support java -version, but
we have to create and then "kill" a new java vm. So I think it quite
wastes.
I suggest the vmi.dll export another funciton to give out some "static"
property of the java vm  implementation that is no relevent to a live vm.

On 10/12/06, Geir Magnusson Jr. <[EMAIL PROTECTED]> wrote:




Tony Wu wrote:
> I encounter an error[1] when run java -version with IBM VME today and
> it is ok on DRLVM. I wonder how to handle these simple parameters. Is
> there any decision
> about that?
>
> [1]
> [EMAIL PROTECTED]:~/harmony/workspace/trunk/deploy/jdk/jre/bin$ ./java
-version
> Apache Harmony Launcher : (c) Copyright 1991, 2006 The Apache Software
> Foundation or its licensors, as applicable.
> JVMJ9VM007E Command-line option unrecognised: -version
> HMYEXEL062E Internal VM error: Failed to create Java VM
> FAILED to invoke JVM.
>

Yes, we won't pass -version into the VM, but simply have an expectation
that the VM will set a property that can be read by the launcher post VM
init.

geir

-
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





--
Leo Li
China Software Development Lab, IBM


Re: [classlib][build]Lacks liblcms.a libpng.a and etc on Linux and recommend to add them to fetch-depends target

2006-10-10 Thread Leo Li

Hi, Gregory:

On 10/11/06, Gregory Shimansky <[EMAIL PROTECTED]> wrote:


On Sunday 08 October 2006 12:39 Leo Li wrote:
> Hi, all
>  Current harmony build script on linux requires liblcms.a libpng.aand
> several .h files such as png.h but not installed on my redhat linux
> platform. Although as the script prompts out, ubuntu can download such
> files seperately, while other platform such as my redhat or suse, rpm
might
> be the only source to get new softwares from internet which leads to a
lot
> of troubles. For examples, the dependency between those rpms and the
> default installation destinations of these rpms are not the places
Harmony
> script expects.
>  So, I think, it will be good if the build script can download these
> required files automatically when they are absent.

Show me a single Linux distribution which doesn't provide development
files
for any library (except for 3rd party binaries) it includes. Providing
them
from harmony is really not necessary. It is a matter of system
configuration
by an individual developer and if it is too hard to find necessary
packages
in redhat there are more developer oriented (although redhat includes all
necessary packages, I assure you) distributions (no Gentoo advertising
from
me here).

FOR LEO
^^^

Using rpmfind or rpmsearch (call it rpm hell like dll hell in windows) is
really a wrong way, there sites often includes unofficial packages, it
requires you to carefully chose your distribution version, etc.

The version which you've installed should have registered package sources
(be
it CD or http/ftp) from the official mirror. Search in it for
libpng1-devel
(or whatever form redhat has for this package) to install it. Also
uninstall
all the zoo you've found on the net before you do it, otherwise you'll get
installation conflicts for sure.



But I cannot find the rpm for liblcms.a and icc34.h in the CD. There is no
liblcms*.rpm or lcms*.rpm.  And what do you mean official mirror, the redhat
site?

Although I admit rpmfind is not a good way, but it really works after I
installed all the necessary packages and put the required files to the
appropriate position.

At least Harmony should gives some hints, for example, which rpm is required
and where to get them. Since not every body is an expert of rpm, and aware
of  the relationship between the required files and rpms, as well as their
versions, as you said, "the rpm hell".

--

Gregory Shimansky, Intel Middleware Products Division

-
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





--
Leo Li
China Software Development Lab, IBM


Re: [build] DRLVM build on Windows

2006-10-10 Thread Leo Li

Hi Alexey:
   I have just updated and built the drlvm on windows. And it succeeds.:)


On 10/10/06, Alexey Petrenko <[EMAIL PROTECTED]> wrote:


Guys,

I have not built DRLVM for a few days.
But after last update it fails with the following error on Windows:

BUILD FAILED
C:\Work\Harmony\drlvm\trunk\build\make\build.xml:406: The following
error occurred while executing this line:
C:\Work\Harmony\drlvm\trunk\build\make\build.xml:413: The following
error occurred while executing this line:
C:\Work\Harmony\drlvm\trunk\build\make\build_component.xml:72: The
following error occurred while executing this line:

C:\Work\Harmony\drlvm\trunk\build\win_ia32_msvc_debug\semis\build\targets\build
native.xml:75: Command line is over maximum length without specifying
source file

"build clean" and removing downloaded dependencies does not help.

Is there any ideaas how ti fix this?

Thanks in advance.

SY, Alexey

--
Alexey A. Petrenko
Intel Middleware Products Division

-
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





--
Leo Li
China Software Development Lab, IBM


Re: [classlib][build]Lacks liblcms.a libpng.a and etc on Linux and recommend to add them to fetch-depends target

2006-10-08 Thread Leo Li

Hi, Alexey:
No I do not installed the developer versions of these rpms, but I have
made it work...mm after struggling The same rpm has different
configurations due to different providers. For examples, those from rpmfind
and those redhat iteself provides.
So I recommend Harmony to provide such required files if possbile.


On 10/8/06, Alexey Petrenko <[EMAIL PROTECTED]> wrote:


Have you also installed developer versions of these rpms?

2006/10/8, Leo Li <[EMAIL PROTECTED]>:
> Hi, Mark:
> First I downloaded and installed the rpms for openpkg, png, jpeg,
tiff,
> lcms because of the dependency relationship between them.
> Secondly, the installed files are in /openpkg, so I then copy the .a
> and .h files to /usr/lib and /usr/include.
> If I can find the .a or .h file, I can add them to the /usr/lib and
> /usr/include directories. But how can I find them if I do not use rpm?
> Redhat itself does not provide the function to download required file
from
> a software center as unbuntu does.
> I will try yum, thank you for your advice.
>
>


--
Alexey A. Petrenko
Intel Middleware Products Division

-
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





--
Leo Li
China Software Development Lab, IBM


Re: [classlib][build]Lacks liblcms.a libpng.a and etc on Linux and recommend to add them to fetch-depends target

2006-10-08 Thread Leo Li

Hi, Mark:
First I downloaded and installed the rpms for openpkg, png, jpeg, tiff,
lcms because of the dependency relationship between them.
Secondly, the installed files are in /openpkg, so I then copy the .a
and .h files to /usr/lib and /usr/include.
If I can find the .a or .h file, I can add them to the /usr/lib and
/usr/include directories. But how can I find them if I do not use rpm?
Redhat itself does not provide the function to download required file from
a software center as unbuntu does.
I will try yum, thank you for your advice.


[classlib][math]BigInteger should have an unexpected "protected clone()" method

2006-10-08 Thread Leo Li

Hi, all
I found that BigInteger have a protected clone() method while as the
spec says BigInteger itself does not implement Cloneable. The clone() method
just new an instance of itself instead of super().clone.Although it is not
public, the Clone() method might lead to side-effect if some Object extends
from it and implements Cloneable.

Here is an testcase:

public class TestCloneable extends TestCase {

public void testClone()
{
 MyBigInteger myBigInteger = new MyBigInteger("12345");
 myBigInteger = (MyBigInteger)myBigInteger.clone();
}
}


class MyBigInteger extends BigInteger implements Cloneable {

public MyBigInteger(String val) {
 super(val);
}

public Object clone()
{
 try {
  return super.clone();
 } catch (CloneNotSupportedException e) {
  return null;
 }
}
}
RI passes while Harmony fails.

Actually this method is called just in order to copy itself so as to remain
immutable in BigInteger's other methods, I recommend to rename the method
not so sensitivly as "Clone". If no one objects, I will raise a jira and
create a patch for it.
--
Leo Li
China Software Development Lab, IBM


[classlib][build]Lacks liblcms.a libpng.a and etc on Linux and recommend to add them to fetch-depends target

2006-10-08 Thread Leo Li

Hi, all
Current harmony build script on linux requires liblcms.a libpng.a and
several .h files such as png.h but not installed on my redhat linux
platform. Although as the script prompts out, ubuntu can download such files
seperately, while other platform such as my redhat or suse, rpm might be the
only source to get new softwares from internet which leads to a lot of
troubles. For examples, the dependency between those rpms and the default
installation destinations of these rpms are not the places Harmony script
expects.
So, I think, it will be good if the build script can download these
required files automatically when they are absent.
--
Leo Li
China Software Development Lab, IBM


Re: [classlib][doc]Recommend to remove trunk\doc\kernel_doc and trunk\doc\vm_doc from svn repository.

2006-09-29 Thread Leo Li

Hi, all:
I will raise a jira to remove the generated documents from svn.


On 9/30/06, Geir Magnusson Jr. <[EMAIL PROTECTED]> wrote:



On Sep 29, 2006, at 1:03 PM, Paulex Yang wrote:

> Geir Magnusson Jr. wrote:
>>
>> On Sep 28, 2006, at 5:15 AM, Morozova, Nadezhda wrote:
>>
>>> Do you think we can have the docs built on a regular basis (like, a
>>> script that triggers Doxygen build say 2 times a week + on demand to
>>> push updates if needed) and resulting docs stored on the website?
>>> This way, you don't have SVN versioning for auto-generated
>>> content and
>>> keep info available for all.
>>>
>>
>> I'm still pro stuffing the generated content into the svn fo the
>> website, and then pushing that out, because in the next snapshot,
>> I want to start getting into the habit of including the entire
>> website generated docs (except tim's eclipse movie) in the tar
>> file, so that users have information at the ready when they download.
>>
>> So +1 for :
>>
>> - getting the generated stuff out of classlib and drlvm trees
>> - autogenerating as part of our CI
>> - putting into SVN of website
>> - publishing
> AFAIK, publishing to website still needs some manual work? (ssh,
> update or so)

For now, yes, although with these new-fangled television-typewriters,
I hear you can make them do things automatically.  :)

geir


>>
>> geir
>>
>>
>>
>
>
> --
> Paulex Yang
> China Software Development Lab
> IBM
>
>
> -
> Terms of use : http://incubator.apache.org/harmony/mailing.html
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>


-
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





--
Leo Li
China Software Development Lab, IBM


[classlib][luni]Double.toString gets different result from RI

2006-09-28 Thread Leo Li

Hi,all:
   I find one testcase of DoubleTest fails on RI. After digging into it, I
find that it is due to the different behaviors of Double.toString between
Harmony and RI.
   Here is a testcase:
   public class DoubleTest extends TestCase {
   public void test_toString(){
   String actual = Double.toString(1e23D);
   String expected = "9.999E22";
   assertEquals(expected,actual);
   }
}
  Because of the limitation of double/float's precision, different numbers
are mapped to the same double value. So I think it is the different
implementation that lead to the different toString() result which represents
different original number before mapping. Thus it can be regarded as a
non-bug difference between RI and Harmony and I recommend to remove the
testcase.

Result
RI:  Pass
HR:  Fail


--
Leo Li
China Software Development Lab, IBM


[classlib][doc]Recommend to remove trunk\doc\kernel_doc and trunk\doc\vm_doc from svn repository.

2006-09-28 Thread Leo Li

Hi, all:
I have fixed the script to generate vm_doc but there is a problem: the
newly generated vm_doc will override the original one which is under control
of svn. Thus it will lead to build failure since vm_doc lacks from the
perspective of svn. Since the content under the directories
of  trunk\doc\kernel_doc and trunk\doc\vm_doc can be generated accordingly,
I recommend to remove them from svn control as the doc of classlib does.

--
Leo Li
China Software Development Lab, IBM


Re: [classlib][launcher] I am looking at the interaction between {classlib, launcher, drlvm} and {hysock, hysig, hythread}

2006-09-26 Thread Leo Li

Hi, Weldon:
Which file includes signalProtectMain() or  gpProtectedMain ? :)


On 9/25/06, Weldon Washburn <[EMAIL PROTECTED]> wrote:


It looks like hysignal.c is using the right monitor enter/exit().  That
is,
the one
from  drlvm/trunk/build/win_ia32_msvc_debug/deploy/jre/bin/hythr.dll

However, a bunch of functions in classlib's hysignal.c have an incoming
argument of "HyPortLibrary *portlib".  The portlib variable can either
point
to the original classlib portlib C struct.  Or it can point to PORTLIB
which
is a C struct with all the entries nulled out (more on this later.)

I think the next question to ask is what hysignal.c does with
the "HyPortLibrary *portlib" argument.  If anyone knows, please tell us.
Otherwise I will keep digging.

From stepping through DRLVM bootup, it looks like classlib's portlib is
_dropped_  in signalProtectMain().  Then launcher gpProtectedMain calls
invocation(PORTLIB,...) where PORTLIB is a nulled out HyPortLibrary C
struct.  We need to put comments in the code describing the switch from
classlib's portlib to drlvm's nulled out version.

On 9/22/06, Weldon Washburn <[EMAIL PROTECTED]> wrote:
>
> All,
> Its not clear at this moment what threading implementation is being
> executed when hysignal.c calls hythread_monitor_enter().  If someone
> already knows, please tell us.  Otherwise,  I will step through it with
the
> debugger to find out what is going on.
>   - Weldon
>
> --
> Weldon Washburn
> Intel Middleware Products Division
>



--
Weldon Washburn
Intel Middleware Products Division





--
Leo Li
China Software Development Lab, IBM


Re: [classlib][launcher] I am looking at the interaction between {classlib, launcher, drlvm} and {hysock, hysig, hythread}

2006-09-26 Thread Leo Li

Hi, Weldon:
If you have a built Harmony classlib, you can find the doc in
HarmonyRoot/doc/vm_doc/html/group__Port.html or other htmls in the
directory.

On 9/27/06, Weldon Washburn <[EMAIL PROTECTED]> wrote:


On 9/26/06, Leo Li <[EMAIL PROTECTED]> wrote:
>
> Hi, Weldon:
> The usage of the argument of portLibrary is for the function to call
> other functions of the port library if needed. The argument is just a
> virtual function table, as you said, can be any implemenatation of the
> HyPortLibrary struct, not only the HyPortLibrary struct the function
> belongs
> to. Of course, different HyPortLibrary might lead to different behavior
of
> the function if the HyPortLibrary is used by it.
> I think the main purpose of the design is to alter some function of
a
> specified HyPortLibrary struct flexibly, especially at runtime: What is
> necessary to do is just to change an entry in HyPortLibrary while the
> altered function can make use of other functions as well as other
> functions
> can use it.
>Am I all right?:)



Hmmm... Interesting idea you have.  Basically the idea is to rewrite the
virtual function table _before_ any of the functions are used.  This makes
much more sense than the way drlvm currently boots up.  By the way, is
there
any documentation that says what you are suggesting?  In other words, was
portlib specifically designed to do what you suggest?

On 9/25/06, Weldon Washburn <[EMAIL PROTECTED]> wrote:
> >
> > It looks like hysignal.c is using the right monitor
enter/exit().  That
> > is,
> > the one
> > from  drlvm/trunk/build/win_ia32_msvc_debug/deploy/jre/bin/hythr.dll
> >
> > However, a bunch of functions in classlib's hysignal.c have an
incoming
> > argument of "HyPortLibrary *portlib".  The portlib variable can either
> > point
> > to the original classlib portlib C struct.  Or it can point to PORTLIB
> > which
> > is a C struct with all the entries nulled out (more on this later.)
> >
> > I think the next question to ask is what hysignal.c does with
> > the "HyPortLibrary *portlib" argument.  If anyone knows, please tell
us.
> > Otherwise I will keep digging.
> >
> > From stepping through DRLVM bootup, it looks like classlib's portlib
is
> > _dropped_  in signalProtectMain().  Then launcher gpProtectedMain
calls
> > invocation(PORTLIB,...) where PORTLIB is a nulled out HyPortLibrary C
> > struct.  We need to put comments in the code describing the switch
from
> > classlib's portlib to drlvm's nulled out version.
> >
> > On 9/22/06, Weldon Washburn <[EMAIL PROTECTED]> wrote:
> > >
> > > All,
> > > Its not clear at this moment what threading implementation is being
> > > executed when hysignal.c calls hythread_monitor_enter().  If someone
> > > already knows, please tell us.  Otherwise,  I will step through it
> with
> > the
> > > debugger to find out what is going on.
> > >   - Weldon
> > >
> > > --
> > > Weldon Washburn
> > > Intel Middleware Products Division
> > >
> >
> >
> >
> > --
> > Weldon Washburn
> > Intel Middleware Products Division
> >
> >
>
>
> --
> Leo Li
> China Software Development Lab, IBM
>
>


--
Weldon Washburn
Intel Middleware Products Division





--
Leo Li
China Software Development Lab, IBM


Re: [classlib][launcher] I am looking at the interaction between {classlib, launcher, drlvm} and {hysock, hysig, hythread}

2006-09-26 Thread Leo Li

Hi, Weldon:
The usage of the argument of portLibrary is for the function to call
other functions of the port library if needed. The argument is just a
virtual function table, as you said, can be any implemenatation of the
HyPortLibrary struct, not only the HyPortLibrary struct the function belongs
to. Of course, different HyPortLibrary might lead to different behavior of
the function if the HyPortLibrary is used by it.
I think the main purpose of the design is to alter some function of a
specified HyPortLibrary struct flexibly, especially at runtime: What is
necessary to do is just to change an entry in HyPortLibrary while the
altered function can make use of other functions as well as other functions
can use it.
   Am I all right?:)



On 9/25/06, Weldon Washburn <[EMAIL PROTECTED]> wrote:


It looks like hysignal.c is using the right monitor enter/exit().  That
is,
the one
from  drlvm/trunk/build/win_ia32_msvc_debug/deploy/jre/bin/hythr.dll

However, a bunch of functions in classlib's hysignal.c have an incoming
argument of "HyPortLibrary *portlib".  The portlib variable can either
point
to the original classlib portlib C struct.  Or it can point to PORTLIB
which
is a C struct with all the entries nulled out (more on this later.)

I think the next question to ask is what hysignal.c does with
the "HyPortLibrary *portlib" argument.  If anyone knows, please tell us.
Otherwise I will keep digging.

From stepping through DRLVM bootup, it looks like classlib's portlib is
_dropped_  in signalProtectMain().  Then launcher gpProtectedMain calls
invocation(PORTLIB,...) where PORTLIB is a nulled out HyPortLibrary C
struct.  We need to put comments in the code describing the switch from
classlib's portlib to drlvm's nulled out version.

On 9/22/06, Weldon Washburn <[EMAIL PROTECTED]> wrote:
>
> All,
> Its not clear at this moment what threading implementation is being
> executed when hysignal.c calls hythread_monitor_enter().  If someone
> already knows, please tell us.  Otherwise,  I will step through it with
the
> debugger to find out what is going on.
>   - Weldon
>
> --
> Weldon Washburn
> Intel Middleware Products Division
>



--
Weldon Washburn
Intel Middleware Products Division





--
Leo Li
China Software Development Lab, IBM


Re: [classlib][luni]To open warning as error on Linux

2006-09-25 Thread Leo Li

 Thank you, Ivan.
 I will let it pass GCC4.x.


On 9/25/06, Ivan Volosyuk <[EMAIL PROTECTED]> wrote:


It helps to maintain code with less potential problems in it. AFAIK,
GCC 3.x warnings is just a subset of GCC 4.x warnings. So, if we fix
warnings on GCC 4.x the code will compile without warnings on either
version of GCC.
--
Ivan

On 9/25/06, Alexey Petrenko <[EMAIL PROTECTED]> wrote:
> If this is a potential build problem do we really need to set this
option?
>
> 2006/9/25, Leo Li <[EMAIL PROTECTED]>:
> > Hi, all
> >  I plan to give a patch that fixed all warning in native code of
luni on
> > Linux and then set Werror in luni makefile.
> >  But now I have a problem: Different versions of gcc have
different
> > definitions of warnings, for example, the file can build on my default
> > GCC3.0.4 of RH but fails on GCC4.0.3 of my colleague's ubuntu if I set
> > warning as error on. Although I can fix it on GCC4.0.3, what about
other
> > versions?
> > So my question is whether we have our default or reference version
of
> > GCC?:)
--
Ivan
Intel Middleware Products Division

-
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





--
Leo Li
China Software Development Lab, IBM


Re: [classlib][luni]To open warning as error on Linux

2006-09-25 Thread Leo Li

Hi, Alexey:
It can help to avoid the situation that Harmony builds successfully on
Linux while fails on windows since its -W3 is on as talked in such thread:

http://www.mail-archive.com/harmony-dev@incubator.apache.org/msg13806.html

On 9/25/06, Alexey Petrenko <[EMAIL PROTECTED] > wrote:


If this is a potential build problem do we really need to set this option?

2006/9/25, Leo Li < [EMAIL PROTECTED]>:
> Hi, all
>  I plan to give a patch that fixed all warning in native code of
luni on
> Linux and then set Werror in luni makefile.
>  But now I have a problem: Different versions of gcc have different
> definitions of warnings, for example, the file can build on my default
> GCC3.0.4 of RH but fails on GCC4.0.3 of my colleague's ubuntu if I set
> warning as error on. Although I can fix it on GCC4.0.3 , what about
other
> versions?
> So my question is whether we have our default or reference version
of
> GCC?:)
>
>
>
> --
> Leo Li
> China Software Development Lab, IBM
>
>


--
Alexey A. Petrenko
Intel Middleware Products Division

-
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





--
Leo Li
China Software Development Lab, IBM


[classlib][luni]To open warning as error on Linux

2006-09-24 Thread Leo Li

Hi, all
I plan to give a patch that fixed all warning in native code of luni on
Linux and then set Werror in luni makefile.
But now I have a problem: Different versions of gcc have different
definitions of warnings, for example, the file can build on my default
GCC3.0.4 of RH but fails on GCC4.0.3 of my colleague's ubuntu if I set
warning as error on. Although I can fix it on GCC4.0.3, what about other
versions?
   So my question is whether we have our default or reference version of
GCC?:)



--
Leo Li
China Software Development Lab, IBM


Re: [classlib][luni] Put setInterruptAction() in our j.l.Thread stub?

2006-09-20 Thread Leo Li

Hi, all
I will volunteer to generate the document and add it to the website.


On 9/14/06, Geir Magnusson Jr. <[EMAIL PROTECTED]> wrote:


So - no matter what happens w/ the docs, we do need this in the code...

geir


Tim Ellison wrote:
> yep -- that's what I meant.  The on-line doc should be generated from
> the code comments as it is today.
>
> Regards,
> Tim
>
> Morozova, Nadezhda wrote:
>> As I got it, the referenced documentation is created from code already,
>> so I don't quite get Geir's comment ;(
>> Anyway, I agree that keeping docs up-to-date is important. Do you think
>> we can ask the community to update comments with the code changes? This
>> way, the docs will never be out-of-sync. And those reading the code
will
>> have a better understanding of what it does.
>>
>> Best regards,
>> Nadya Morozova
>>
>>
>> -Original Message-
>> From: Geir Magnusson Jr. [mailto:[EMAIL PROTECTED]
>> Sent: Thursday, September 14, 2006 5:36 PM
>> To: harmony-dev@incubator.apache.org
>> Subject: Re: [classlib][luni] Put setInterruptAction() in our
j.l.Thread
>> stub?
>>
>> true, but there's no reason why this couldn't be in the code too...
>>
>> geir
>>
>> Tim Ellison wrote:
>>> Our VM interface documentation[1] is drifting out of sync with code
>>> changes.  If anyone has time to refresh it, with help from the dev
>> list,
>>> that would be a very valuable task.  We should ensure that VM writers
>>> understand how to get the harmony class library code working with
>> their VM.
>>> [1] amongst others,
>>>
>>
http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/d
>> oc/kernel_doc/html/index.html?view=co
>>> Regards,
>>> Tim
>>>
>>>
>>> Oliver Deakin wrote:
>>>> Geir Magnusson Jr. wrote:
>>>>> This came up in another thread.
>>>>>
>>>>> Currently, java.nio.channels.spi.AbstractInterruptibleChannel
>> depends
>>>>> on there being a setInterruptAction() method on java.lang.Thread.
>>>>>
>>>>> I certainly think that this kind of thing should be documented, so
>> the
>>>>> question - should we add this to our Thread stub class?
>>>> Yes we should - I didn't realise initially that this method was being
>>>> used (since it was private).
>>>> Now we know it's in use in AbstractInterruptibleChannel, we'd better
>> put
>>>> some doc in for future
>>>> kernel writers. Can someone just bring back the original comments and
>>>> method stub that was
>>>> there?
>>>>
>>>> Regards,
>>>> Oliver
>>>>
>>>>> geir
>>>>>
>>>>>
>> -
>>>>> Terms of use : http://incubator.apache.org/harmony/mailing.html
>>>>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>>>>> For additional commands, e-mail:
>> [EMAIL PROTECTED]
>> ---------
>> Terms of use : http://incubator.apache.org/harmony/mailing.html
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>> -
>> Terms of use : http://incubator.apache.org/harmony/mailing.html
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
>

-
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





--
Leo Li
China Software Development Lab, IBM


Re: [classlib]build failed on windows

2006-09-20 Thread Leo Li

Hi, Paulex:
I plan to fix the warning in module luni first if no one objects.:)

On 9/21/06, Paulex Yang <[EMAIL PROTECTED]> wrote:


Leo Li wrote:
> Dear Geir:
>I advise to use -Werror in Linux compiling but I am not sure of
> the
> side-effect.
>I am now trying to know whether all the warning can be fixed in
> Linux.:)
Volunteer is welcome:).

If the errors number is too large to be fixed in one run, I suggest to
fix them one module by another.
>
>
>
> On 9/21/06, Geir Magnusson Jr. <[EMAIL PROTECTED]> wrote:
>>
>> Sorry.  My fault.  Fixing now.
>>
>> I need to find settings to make gcc on linux enforce the same...
>>
>> geir
>>
>> On Sep 20, 2006, at 9:36 PM, Leo Li wrote:
>>
>> > Hi, all
>> > I found that the classlib build fails on windows today.
>> > I have tried to fixed it in File main.c
>> >   1. move some declarations of variables to the top part of a
>> > function.
>> >   at line 311: char *dirs[2];
>> >   at line 1045: int found = 0;
>> >          int i=0;
>> >   at line  1067:int strLen
>> >   2. comments out unused variable at line 1019:  //UDATA
>> > newPathLength;
>> > --
>> > Leo Li
>> > China Software Development Lab, IBM
>>
>>
>> -
>> Terms of use : http://incubator.apache.org/harmony/mailing.html
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
>
>


--
Paulex Yang
China Software Development Lab
IBM



-
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





--
Leo Li
China Software Development Lab, IBM


Re: [classlib][build] failure?

2006-09-20 Thread Leo Li

Dear Mark:
   You are right. Thank you. It really works.
   I will try to set -Werror option to see if all reported warning. can
be fixed.


On 9/20/06, Mark Hindess <[EMAIL PROTECTED]> wrote:



On 20 September 2006 at 10:06, Mark Hindess <[EMAIL PROTECTED] >
wrote:
>
> On 20 September 2006 at 10:03, "Leo Li" <[EMAIL PROTECTED]> wrote:
> >
> > Hi, all:
> >
> > Since I am not an expert of gcc, I think we need a guru to set the
flags in
> > makefile of linux:
> > 1. It will report any required warnings and regard it as error to lead
a
> > failure build so that it is forced for us to correct it.
> >
> > 2. It can avoid to stop building due to such warnings:
> >
> > In OSFileSystem.c, we have:
> > JNIEXPORT jlong JNICALL
> > Java_org_apache_harmony_luni_platform_OSFileSystem_readDirectImpl
> >   (JNIEnv * env, jobject thiz, jlong fd, jlong buf, jint offset, jint
> > nbytes)
> > {
> >   PORT_ACCESS_FROM_ENV (env);
> >   return (jlong) hyfile_read ((IDATA) fd, (void *) (buf+offset),
(IDATA)
> > nbytes);
> > }
> > Actually, the hyfile_read returns a int32 while the jlong is int64. I
think
> > the warning seems to be not avoidable.
>
> I don't think that is the problem.  Casting from 32bit to 64bit is going
> to lead to a loss of information.

Oops.  I meant "isn't going to".
-Mark.

> > I have had tried some flags, but I have not got what I want.
> > Any good suggestion?
>
> The problem occurs because (buf+offset) is a 64bit value (since buf is
> 64bit) and void* is a 32bit value (on x86).  If we cast (buf+offset) to
> a 32bit value before casting to (void*) the warning will be removed.
>
> IDATA (and UDATA) are defined to be integers of the same size as
> pointers for a given platform so if them for the cast then the warning
> can be avoided (and the code will still be correct on x86_64).
>
> So something like:
>
>   return (jlong) hyfile_read ((IDATA) fd,
>   (void *) ((IDATA)(buf+offset)),
>   (IDATA) nbytes);
>
> (I've not tested this and each case should be looked at to see if the
> cast is really valid.)
>
> Regards,
>  Mark.
>
>
>
> -
> Terms of use : http://incubator.apache.org/harmony/mailing.html
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>



-
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





--
Leo Li
China Software Development Lab, IBM


Re: [classlib]build failed on windows

2006-09-20 Thread Leo Li

Dear Geir:
   I advise to use -Werror in Linux compiling but I am not sure of the
side-effect.
   I am now trying to know whether all the warning can be fixed in
Linux.:)



On 9/21/06, Geir Magnusson Jr. <[EMAIL PROTECTED]> wrote:


Sorry.  My fault.  Fixing now.

I need to find settings to make gcc on linux enforce the same...

geir

On Sep 20, 2006, at 9:36 PM, Leo Li wrote:

> Hi, all
> I found that the classlib build fails on windows today.
> I have tried to fixed it in File main.c
>   1. move some declarations of variables to the top part of a
> function.
>   at line 311: char *dirs[2];
>   at line 1045: int found = 0;
>  int i=0;
>   at line  1067:int strLen
>   2. comments out unused variable at line 1019:  //UDATA
> newPathLength;
> --
> Leo Li
> China Software Development Lab, IBM


-
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





--
Leo Li
China Software Development Lab, IBM


Re: [classlib]build failed on windows

2006-09-20 Thread Leo Li

Dear Nathan:
   It works.
   (I manually adjust the difference according to your patch.)
   :)

Good luck!


On 9/21/06, Leo Li <[EMAIL PROTECTED]> wrote:


 Dear Nathan:
I cannot apply it to main.c or module luni. (I guess it is due to
the path of the patch, I am not sure. ) Maybe you can give the patch as an
attachment. :)


 On 9/21/06, Nathan Beyer <[EMAIL PROTECTED]> wrote:
>
> Can you check out the diff in my previous email about this? If that diff
> works for you, or anyone, I'll apply it.
>
> -Nathan
>
> > -----Original Message-
> > From: Leo Li [mailto:[EMAIL PROTECTED]
> > Sent: Wednesday, September 20, 2006 8:36 PM
> > To: harmony-dev@incubator.apache.org
> > Subject: [classlib]build failed on windows
> >
> > Hi, all
> >  I found that the classlib build fails on windows today.
> >  I have tried to fixed it in File main.c
> >1. move some declarations of variables to the top part of a
> > function.
> >at line 311: char *dirs[2];
> >at line 1045: int found = 0;
> >   int i=0;
> >    at line  1067:int strLen
> >2. comments out unused variable at line 1019:  //UDATA
> > newPathLength;
> >  --
> > Leo Li
> > China Software Development Lab, IBM
>
>
> -
> Terms of use : http://incubator.apache.org/harmony/mailing.html
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


--

Leo Li
China Software Development Lab, IBM





--
Leo Li
China Software Development Lab, IBM


Re: [classlib]build failed on windows

2006-09-20 Thread Leo Li

Dear Nathan:
   I cannot apply it to main.c or module luni. (I guess it is due to
the path of the patch, I am not sure. ) Maybe you can give the patch as an
attachment. :)


On 9/21/06, Nathan Beyer <[EMAIL PROTECTED]> wrote:


Can you check out the diff in my previous email about this? If that diff
works for you, or anyone, I'll apply it.

-Nathan

> -Original Message-----
> From: Leo Li [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, September 20, 2006 8:36 PM
> To: harmony-dev@incubator.apache.org
> Subject: [classlib]build failed on windows
>
> Hi, all
>  I found that the classlib build fails on windows today.
>  I have tried to fixed it in File main.c
>1. move some declarations of variables to the top part of a
> function.
>at line 311: char *dirs[2];
>at line 1045: int found = 0;
>   int i=0;
>at line  1067:int strLen
>2. comments out unused variable at line 1019:  //UDATA
> newPathLength;
>  --
> Leo Li
> China Software Development Lab, IBM


-
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





--
Leo Li
China Software Development Lab, IBM


[classlib]build failed on windows

2006-09-20 Thread Leo Li

Hi, all
I found that the classlib build fails on windows today.
I have tried to fixed it in File main.c
  1. move some declarations of variables to the top part of a function.
  at line 311: char *dirs[2];
  at line 1045: int found = 0;
 int i=0;
  at line  1067:int strLen
  2. comments out unused variable at line 1019:  //UDATA newPathLength;
--
Leo Li
China Software Development Lab, IBM


Re: [classlib][build] failure?

2006-09-19 Thread Leo Li

Hi, all:

Since I am not an expert of gcc, I think we need a guru to set the flags in
makefile of linux:
1. It will report any required warnings and regard it as error to lead a
failure build so that it is forced for us to correct it.

2. It can avoid to stop building due to such warnings:

In OSFileSystem.c, we have:
JNIEXPORT jlong JNICALL
Java_org_apache_harmony_luni_platform_OSFileSystem_readDirectImpl
 (JNIEnv * env, jobject thiz, jlong fd, jlong buf, jint offset, jint
nbytes)
{
 PORT_ACCESS_FROM_ENV (env);
 return (jlong) hyfile_read ((IDATA) fd, (void *) (buf+offset), (IDATA)
nbytes);
}
Actually, the hyfile_read returns a int32 while the jlong is int64. I think
the warning seems to be not avoidable.

I have had tried some flags, but I have not got what I want.
Any good suggestion?




On 9/19/06, Geir Magnusson Jr. <[EMAIL PROTECTED]> wrote:


Really - I think the explanation was totally reasonable.  I didn't
understand before why it was asymmetric.

On Sep 19, 2006, at 8:40 AM, Mark Hindess wrote:

>
> Well, I was just pointing out a further inconsistency (awt/
> windows).  I
> don't recall when/why linux errors were downgraded so that might have
> happened before I started hacking the natives around.
>
> Regards,
>  Mark.
>
> On 19 September 2006 at 7:10, "Geir Magnusson Jr." <[EMAIL PROTECTED]>
> wrote:
>> Ok, good - there's a totally reasonable explanation :)
>>
>> geir
>>
>> On Sep 19, 2006, at 7:05 AM, Mark Hindess wrote:
>>
>>>
>>> Incidentally, I had to override the default windows flags to turn
>>> off
>>> the warnings-as-error for the awt native code in order to integrate
>>> it.
>>> I mentioned this on the -dev list at the time hoping to see some
>>> patches
>>> to fix the issues but there haven't been any as yet.
>>>
>>> I agree it would be a good thing to fix for all the native code on
>>> both
>>> platforms.
>>>
>>> Regards,
>>>  Mark.
>>>
>>> On 19 September 2006 at 4:46, "Geir Magnusson Jr." <[EMAIL PROTECTED]>
>>> wrote:
>>>> There is no way to get rid of the warnings in our codebase on
>>>> linux?
>>>>
>>>> geir
>>>>
>>>> On Sep 19, 2006, at 4:03 AM, Leo Li wrote:
>>>>
>>>>> Hi, Geir:
>>>>>  The warning level is set to level 3 while the warning as error
>>>>> option is
>>>>> off in linux.
>>>>>  Actually, I would like to set it on in linux since it will
>>>>> help me
>>>>> to pick
>>>>> some error out, for example, wrongly use pointers. However, I have
>>>>> tried to
>>>>> set it on, but some unavoidable warning will lead to a failure in
>>>>> Harmony
>>>>> building. Any good idea?:)
>>>>>
>>>>> Good luck!
>>>>>
>>>>> On 9/19/06, Geir Magnusson Jr. <[EMAIL PROTECTED]> wrote:
>>>>>>
>>>>>> Lets get these aligned...  I tend to work on linux, so it had no
>>>>>> problem building..
>>>>>>
>>>>>> geir
>>>>>>
>>>>>> On Sep 18, 2006, at 10:14 PM, Leo Li wrote:
>>>>>>
>>>>>>> Just comment it out since it is just a warning treated as error.
>>>>>>> It compiles successfully and runs well.
>>>>>>> Maybe it will not lead to such an error on Linux due to the
>>>>>>> configuration of
>>>>>>> make rules.:)
>>>>>>>
>>>>>>> Good luck!
>>>>>>>
>>>>>>>
>>>>>>> On 9/19/06, Spark Shen <[EMAIL PROTECTED]> wrote:
>>>>>>>>
>>>>>>>> Hi All:
>>>>>>>> When building today's(Sep 19, r447671) classlib on window xp, I
>>>>>>>> got the
>>>>>>>> following error message:
>>>>>>>> [exec] main.c
>>>>>>>> [exec] ..\shared\main.c(628) : error C2220: warning
>>>>>>>> treated as
>>>>>>>> error - no o
>>>>>>>> bject file generated
>>>>>>>> [exec] ..\shared\main.c(628) : warning C4101: 'jarRunner' :
>>>>>>>> unreferenced lo
>>>>>>>> cal variable
>>>>>>>> [exec] NMAKE : fatal error U1077: 'cl&#

Re: [classlib][build] failure?

2006-09-19 Thread Leo Li

The warning level is set to level 3 on windows, I mean.

On 9/19/06, Leo Li <[EMAIL PROTECTED]> wrote:


 Hi, Geir:
  The warning level is set to level 3 while the warning as error option is
off in linux.
  Actually, I would like to set it on in linux since it will help me to
pick some error out, for example, wrongly use pointers. However, I have
tried to set it on, but some unavoidable warning will lead to a failure in
Harmony building. Any good idea?:)

Good luck!

 On 9/19/06, Geir Magnusson Jr. <[EMAIL PROTECTED]> wrote:
>
> Lets get these aligned...  I tend to work on linux, so it had no
> problem building..
>
> geir
>
> On Sep 18, 2006, at 10:14 PM, Leo Li wrote:
>
> > Just comment it out since it is just a warning treated as error.
> > It compiles successfully and runs well.
> > Maybe it will not lead to such an error on Linux due to the
> > configuration of
> > make rules.:)
> >
> > Good luck!
> >
> >
> > On 9/19/06, Spark Shen <[EMAIL PROTECTED]> wrote:
> >>
> >> Hi All:
> >> When building today's(Sep 19, r447671) classlib on window xp, I
> >> got the
> >> following error message:
> >> [exec] main.c
> >> [exec] ..\shared\main.c(628) : error C2220: warning treated as
> >> error - no o
> >> bject file generated
> >> [exec] ..\shared\main.c(628) : warning C4101: 'jarRunner' :
> >> unreferenced lo
> >> cal variable
> >> [exec] NMAKE : fatal error U1077: 'cl' : return code '0x2'
> >> [exec] Stop.
> >> [exec] NMAKE : fatal error U1077: '"c:\Program Files\Microsoft
> >> Visual Studi
> >> o .NET 2003\VC7\BIN\nmake.exe"' : return code '0x2'
> >> [exec] Stop.
> >>
> >> BUILD FAILED
> >> C:\spark\harmony\build.xml:95: The following error occurred while
> >> executing this
> >> line:
> >> C:\spark\harmony\make\build-native.xml:75: The following error
> >> occurred
> >> while ex
> >> ecuting this line:
> >> C:\spark\harmony\modules\luni\build.xml:167: The following error
> >> occurred while
> >> executing this line:
> >> C:\spark\harmony\make\properties.xml:258: exec returned: 2
> >>
> >> Could any one check it?
> >>
> >> Best regards
> >>
> >> --
> >> Spark Shen
> >> China Software Development Lab, IBM
> >>
> >>
> >> ---------
>
> >> Terms of use : http://incubator.apache.org/harmony/mailing.html
> >> To unsubscribe, e-mail: [EMAIL PROTECTED]
> >> For additional commands, e-mail: harmony-dev-
> >> [EMAIL PROTECTED]
> >>
> >>
> >
> >
> > --
> > Leo Li
> > China Software Development Lab, IBM
>
>
> -
> Terms of use : http://incubator.apache.org/harmony/mailing.html
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


--
Leo Li
China Software Development Lab, IBM





--
Leo Li
China Software Development Lab, IBM


Re: [classlib][build] failure?

2006-09-19 Thread Leo Li

Hi, Geir:
 The warning level is set to level 3 while the warning as error option is
off in linux.
 Actually, I would like to set it on in linux since it will help me to pick
some error out, for example, wrongly use pointers. However, I have tried to
set it on, but some unavoidable warning will lead to a failure in Harmony
building. Any good idea?:)

Good luck!

On 9/19/06, Geir Magnusson Jr. <[EMAIL PROTECTED]> wrote:


Lets get these aligned...  I tend to work on linux, so it had no
problem building..

geir

On Sep 18, 2006, at 10:14 PM, Leo Li wrote:

> Just comment it out since it is just a warning treated as error.
> It compiles successfully and runs well.
> Maybe it will not lead to such an error on Linux due to the
> configuration of
> make rules.:)
>
> Good luck!
>
>
> On 9/19/06, Spark Shen <[EMAIL PROTECTED]> wrote:
>>
>> Hi All:
>> When building today's(Sep 19, r447671) classlib on window xp, I
>> got the
>> following error message:
>> [exec] main.c
>> [exec] ..\shared\main.c(628) : error C2220: warning treated as
>> error - no o
>> bject file generated
>> [exec] ..\shared\main.c(628) : warning C4101: 'jarRunner' :
>> unreferenced lo
>> cal variable
>> [exec] NMAKE : fatal error U1077: 'cl' : return code '0x2'
>> [exec] Stop.
>> [exec] NMAKE : fatal error U1077: '"c:\Program Files\Microsoft
>> Visual Studi
>> o .NET 2003\VC7\BIN\nmake.exe"' : return code '0x2'
>> [exec] Stop.
>>
>> BUILD FAILED
>> C:\spark\harmony\build.xml:95: The following error occurred while
>> executing this
>> line:
>> C:\spark\harmony\make\build-native.xml:75: The following error
>> occurred
>> while ex
>> ecuting this line:
>> C:\spark\harmony\modules\luni\build.xml:167: The following error
>> occurred while
>> executing this line:
>> C:\spark\harmony\make\properties.xml:258: exec returned: 2
>>
>> Could any one check it?
>>
>> Best regards
>>
>> --
>> Spark Shen
>> China Software Development Lab, IBM
>>
>>
>> -
>> Terms of use : http://incubator.apache.org/harmony/mailing.html
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: harmony-dev-
>> [EMAIL PROTECTED]
>>
>>
>
>
> --
> Leo Li
> China Software Development Lab, IBM


-
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





--
Leo Li
China Software Development Lab, IBM


Re: [classlib][build] failure?

2006-09-18 Thread Leo Li

Just comment it out since it is just a warning treated as error.
It compiles successfully and runs well.
Maybe it will not lead to such an error on Linux due to the configuration of
make rules.:)

Good luck!


On 9/19/06, Spark Shen <[EMAIL PROTECTED]> wrote:


Hi All:
When building today's(Sep 19, r447671) classlib on window xp, I got the
following error message:
[exec] main.c
[exec] ..\shared\main.c(628) : error C2220: warning treated as
error - no o
bject file generated
[exec] ..\shared\main.c(628) : warning C4101: 'jarRunner' :
unreferenced lo
cal variable
[exec] NMAKE : fatal error U1077: 'cl' : return code '0x2'
[exec] Stop.
[exec] NMAKE : fatal error U1077: '"c:\Program Files\Microsoft
Visual Studi
o .NET 2003\VC7\BIN\nmake.exe"' : return code '0x2'
[exec] Stop.

BUILD FAILED
C:\spark\harmony\build.xml:95: The following error occurred while
executing this
line:
C:\spark\harmony\make\build-native.xml:75: The following error occurred
while ex
ecuting this line:
C:\spark\harmony\modules\luni\build.xml:167: The following error
occurred while
executing this line:
C:\spark\harmony\make\properties.xml:258: exec returned: 2

Could any one check it?

Best regards

--
Spark Shen
China Software Development Lab, IBM


-
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





--
Leo Li
China Software Development Lab, IBM


Re: [General VM] GC strategy:how to garbage collect short-lived objects quickly.

2006-09-18 Thread Leo Li

Hi, Weldon:
Thank you. I can read the code:)

Good luck!

On 9/16/06, Weldon Washburn <[EMAIL PROTECTED]> wrote:


On 9/14/06, Leo Li <[EMAIL PROTECTED]> wrote:
>
> Hi, Xiao-Feng:
> It will be great if VM can adjust its strategy adaptively. However,
as
> a programmer, I would like to have some method to instruct the GC
> strategy.
> If I can, I tend to control things and get definite result, whenever I
am
> programming or tuning . :)
> Besides, where are your GCv5, is it open-sourced? I am quite
> interesting in the topic.


In case it fell between the cracks, Xiao Feng posted initial rough GCV5
files at:

http://issues.apache.org/jira/browse/HARMONY-1428

Also, you may be interested in MMTk.  Its an infrastructure for
experimenting with GC algorithms.  An initial incomplete port is in
drlvm/trunk/vm/MMTk.



Good luck!
>
> --
> Weldon Washburn
> Intel Middleware Products Division





--
Leo Li
China Software Development Lab, IBM


[classlib][luni][HashMap]Avoid to expand data array in HashMap.putAll more than once.

2006-09-17 Thread Leo Li

Hi, all:
Current implementation of HashMap.putAll() in Harmony just calls
super.putAll() which ultimately will call HashMap.put(), while this way
might lead to expand the backing data array more than once if the elements
in the added Map is sufficiently large. However, the situation is able to
be avoided, since we actually know the size of the added Map, thus the
expected HashMap capacity.
If no one objects, I will add an expected capacity argument in internal
rehash() method as rehash(int expectedCapacity) and rewrite  the
HashMap.putAll().

   Good luck!

--
Leo Li
China Software Development Lab, IBM


Re: [General VM] GC strategy:how to garbage collect short-lived objects quickly.

2006-09-14 Thread Leo Li

Hi, Xiao-Feng:
It will be great if VM can adjust its strategy adaptively. However, as
a programmer, I would like to have some method to instruct the GC strategy.
If I can, I tend to control things and get definite result, whenever I am
programming or tuning . :)
Besides, where are your GCv5, is it open-sourced? I am quite
interesting in the topic.

Good luck!

On 9/14/06, Xiao-Feng Li <[EMAIL PROTECTED]> wrote:


Hi, Leo, your concerns about the potential impact of GC on system
performance (time and memory) are quite reasonable. Yes, there is no
single GC algorithm that wins all situations. Some dynamic adaptation
are desirable.

We would like to introduce this kind of dynamics step by step, since
it's subject to thorough evaluations to decide the adaptation
heuristics. As the first step of GCv5 develpment, we will let the size
of a generation (an age-based heap partition) be variable, so that the
frequency of GC is variable accordingly.

Thanks,
xiaofeng

On 9/14/06, Leo Li <[EMAIL PROTECTED]> wrote:
> Dear Xiao-Feng:
> Thank you for your advice.
> I would like generational GC, but what I worry about whether it is
> preferrable to let GC start even if there is free memory
existing.  Although
> the initiative gc fits in my case, I do not know the side-effect of
frequent
> gc, for example, to pick out gc-able objects, to merge memory and to
reset
> pointers to moved objects, especially on other cases. In my opinion, the
> strategy of current passive gc still has its market. Is it possible to
let
> it configurable for application developers to choose the gc strategy?
>Smatter compiler to allocate object on stack is really a good way
since
> many a time an object is used as a local varaible. I think it is not so
> difficult for compiler to pick out local variables and what we need is
just
> to let VM to allow space allocated on stack.:)
>I am not quite familiar with JIT, but it will become a powerful
> supplement for static analysis.
>
> Good luck!
>
> On 9/14/06, Xiao-Feng Li <[EMAIL PROTECTED]> wrote:
> >
> > Hi, Dear Leo,
> >
> > There are a couple of known approaches to collect short-lived objects.
> >
> > The most common approach is generational GC, which is designed
> > specifically with the assumption that most objects die young in normal
> > applications. Simply put, the objects are arranged into spaces
> > according to their age, and the younger objects' spaces are collected
> > more frequently. GC pause time is improved since only part of the heap
> > is collected normally.
> >
> > Another way is to let JIT to free objects whenever it sees
> > appropriate. The idea actually is letting JIT to insert object freeing
> > code sequence in the generated jitted code, so that the mutator can
> > free objects proactively. The "free-me" paper in this year's PLDI
> > exprimented this approach but showed this approach helps little with a
> > setting of generational GC.
> >
> > Stack allocation may help the short-lived objects collection as well,
> > which requires escape analysis/detection (by compiler or hardware).
> > But my experience was that synchronization removal is the main benefit
> > from escape analysis, and stack allocation may not really help in our
> > evaluations.
> >
> > Which approach is the best for your case may depend on the real
> > application behavior. Since generational GC is well-established for
> > this problem, we'd take this approach at first. GCv5 proposed is a
> > generational GC. We hope it can help to solve the problem you meet.
> > Stay tuned... :-)
> >
> > Thanks,
> > xiaofeng
> >
> > On 9/14/06, Leo Li <[EMAIL PROTECTED]> wrote:
> > > Hi,all:
> > >As we all know, java objects are allocated on heap instead of
stack,
> > > thus there is a problem about how to garbage collect short-lived
objects
> > > quickly.
> > >In a recent real project I involved, a server built on java tries
to
> > > send thousands of messages to client per second. A lot of
short-lived
> > > messages is created as objects and discarded. (Although I can
recycle
> > these
> > > memory, there is still a byte array created during per call of nio
read
> > and
> > > write.) Since current GC strategy adopted by current RI starts to
work
> > only
> > > when the memory allocated approaching the limit of java heap, the
work
> > of GC
> > > is huge and will raise a wave on the server performance.
Furthermore,
> > after
> > > a long run, although I know GC will merge memory, the operating
system
> > &

Re: [General VM] GC strategy:how to garbage collect short-lived objects quickly.

2006-09-14 Thread Leo Li

Dear Xiao-Feng:
Thank you for your advice.
I would like generational GC, but what I worry about whether it is
preferrable to let GC start even if there is free memory existing.  Although
the initiative gc fits in my case, I do not know the side-effect of frequent
gc, for example, to pick out gc-able objects, to merge memory and to reset
pointers to moved objects, especially on other cases. In my opinion, the
strategy of current passive gc still has its market. Is it possible to let
it configurable for application developers to choose the gc strategy?
   Smatter compiler to allocate object on stack is really a good way since
many a time an object is used as a local varaible. I think it is not so
difficult for compiler to pick out local variables and what we need is just
to let VM to allow space allocated on stack.:)
   I am not quite familiar with JIT, but it will become a powerful
supplement for static analysis.

Good luck!

On 9/14/06, Xiao-Feng Li <[EMAIL PROTECTED]> wrote:


Hi, Dear Leo,

There are a couple of known approaches to collect short-lived objects.

The most common approach is generational GC, which is designed
specifically with the assumption that most objects die young in normal
applications. Simply put, the objects are arranged into spaces
according to their age, and the younger objects' spaces are collected
more frequently. GC pause time is improved since only part of the heap
is collected normally.

Another way is to let JIT to free objects whenever it sees
appropriate. The idea actually is letting JIT to insert object freeing
code sequence in the generated jitted code, so that the mutator can
free objects proactively. The "free-me" paper in this year's PLDI
exprimented this approach but showed this approach helps little with a
setting of generational GC.

Stack allocation may help the short-lived objects collection as well,
which requires escape analysis/detection (by compiler or hardware).
But my experience was that synchronization removal is the main benefit
from escape analysis, and stack allocation may not really help in our
evaluations.

Which approach is the best for your case may depend on the real
application behavior. Since generational GC is well-established for
this problem, we'd take this approach at first. GCv5 proposed is a
generational GC. We hope it can help to solve the problem you meet.
Stay tuned... :-)

Thanks,
xiaofeng

On 9/14/06, Leo Li <[EMAIL PROTECTED]> wrote:
> Hi,all:
>As we all know, java objects are allocated on heap instead of stack,
> thus there is a problem about how to garbage collect short-lived objects
> quickly.
>In a recent real project I involved, a server built on java tries to
> send thousands of messages to client per second. A lot of short-lived
> messages is created as objects and discarded. (Although I can recycle
these
> memory, there is still a byte array created during per call of nio read
and
> write.) Since current GC strategy adopted by current RI starts to work
only
> when the memory allocated approaching the limit of java heap, the work
of GC
> is huge and will raise a wave on the server performance. Furthermore,
after
> a long run, although I know GC will merge memory, the operating system
> reports there is memory fragment and in the worst case the OS will even
> report real memory is exhausted.
>Of course it is possible to limit the java heap so as to force gc
> frequently as a workround, is it preferrable to collect short-lived
objects
> quickly such as adopt aged-related object queues as one of the gc
strategy?
>   What about the VMs here, drlvm or J9?
>
> Leo Li
> China Software Development Lab, IBM
>
>

-
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





--
Leo Li
China Software Development Lab, IBM


Re: [General VM] GC strategy:how to garbage collect short-lived objects quickly.

2006-09-14 Thread Leo Li

Hi,Egor:

On 14 Sep 2006 12:30:49 +0700, Egor Pasko <[EMAIL PROTECTED]> wrote:


On the 0x1E4 day of Apache Harmony Leo Li wrote:
> Hi,all:
> As we all know, java objects are allocated on heap instead of stack,
> thus there is a problem about how to garbage collect short-lived objects
> quickly.
> In a recent real project I involved, a server built on java tries to
> send thousands of messages to client per second. A lot of short-lived
> messages is created as objects and discarded. (Although I can recycle
these
> memory, there is still a byte array created during per call of nio read
and
> write.) Since current GC strategy adopted by current RI starts to work
only
> when the memory allocated approaching the limit of java heap, the work
of GC
> is huge and will raise a wave on the server performance. Furthermore,
after
> a long run, although I know GC will merge memory, the operating system
> reports there is memory fragment and in the worst case the OS will even
> report real memory is exhausted.
> Of course it is possible to limit the java heap so as to force gc
> frequently as a workround, is it preferrable to collect short-lived
objects
> quickly such as adopt aged-related object queues as one of the gc
strategy?

what about forcing gc by hand? does it help?



Forcing gc by hand does work, but it is difficult for code to know when to
call gc.So I think it is better if VM can give some support since it knows
the global situation.:)



   What about the VMs here, drlvm or J9?

In a DRLVM JIT (Jitrino.OPT) there is an escape analysis prototype. It
detects objects that can be allocated on stack (and, hence, on
registers). Currently, it is switched off by default, and, when
enabled, it just marks the objects that are not escaped. This info is
never used in Jitrino.OPT yet. Sometimes, escape analyzers help, but
not very much :)



It will be great if JIT can help to allocation objects on stack.

DRLVM GC gurus will say more ;)


--
Egor Pasko, Intel Managed Runtime Division


-
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





--
Leo Li
China Software Development Lab, IBM


[General VM] GC strategy:how to garbage collect short-lived objects quickly.

2006-09-13 Thread Leo Li

Hi,all:
   As we all know, java objects are allocated on heap instead of stack,
thus there is a problem about how to garbage collect short-lived objects
quickly.
   In a recent real project I involved, a server built on java tries to
send thousands of messages to client per second. A lot of short-lived
messages is created as objects and discarded. (Although I can recycle these
memory, there is still a byte array created during per call of nio read and
write.) Since current GC strategy adopted by current RI starts to work only
when the memory allocated approaching the limit of java heap, the work of GC
is huge and will raise a wave on the server performance. Furthermore, after
a long run, although I know GC will merge memory, the operating system
reports there is memory fragment and in the worst case the OS will even
report real memory is exhausted.
   Of course it is possible to limit the java heap so as to force gc
frequently as a workround, is it preferrable to collect short-lived objects
quickly such as adopt aged-related object queues as one of the gc strategy?
  What about the VMs here, drlvm or J9?

Leo Li
China Software Development Lab, IBM


Re: [classlib]volunteer to supply patches for old JIRAs

2006-09-12 Thread Leo Li

Hi, all:
I am also ready to fix unresolved JIRAs.
Currently, my work focuses on java.lang module.


On 9/13/06, Spark Shen <[EMAIL PROTECTED]> wrote:


Andrew Zhang 写道:
> On 9/13/06, Spark Shen <[EMAIL PROTECTED]> wrote:
>>
>> Tony Wu 写道:
>> > Hi all,
>> > I noticed there're many unresolved JIRAs posted so long time. I
>> > purpose to
>> > dive into and find whether it is in my range and try to supply a
patch
>> > if no
>> > one objects :)
>> > Is there anyone alse has interest and would like to work with me?
>> >
>> Hi,
>> It is interesting of your proposal. May I join in?
>> I noticed that there are many categories of components. I suggest we
>> only deal with those components we are familier with.
>> Since there are so many unresolved JIRAs, will you start from the
>> beginning and I will start from the end. If someone else is interested,
>> he/she may start from the middle. :-)
>
>
> I think we'd better choose JIRAs according to the modules, as you
> mentioned,
> which we're familiar with.
OK, since so many people are interested in this proposal, the plan one
start from the beginning and the other from the end
may not be appropriate.
Recently I am working on java.lang.Math and java.lang.StrictMath, I will
deal with java.lang module.
>
> Best regards
>>
>> --
>> Spark Shen
>> China Software Development Lab, IBM
>>
>>
>> -
>> Terms of use : http://incubator.apache.org/harmony/mailing.html
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
>
>


--
Spark Shen
China Software Development Lab, IBM


-
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





--
Leo Li
China Software Development Lab, IBM


Re: New IBM VME available soon

2006-08-22 Thread Leo Li

Hi,
On 8/21/06, Geir Magnusson Jr <[EMAIL PROTECTED]> wrote:




Oliver Deakin wrote:
> Leo Li wrote:
>> Hi, Oli:
>> It is really a problem that System.getenv fails to behave as RI on
>> windows. I will fix it by get env string out by os function such
>> as getenvironmentvariable and getenv. Thank you for your tips.
>
> Thanks for looking at fixing this Leo :)
>
>>   Besides, the returned environment variables is only defined  in
>> the process of the java application, for example, the command windows,
>> and
>> remains the same during the life cycle. :)
>
> It's not possible that the environment variables could change during the
> lifetime
> of the VM? If, for example, a Java program made a call out to native
> code, isn't it
> quite possible that that native code to alter the environment variables,
> and thus
> when we return to Java the environment of the process has changed?


   I have tested on linux that a native code to setenv, but RI still gets
the original value if use System.getenv. While on windows, I fails to find
the "setenvironmentstring". So Harmony  behaves just like RI.


Would you really ever want that?  Seems to be a safety issue.


geir

-
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





--
Leo Li
China Software Development Lab, IBM


Re: [classlib][luni] Suspicious behavior of java.util.EnumSet

2006-08-21 Thread Leo Li

In my opinion, it is just RI' s implementation and it is up to you as a
developer to make the choice.:)

On 8/21/06, Spark Shen <[EMAIL PROTECTED]> wrote:


Leo Li 写道:
> If so, we cannot regard it as RI's bug. And I believe the size of 64
> and the
> existence of the deleted element depends on RI's algorithm especially it
> does not provide concurrent assurance. Maybe it is due to performance
> concerns, I am not sure.
> The curious thing is whether we should behave as RI since it says "it
> may or
> may not show the effects of any modifications to the set that occur
while
> the iteration is in progress".
>
>
So, what is your opinion? Should we follow RI on this behavior?

Best regards
> On 8/21/06, Spark Shen <[EMAIL PROTECTED]> wrote:
>>
>> Leo Li 写道:
>> > Hi, Spark:
>> > Yes, I think it is RI's bug.
>> > But It should throw ConcurrentModificationException as spec says:
>> > 1. This exception may be thrown by methods that have detected
>> > concurrent modification of an object when such modification is not
>> > permissible.
>> > 2. Note that this exception does not always indicate that an object
>> has
>> > been concurrently modified by a *different* thread. If a single
thread
>> > issues a sequence of method invocations that violates the contract
>> of an
>> > object, the object may throw this exception. For example, if a thread
>> > modifies a collection directly while it is iterating over the
>> collection
>> > with a fail-fast iterator, the iterator will throw this exception.
>> >
>> > The iterator 's remove() action relies on the result of previous
>> > next(), but is interrupted by the set.remove() method. I think it
>> is the
>> > case.
>> >
>> > Besides, If the same thing is applied to Hashset:
>> > public static void main(String[] args) {
>> > HashSet set = new HashSet();
>> > Object o = new Object();
>> > set.add(o);
>> > Iterator iter = set.iterator();
>> > iter.next();
>> > set.remove(o);
>> > iter.remove();
>> > }
>> > It will throw ConcurrentModificationException as expected.:)
>> >
>> >
>> There is a paragraph from spec clearly states that
>> ConcurrentModificationException will never be thrown out from the
>> iterator returned
>> by EnumSet. Cited below:
>> "The returned iterator is /weakly consistent/: it will never throw
>> |ConcurrentModificationException|
>> 
>> and it may or may not show the effects of any modifications to the set
>> that occur while the iteration is in progress."
>>
>> Best regards
>> > On 8/19/06, Spark Shen <[EMAIL PROTECTED]> wrote:
>> >>
>> >> Hi All:
>> >> The following behavior of RI java.util.EnumSet seems odd. Do you
have
>> >> any opinion on whether it is a bug of RI?
>> >>
>> >> import java.util.EnumSet;
>> >> import java.util.Iterator;
>> >> public class Test {
>> >> static enum EnumFoo {
>> >> a, b,
>> >> }
>> >>
>> >> public static void main(String[] args){
>> >> EnumSet set = EnumSet.noneOf(EnumFoo.class);
>> >> set.add(EnumFoo.a);
>> >> Iterator iterator = set.iterator();
>> >> iterator.next();
>> >>
>> >> set.remove(EnumFoo.a);
>> >> iterator.remove(); (1)
>> >> // The output value is true
>> >> System.out.println(set.contains(EnumFoo.a));
>> >> // The output value is 64
>> >> System.out.println(set.size());
>> >> }
>> >> }
>> >> IMHO, when (1) is executed, an IllegalStateException should be
thrown
>> >> out, since the element EnumFoo.a does not exist at the moment.
>> >> Any thoughts?
>> >>
>> >> Best regards
>> >>
>> >> --
>> >> Spark Shen
>> >> China Software Development Lab, IBM
>> >>
>> >>
>> >>
-
>> >> Terms of use : http://incubator.apache.org/harmony/mailing.html
>> >> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> >> For additional commands, e-mail:
>> [EMAIL PROTECTED]
>> >>
>> >>
>> >
>> >
>>
>>
>> --
>> Spark Shen
>> China Software Development Lab, IBM
>>
>>
>> -
>> Terms of use : http://incubator.apache.org/harmony/mailing.html
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
>
>


--
Spark Shen
China Software Development Lab, IBM


-
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





--
Leo Li
China Software Development Lab, IBM


Re: [classlib][luni] Suspicious behavior of java.util.EnumSet

2006-08-20 Thread Leo Li

If so, we cannot regard it as RI's bug. And I believe the size of 64 and the
existence of the deleted element depends on RI's algorithm especially it
does not provide concurrent assurance. Maybe it is due to performance
concerns, I am not sure.
The curious thing is whether we should behave as RI since it says "it may or
may not show the effects of any modifications to the set that occur while
the iteration is in progress".


On 8/21/06, Spark Shen <[EMAIL PROTECTED]> wrote:


Leo Li 写道:
> Hi, Spark:
> Yes, I think it is RI's bug.
> But It should throw ConcurrentModificationException as spec says:
> 1. This exception may be thrown by methods that have detected
> concurrent modification of an object when such modification is not
> permissible.
> 2. Note that this exception does not always indicate that an object has
> been concurrently modified by a *different* thread. If a single thread
> issues a sequence of method invocations that violates the contract of an
> object, the object may throw this exception. For example, if a thread
> modifies a collection directly while it is iterating over the collection
> with a fail-fast iterator, the iterator will throw this exception.
>
> The iterator 's remove() action relies on the result of previous
> next(), but is interrupted by the set.remove() method. I think it is the
> case.
>
> Besides, If the same thing is applied to Hashset:
> public static void main(String[] args) {
> HashSet set = new HashSet();
> Object o = new Object();
> set.add(o);
> Iterator iter = set.iterator();
> iter.next();
> set.remove(o);
> iter.remove();
> }
> It will throw ConcurrentModificationException as expected.:)
>
>
There is a paragraph from spec clearly states that
ConcurrentModificationException will never be thrown out from the
iterator returned
by EnumSet. Cited below:
"The returned iterator is /weakly consistent/: it will never throw
|ConcurrentModificationException| 
and it may or may not show the effects of any modifications to the set
that occur while the iteration is in progress."

Best regards
> On 8/19/06, Spark Shen <[EMAIL PROTECTED]> wrote:
>>
>> Hi All:
>> The following behavior of RI java.util.EnumSet seems odd. Do you have
>> any opinion on whether it is a bug of RI?
>>
>> import java.util.EnumSet;
>> import java.util.Iterator;
>> public class Test {
>> static enum EnumFoo {
>> a, b,
>> }
>>
>> public static void main(String[] args){
>> EnumSet set = EnumSet.noneOf(EnumFoo.class);
>> set.add(EnumFoo.a);
>> Iterator iterator = set.iterator();
>> iterator.next();
>>
>> set.remove(EnumFoo.a);
>> iterator.remove(); (1)
>> // The output value is true
>> System.out.println(set.contains(EnumFoo.a));
>> // The output value is 64
>> System.out.println(set.size());
>> }
>> }
>> IMHO, when (1) is executed, an IllegalStateException should be thrown
>> out, since the element EnumFoo.a does not exist at the moment.
>> Any thoughts?
>>
>> Best regards
>>
>> --
>> Spark Shen
>> China Software Development Lab, IBM
>>
>>
>> -
>> Terms of use : http://incubator.apache.org/harmony/mailing.html
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
>
>


--
Spark Shen
China Software Development Lab, IBM


-
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





--
Leo Li
China Software Development Lab, IBM


Re: [classlib][luni] Suspicious behavior of java.util.EnumSet

2006-08-20 Thread Leo Li

Hi, Spark:
Yes, I think it is RI's bug.
But It should throw ConcurrentModificationException as spec says:
1. This exception may be thrown by methods that have detected
concurrent modification of an object when such modification is not
permissible.
2. Note that this exception does not always indicate that an object has
been concurrently modified by a *different* thread. If a single thread
issues a sequence of method invocations that violates the contract of an
object, the object may throw this exception. For example, if a thread
modifies a collection directly while it is iterating over the collection
with a fail-fast iterator, the iterator will throw this exception.

The iterator 's remove() action relies on the result of previous
next(), but is interrupted by the set.remove() method. I think it is the
case.

Besides, If the same thing is applied to Hashset:
public static void main(String[] args) {
 HashSet set = new HashSet();
 Object o = new Object();
 set.add(o);
 Iterator iter = set.iterator();
 iter.next();
 set.remove(o);
 iter.remove();
 }
It will throw ConcurrentModificationException as expected.:)


On 8/19/06, Spark Shen <[EMAIL PROTECTED]> wrote:


Hi All:
The following behavior of RI java.util.EnumSet seems odd. Do you have
any opinion on whether  it is a bug of RI?

import java.util.EnumSet;
import java.util.Iterator;
public class Test {
   static enum EnumFoo {
   a, b,
   }

   public static void main(String[] args){
   EnumSet set = EnumSet.noneOf(EnumFoo.class);
   set.add(EnumFoo.a);
   Iterator iterator = set.iterator();
   iterator.next();

   set.remove(EnumFoo.a);
   iterator.remove();   (1)
   // The output value is true
   System.out.println(set.contains(EnumFoo.a));
   // The output value is 64
   System.out.println(set.size());
   }
}
IMHO,  when (1) is executed, an IllegalStateException should be thrown
out, since the element EnumFoo.a does not exist at the moment.
Any thoughts?

Best regards

--
Spark Shen
China Software Development Lab, IBM


-
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





--
Leo Li
China Software Development Lab, IBM


Re: [classlib][instrument]Using Support_Exec framework(was Re: [classlib][Instrument] Documents for non-unit-tests)

2006-08-17 Thread Leo Li

Hi, all:
I wonder if we need to get the exception from the exec framework. As an
exec result, we need only get whether it succeeds or not. Besides, I do not
think it is so reliable to parse error message to get exception.
   We can design sophisticated testcase to deduce whether the expected
exception has been thrown out from the status of exec.
   For example, during VM init there are some errors that can be caught by
some java class.
   If we add a null object as Transformer, the VM will go down by
nullpointerexception. But it can be  caught be its caller:
   public static void premain(String agentArgs, Instrumentation inst)
{
 try
 {
  inst.addTransformer(null);
  //should throw NullPointerException
  System.exit(1);
 }
 catch(NullPointerException e)
 {
  //expected
 }
}

 From the exec result, if there is no error, that is return value is 0, we
can deduce that the expected exception is thrown.
  As for those fault errors raised from VM init, if they cannot be caught
by any java class, they are just error messages that can be got from
console. I do not think some application will depend on such message.
Furthermore, some of these messages cannot be classified to any exception
type: some are errors about runtime environment, some are related to VM.
 Actually, in reality, some error events are related to Harmony's
implemenation. For example, in our instrumentation impl class, there are two
methods executePremain and transform, which are called duirng VM and might
cause VM to die if these methods cannot be invoked. In such circumstances,
we cannot behave just like RI.
 So in my opinion, if the exception can be caught by any java class, we try
to design testcase to verify it; or else, they are just error messages that
are related to implementation.

On 8/17/06, Anton Luht <[EMAIL PROTECTED]> wrote:


Jimmy,

> Ah, we are trying to catch the exact exception name, not its message. I
> agree parsing the message is a bad idea, but find an exact exception
> name in the output is still stable, am I right?

Yes, it's stable.

> In fact, I have no idea to catch an exception in "exec", it surely
> contains no such function, right?

No, it doesn't.

--
Regards,
Anton Luht,
Intel Middleware Products Division

-
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





--
Leo Li
China Software Development Lab, IBM


Re: New IBM VME available soon

2006-08-15 Thread Leo Li

Hi, Oli:
It is really a problem that System.getenv fails to behave as RI on
windows. I will fix it by get env string out by os function such
as getenvironmentvariable and getenv. Thank you for your tips.
  Besides, the returned environment variables is only defined  in
the process of the java application, for example, the command windows, and
remains the same during the life cycle. :)


Thank you, Oli.

Good luck!
--
Leo Li
China Software Development Lab, IBM


Re: [classlib][instrument]Method to terminate VM.

2006-08-13 Thread Leo Li

Hi, all
 The case is we need to load an implementation class during VM init and
should terminate it if the class cannot be found.
 Here is the code.

inst_class =
(*env)->FindClass(env,
"org/apache/harmony/instrument/internal/InstrumentationImpl");
if(NULL == inst_class){
 //VM exits abnormally.
 (*env)->FatalError(env,"class cannot find:
org/apache/harmony/instrument/internal/InstrumentationImpl");
}

Thank you.

On 8/11/06, Geir Magnusson Jr <[EMAIL PROTECTED]> wrote:


How far along is this code?  Any chance you want to toss up a snapshot
of it so people can look and comment and ... maybe even help?

geir


Jimmy, Jing Lv wrote:
> Leo Li wrote:
>> Hi, all
>> During the implementaion of instrument, I encounter the choice
about
>> how to terminate the VM when some abnormal event occurs, for example,
the
>> expected jar file does not exist or the implementation class of
>> Instrumentation cannot be found. The most simple and direct way is
>> just to
>> call exit(), and then the whole process will terminate. Hence OS will
>> treat
>> with all the release of resources. However, I propose to use
>> FatalError of
>> JNI instead, which notifies the VM to suicide, because it gives right
>> to the
>> implementation of VM to take charge of its own funeral affairs, which
>> might
>> include, for example, logging the cause of its crash.
>>Any suggestion from VM guys?
>>Thanks :)
>>
>
> Hi,
>
> I agree that use VM FatalError is better than system exit(). If no
> objections, I will make code that way.
>

-
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





--
Leo Li
China Software Development Lab, IBM


[classlib][instrument]Method to terminate VM.

2006-08-09 Thread Leo Li

Hi, all
During the implementaion of instrument, I encounter the choice about
how to terminate the VM when some abnormal event occurs, for example, the
expected jar file does not exist or the implementation class of
Instrumentation cannot be found. The most simple and direct way is just to
call exit(), and then the whole process will terminate. Hence OS will treat
with all the release of resources. However, I propose to use FatalError of
JNI instead, which notifies the VM to suicide, because it gives right to the
implementation of VM to take charge of its own funeral affairs, which might
include, for example, logging the cause of its crash.
   Any suggestion from VM guys?
   Thanks :)

--
Leo Li
China Software Development Lab, IBM


  1   2   >