Strange bug inside jetty at shenandoah/jdk8u
Roman Kennke
rkennke at redhat.com
Thu Dec 21 15:11:12 UTC 2017
Am 21.12.2017 um 11:23 schrieb Aleksey Shipilev:
> On 12/20/2017 10:10 PM, Aleksey Shipilev wrote:
>> On 12/20/2017 08:14 PM, Kirill A. Korinsky wrote:
>>>> On 20 Dec 2017, at 20:16, Kirill A. Korinsky <kirill at korins.ky <mailto:kirill at korins.ky>> wrote:
>>>> Hey,
>>>>
>>>> I made very simple test case: https://github.com/catap/jetty-shenandoah-error
>>>>
>>>> It is durty but it is good enough.
>>>>
>>>> How to reproduce:
>>>> The first terminal:
>>>>> mvn clean package
>>>>> docker-compose up --build
>>>> The second terminal:
>>>>> ab -k -c 1 -n 10000 -p request_body http://localhost:8080/test/
>>>>
>>>> and you should have a lot of errors likes:
>>>>> server_1 | 2017-12-20 16:09:56.287:WARN:oejh.HttpParser:qtp1706377736-41: parse exception:
>>>>> java.lang.IndexOutOfBoundsException: 20 for HttpChannelOverHttp at 1138214c{r=4,c=false,a=IDLE,uri=null}
>>
>> Many thanks! I have successfully reproduced the failure locally with your docker-compose thing that
>> brings in Fedora 27 OpenJDK build.
>>
>> It seems the exact Jetty version is important. Based on your example, minimized this further to
>> non-dockerized version:
>> https://github.com/shipilev/jetty-test
>>
>> It seems to be the bug in Shenandoah+C1, because -Xint works fine, and -XX:-TieredCompilation works
>> fine. All recent versions: sh/jdk8u, sh/jdk9, sh/jdk10 fail -- which is a good sign, and it
>> simplifies the bug hunt.
>
> Smoking gun: the failure is here in HeapByteBuffer:
>
> public byte get(int i) {
> return hb[ix(checkIndex(i))]; <--- !
> }
>
> And -XX:DisableIntrinsic=_checkIndex helps. Something is wrong in LIRGenerator::do_NIOCheckIndex? I
> am on the go, and my build/debug capabilities are slim. Anyone sees something completely off there?
> Don't we need RB on buf read?
>
> -Aleksey
>
>
This fixes it:
http://cr.openjdk.java.net/~rkennke/c1-missing-barrier/webrev.00/
Proposed for review.
Roman
More information about the shenandoah-dev
mailing list