RFR (XS): 8015635: Crash when specifying very large code cache size

Vladimir Kozlov vladimir.kozlov at oracle.com
Tue Jul 2 01:05:56 PDT 2013


Good.
You can try to specify flag which crash VM and see what your test does in such case.

The sources of testlibrary is in Hotspot test sources:

test/testlibrary/com/oracle/java/testlibrary/

Thanks,
Vladimir

On 7/2/13 12:03 AM, Albert Noll wrote:
> Hi Christian,
>
> I am not sure either. Does anyone know if there exists a documentation of the testlibrary?
> I modified the test such that it checks for (parts of) the error message that is reported if the
> ReservedCodeCacheSize is too large. This makes the test more robust.
>
> Here is the new webrev:
> http://cr.openjdk.java.net/~anoll/8015635/webrev.05/ <http://cr.openjdk.java.net/%7Eanoll/8015635/webrev.05/>
>
> Best,
> Albert
>
>
> On 02.07.2013 02:51, Christian Thalinger wrote:
>> I have no idea how this testlibrary works but does the following take care of crashes or does it only check the exit
>> value?
>>    42     pb = ProcessTools.createJavaProcessBuilder("-XX:ReservedCodeCacheSize=2049m", "-version");
>>    43     out = new OutputAnalyzer(pb.start());
>>    44     out.shouldHaveExitValue(1);
>> -- Chris
>>
>> On Jun 30, 2013, at 9:44 PM, Albert Noll <albert.noll at oracle.com <mailto:albert.noll at oracle.com>> wrote:
>>
>>> Hi,
>>>
>>> thanks for looking at the patch. I updated the patch.
>>> http://cr.openjdk.java.net/~anoll/8015635/webrev.04/ <http://cr.openjdk.java.net/%7Eanoll/8015635/webrev.04/>
>>>
>>> Could I have a second review for this?
>>>
>>> Best,
>>> Albert
>>>
>>> On 28.06.2013 18:58, Christian Tornqvist wrote:
>>>> Hi Vladimir,
>>>>
>>>> It's not needed if you simply want jtreg to run your test normally, from the
>>>> jtreg tag spec:
>>>>
>>>> "DEFAULTS
>>>>
>>>> If no @run tags are present in a defining file, a default is assumed
>>>> depending
>>>> upon the file's filename extension.  For a ".java" file, "@run main <name>"
>>>> is
>>>> assumed, where <name> is the name of the file without the ".java" suffix."
>>>>
>>>> So using '@run main Test' is redundant.
>>>>
>>>> Thanks,
>>>> Christian
>>>>
>>>> -----Original Message-----
>>>> From: Vladimir Kozlov [mailto:vladimir.kozlov at oracle.com]
>>>> Sent: den 28 juni 2013 12:48
>>>> To: Christian Tornqvist
>>>> Cc: 'Albert Noll'; 'hotspot compiler'
>>>> Subject: Re: RFR (XS): 8015635: Crash when specifying very large code cache
>>>> size
>>>>
>>>> Christian,
>>>>
>>>> Why '@run main Test' is not used in these tests?
>>>>
>>>> Thanks,
>>>> Vladimir
>>>>
>>>> On 6/28/13 9:08 AM, Christian Tornqvist wrote:
>>>>> Hi Albert,
>>>>>
>>>>> You should use '@library /testlibrary' instead of a relative path,
>>>>> otherwise the test looks fine. Thanks for rewriting this in java and
>>>>> fixing the name of the test J
>>>>>
>>>>> Thanks,
>>>>>
>>>>> Christian
>>>>>
>>>>> *From:*hotspot-compiler-dev-bounces at openjdk.java.net  <mailto:hotspot-compiler-dev-bounces at openjdk.java.net>
>>>>> [mailto:hotspot-compiler-dev-bounces at openjdk.java.net] *On Behalf Of
>>>>> *Albert Noll
>>>>> *Sent:* den 28 juni 2013 11:19
>>>>> *To:* hotspot compiler
>>>>> *Subject:* Re: RFR (XS): 8015635: Crash when specifying very large
>>>>> code cache size
>>>>>
>>>>> Hi,
>>>>>
>>>>> Christian, thanks for the comment. I implemented the test in Java.
>>>>> I was not entirely sure how to use @library. The current version works
>>>>> on my system.
>>>>>
>>>>>
>>>>> Here is the new webrev:
>>>>> http://cr.openjdk.java.net/~anoll/8015635/webrev.03/<http://cr.openjdk
>>>>> .java.net/%7Eanoll/8015635/webrev.03/>
>>>>>
>>>>> Best,
>>>>> Albert
>>>>>
>>>>> On 28.06.2013 10:19, Christian Tornqvist wrote:
>>>>>
>>>>>      Hi Albert,
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>      Please don't use shell scripts, this can be expressed in java
>>>>> which will
>>>>>
>>>>>      work on all platforms. See
>>>>>
>>>>>
>>>>> http://hg.openjdk.java.net/hsx/hotspot-rt/hotspot/file/221df7e37535/te
>>>>> st/run
>>>>>
>>>>>      time/CommandLine/UnrecognizedVMOption.java for example on how to
>>>>> do this in
>>>>>
>>>>>      java.
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>      Also, please follow the test naming convention described at:
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> https://wikis.oracle.com/display/HotSpotInternals/Naming+HotSpot+JTReg
>>>>> +Tests
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>      Thanks,
>>>>>
>>>>>
>>>>>
>>>>>      Christian
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>      From:hotspot-compiler-dev-bounces at openjdk.java.net
>>>>> <mailto:hotspot-compiler-dev-bounces at openjdk.java.net>
>>>>>
>>>>>      [mailto:hotspot-compiler-dev-bounces at openjdk.java.net] On Behalf
>>>>> Of Albert
>>>>>
>>>>>      Noll
>>>>>
>>>>>      Sent: den 28 juni 2013 03:39
>>>>>
>>>>>      To:hotspot-compiler-dev at openjdk.java.net
>>>>> <mailto:hotspot-compiler-dev at openjdk.java.net>
>>>>>
>>>>>      Subject: Re: RFR (XS): 8015635: Crash when specifying very large
>>>>> code cache
>>>>>
>>>>>      size
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>      Hi Valdimir,
>>>>>
>>>>>
>>>>>
>>>>>      thanks again for looking at the code.
>>>>>
>>>>>      I implemented your proposed changes.
>>>>>
>>>>>
>>>>>
>>>>>      http://cr.openjdk.java.net/~anoll/8015635/webrev.02/
>>>>>
>>>>>      <http://cr.openjdk.java.net/%7Eanoll/8015635/webrev.02/>
>>>>> <http://cr.openjdk.java.net/%7Eanoll/8015635/webrev.02/>
>>>>>
>>>>>
>>>>>
>>>>>      Best,
>>>>>
>>>>>      Albert
>>>>>
>>>>>
>>>>>
>>>>>      On 28.06.2013 08:29, Vladimir Kozlov wrote:
>>>>>
>>>>>
>>>>>
>>>>>      Albert,
>>>>>
>>>>>
>>>>>
>>>>>      In the test could check the code after each java run? Example
>>>>> shows only
>>>>>
>>>>>      logic, not script instructions:
>>>>>
>>>>>
>>>>>
>>>>>      java 2048m
>>>>>
>>>>>      if $? -ne 0
>>>>>
>>>>>        failed
>>>>>
>>>>>        exit
>>>>>
>>>>>      fi
>>>>>
>>>>>
>>>>>
>>>>>      java 2049m
>>>>>
>>>>>      if $? -eq 0
>>>>>
>>>>>        failed
>>>>>
>>>>>        exit
>>>>>
>>>>>      fi
>>>>>
>>>>>
>>>>>
>>>>>      passed
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>      Thanks,
>>>>>
>>>>>      Vladimir
>>>>>
>>>>>
>>>>>
>>>>>      On 6/27/13 10:14 PM, Albert Noll wrote:
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>      Hi,
>>>>>
>>>>>
>>>>>
>>>>>      Pavel, Vladimir, thanks for looking at the patch. I added a
>>>>> regression test
>>>>>
>>>>>      and made the proposed changes in arguments.cpp.
>>>>>
>>>>>
>>>>>
>>>>>      Here is the new webrev.
>>>>>
>>>>>      http://cr.openjdk.java.net/~anoll/8015635/webrev.01/
>>>>>
>>>>>      <http://cr.openjdk.java.net/%7Eanoll/8015635/webrev.01/>
>>>>> <http://cr.openjdk.java.net/%7Eanoll/8015635/webrev.01/>
>>>>>
>>>>>      <http://cr.openjdk.java.net/%7Eanoll/8015635/webrev.01/>
>>>>> <http://cr.openjdk.java.net/%7Eanoll/8015635/webrev.01/>
>>>>>
>>>>>
>>>>>
>>>>>      Thanks,
>>>>>
>>>>>      Albert
>>>>>
>>>>>
>>>>>
>>>>>      On 27.06.2013 18:36, Vladimir Kozlov wrote:
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>      We don't place 'else' on separate line and remove comment inside
>>>>> 'if' body
>>>>>
>>>>>      and change it to:
>>>>>
>>>>>
>>>>>
>>>>>      } else if (ReservedCodeCacheSize > 2*G) { {
>>>>>
>>>>>         // Code cache size larger than MAXINT is not supported.
>>>>>
>>>>>
>>>>>
>>>>>      Thanks,
>>>>>
>>>>>      Vladimir
>>>>>
>>>>>
>>>>>
>>>>>      On 6/27/13 5:01 AM, Albert Noll wrote:
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>      Hi,
>>>>>
>>>>>
>>>>>
>>>>>      thanks for reviewing this small patch.
>>>>>
>>>>>
>>>>>
>>>>>      Best,
>>>>>
>>>>>      Albert
>>>>>
>>>>>
>>>>>
>>>>>      jbs:https://jbs.oracle.com/bugs/browse/JDK-8015635
>>>>>
>>>>>      webrev:http://cr.openjdk.java.net/~anoll/8015635/webrev/
>>>>>
>>>>>      <http://cr.openjdk.java.net/%7Eanoll/8015635/webrev/>
>>>>> <http://cr.openjdk.java.net/%7Eanoll/8015635/webrev/>
>>>>>
>>>>>      <http://cr.openjdk.java.net/%7Eanoll/8015635/webrev/>
>>>>> <http://cr.openjdk.java.net/%7Eanoll/8015635/webrev/>
>>>>>
>>>>>
>>>>>
>>>>>      Problem: A code cache size larger than 2G is not supported and
>>>>> therefore
>>>>>
>>>>>      results in VM crashes.
>>>>>
>>>>>      Solution: Limit the size of the code cache to at most 2G when
>>>>> arguments are
>>>>>
>>>>>      checked. If a larger code cache size is
>>>>>
>>>>>      specified with -XX:ReservedCodeCacheSize=..., the JVM does not
>>>>> start and
>>>>>
>>>>>      reports an error.
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>      Best,
>>>>>
>>>>>      Albert
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>
>>
>


More information about the hotspot-compiler-dev mailing list