NPE when generating benchmark code
Aleksey Shipilev
aleksey.shipilev at oracle.com
Wed May 21 13:17:59 UTC 2014
So you are saying your benchmark compiles well with 7u51, but not with
6u37? This seems to be consistent with JDK-6889255, although its
backport [2] seems to indicate it is fixed in 6u21 as well. Can you try
latest 6u45?
-Aleksey.
[1] https://bugs.openjdk.java.net/browse/JDK-6889255
[2] https://bugs.openjdk.java.net/browse/JDK-2183844
On 05/21/2014 05:12 PM, Mark Price wrote:
> Unfortunately, removing the ignore.symbol.file flag has no effect.
>
> Running the original sample with jdk 1.7.0_51 is successful (though required 512m heap vs 256m).
>
>
>
> Mark
>
> ----- Original Message -----
>> Thanks.
>>
>> So I put the same into jmh-ant-sample and added some @CompilerControl
>> annotations. Works fine on JDK 6u38 and Ant 1.8.2.
>>
>> Given the exception apparently NPEs on looking up the symbol within
>> javac, maybe you need to drop <compilerarg value="-XDignore.symbol.file"/>?
>>
>> -Aleksey.
>>
>> On 05/21/2014 04:41 PM, Mark Price wrote:
>>> Hi Aleksey,
>>> thanks for the response.
>>>
>>> ant version is 1.9.2
>>> java version is 1.6.0_37
>>>
>>> the ant file is embarrassingly tangled, but it boils down to:
>>>
>>> <javac srcdir="src/test/java" destdir="build/test/classes" debug="on"
>>> fork="yes" encoding="UTF-8" target="1.6"
>>> source="1.6" debuglevel="lines,source,vars"
>>> deprecation="on" includeantruntime="no"
>>> memorymaximumsize="256m">
>>> <compilerarg value="-Xlint:unchecked"/>
>>> <compilerarg value="-XDignore.symbol.file"/>
>>> <compilerarg value="-s"/>
>>> <compilerarg value="build/test/classes"/>
>>> <classpath>
>>> <path
>>> refid="${@{module}.@{artifact}.conf.compile}-path"/>
>>> <extra-classpath/>
>>> </classpath>
>>> </javac>
>>>
>>>
>>>
>>>
>>> Mark
>>>
>>> ----- Original Message -----
>>>> Hi Mark,
>>>>
>>>> On 05/21/2014 03:51 PM, Mark Price wrote:
>>>>> Hi, I'm using JMH in the non-recommended ant mode, and seeing an
>>>>> exception while compiling my benchmark.
>>>>
>>>> Just checked our jmh-ant-sample and it works, which means the problem is
>>>> specific to your scenario. The attachments were scrubbed, but I got them
>>>> in the moderator note. Can you publish the Ant build file as well? "ant
>>>> -v" and "java -version" would also be appreciated.
>>>>
>>>> These lines are important:
>>>>
>>>>> [javac] error: Compiler control generators had thrown the unexpected
>>>>> exception java.lang.NullPointerException
>>>> ...
>>>>> [javac] at
>>>>> org.openjdk.jmh.generators.core.CompilerControlPlugin.process(CompilerControlPlugin.java:67)
>>>>
>>>> That's a separate @CompilerControl processor, and this is why the
>>>> benchmark is still generated.
>>>>
>>>>> though it seems to generate a file for the single benchmark that I
>>>>> have included (attached, along with original benchmark source).
>>>>
>>>> No need to publish the generated source.
>>>>
>>>> Thanks,
>>>> -Aleksey.
>>>>
>>
>>
More information about the jmh-dev
mailing list