Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable isVettedForAOT when getting systemClass #6928

Merged
merged 1 commit into from
Jul 6, 2020

Conversation

dchopra001
Copy link
Contributor

Set isVettedForAOT to false inside VMarrayStoreCHKEvaluator
when calling getSystemClassFromClassName for remote compilations.

This mimics x86 behaviour.

[skip ci]
Signed-off-by: Dhruv Chopra Dhruv.C.Chopra@ibm.com

@dchopra001 dchopra001 mentioned this pull request Aug 30, 2019
32 tasks
@mpirvu mpirvu added arch:z comp:jitserver Artifacts related to JIT-as-a-Service project labels Sep 4, 2019
Copy link
Contributor

@mpirvu mpirvu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please document the problem that prompted this change? It's true that on x86 we always use vettedForAOT==false, but maybe that was just conservative.

@dsouzai
Copy link
Contributor

dsouzai commented Sep 4, 2019

Could you please document the problem that prompted this change? It's true that on x86 we always use vettedForAOT==false, but maybe that was just conservative.

Also keep in mind that vettedForAOT is only respected for non-SVM AOT.

@dchopra001
Copy link
Contributor Author

I remember making this change after encountering a crash related to an arrayStoreCHK node. So I don't think it is too conservative on the x86 side. I will try to reproduce the crash.

@dchopra001
Copy link
Contributor Author

I have recreated the crash. It is a crash during compilation of 22:33:34 Method_being_compiled=java/util/AbstractCollection.toArray([Ljava/lang/Object;)[Ljava/lang/Object; when running OpenJ9 Unsafe Tests.

I'll reproduce this locally today in order to get the trees and backtrace as well.

22:33:34  Unhandled exception
22:33:34  Type=Segmentation error vmState=0x0005ffff
22:33:34  J9Generic_Signal_Number=00000018 Signal_Number=0000000b Error_Value=7efb1468 Signal_Code=00000001
22:33:34  Handler1=000003FFB6C4A110 Handler2=000003FFB6827E68 InaccessibleAddress=000003FFE94C3000
22:33:34  gpr0=0000000000000000 gpr1=000003FFE94C3247 gpr2=000003FFE94C3249 gpr3=0000000000074C00
22:33:34  gpr4=000003FF694C324E gpr5=0000000000000000 gpr6=0000000000000000 gpr7=000003FFB63A89E0
22:33:34  gpr8=000003FFB4190088 gpr9=0000000000074780 gpr10=0000000000015B00 gpr11=000003FFB6E5BCC8
22:33:34  gpr12=000003FFB63A6000 gpr13=000003FFB60FDB40 gpr14=000003FFB569F29A gpr15=000003FFB417A9B8
22:33:34  psw=000003FFB569F2DE mask=0705000180000000 fpc=00080000 bea=000003FFB6C7706E
22:33:34  fpr0 000003ffb417a960 (f: 3021449472.000000, d: 2.172294e-311)
22:33:34  fpr1 000003ffb41f50b0 (f: 3021951232.000000, d: 2.172295e-311)
22:33:34  fpr2 000003ffb417b048 (f: 3021451264.000000, d: 2.172294e-311)
22:33:34  fpr3 000003ff98025550 (f: 2550289664.000000, d: 2.172062e-311)
22:33:34  fpr4 0000000000010000 (f: 65536.000000, d: 3.237909e-319)
22:33:34  fpr5 000003ffb767c090 (f: 3077030144.000000, d: 2.172322e-311)
22:33:34  fpr6 000003ffb41903a0 (f: 3021538304.000000, d: 2.172295e-311)
22:33:34  fpr7 0000000000000000 (f: 0.000000, d: 0.000000e+00)
22:33:34  fpr8 0000000000100000 (f: 1048576.000000, d: 5.180654e-318)
22:33:34  fpr9 0000000000000000 (f: 0.000000, d: 0.000000e+00)
22:33:34  fpr10 000003ffb407f000 (f: 3020419072.000000, d: 2.172294e-311)
22:33:34  fpr11 000000012f022040 (f: 788668480.000000, d: 2.511650e-314)
22:33:34  fpr12 000003ffb7a132b6 (f: 3080794880.000000, d: 2.172324e-311)
22:33:34  fpr13 000003ffd957c668 (f: 3646408192.000000, d: 2.172603e-311)
22:33:34  fpr14 000000012f0229e0 (f: 788670976.000000, d: 2.511651e-314)
22:33:34  fpr15 000003ffd1a7e748 (f: 3517441792.000000, d: 2.172540e-311)
22:33:34  Module=/home/jenkins/workspace/Test_openjdk8_j9_sanity.functional_s390x_linux_Personal/openjdkbinary/j2sdk-image/jre/lib/s390x/compressedrefs/libj9jit29.so
22:33:34  Module_base_address=000003FFB5380000
22:33:34  
22:33:34  Method_being_compiled=java/util/AbstractCollection.toArray([Ljava/lang/Object;)[Ljava/lang/Object;
22:33:34  Target=2_90_20191020_75 (Linux 4.4.0-150-generic)
22:33:34  CPU=s390x (2 logical CPUs) (0xeee77000 RAM)
22:33:34  ----------- Stack Backtrace -----------

@dchopra001
Copy link
Contributor Author

Status Update

This one is taking a little bit longer to address as I'm seeing a new crash after updating my development branches to the latest from upstream/jitaas branch. I hope to have a solution soon.

@mpirvu mpirvu mentioned this pull request Nov 22, 2019
19 tasks
@dchopra001
Copy link
Contributor Author

dchopra001 commented Jul 6, 2020

The original problem that this PR is trying to solve can be reproduced by running the stringConcatOptTest_0 test.

The crash itself happens on the client and produces the following backtrace:

#13 0x000003ff8b399c3c in TR_ResolvedJ9Method::definingClassFromCPFieldRef(TR::Compilation*, J9ConstantPool*, int, bool) ()
   from /sandbox/dchopra/development/openj9-openjdk-jdk8/build/linux-s390x-normal-server-release/images/j2sdk-image/jre/lib/s390x/compressedrefs/libj9jit29.so
#14 0x000003ff8b399d8c in TR_ResolvedRelocatableJ9Method::definingClassFromCPFieldRef(TR::Compilation*, int, bool) ()
   from /sandbox/dchopra/development/openj9-openjdk-jdk8/build/linux-s390x-normal-server-release/images/j2sdk-image/jre/lib/s390x/compressedrefs/libj9jit29.so
#15 0x000003ff8b49fe34 in handleServerMessage(JITServer::ClientStream*, TR_J9VM*, JITServer::MessageType&) () from /sandbox/dchopra/development/openj9-openjdk-jdk8/build/linux-s390x-normal-server-release/images/j2sdk-image/jre/lib/s390x/compressedrefs/libj9jit29.so
#16 0x000003ff8b4aaaf2 in remoteCompile(J9VMThread*, TR::Compilation*, TR_ResolvedMethod*, J9Method*, TR::IlGeneratorMethodDetails&, TR::CompilationInfoPerThreadBase*) ()
   from /sandbox/dchopra/development/openj9-openjdk-jdk8/build/linux-s390x-normal-server-release/images/j2sdk-image/jre/lib/s390x/compressedrefs/libj9jit29.so
#17 0x000003ff8b326c9a in TR::CompilationInfoPerThreadBase::compile(J9VMThread*, TR::Compilation*, TR_ResolvedMethod*, TR_J9VMBase&, TR_OptimizationPlan*, TR::SegmentAllocator const&) ()
   from /sandbox/dchopra/development/openj9-openjdk-jdk8/build/linux-s390x-normal-server-release/images/j2sdk-image/jre/lib/s390x/compressedrefs/libj9jit29.so
#18 0x000003ff8b327c4a in TR::CompilationInfoPerThreadBase::wrappedCompile(J9PortLibrary*, void*) () from /sandbox/dchopra/development/openj9-openjdk-jdk8/build/linux-s390x-normal-server-release/images/j2sdk-image/jre/lib/s390x/compressedrefs/libj9jit29.so
#19 0x000003ff90ea21e8 in omrsig_protect () from /sandbox/dchopra/development/openj9-openjdk-jdk8/build/linux-s390x-normal-server-release/images/j2sdk-image/jre/lib/s390x/compressedrefs/libj9prt29.so
#20 0x000003ff8b329b70 in TR::CompilationInfoPerThreadBase::compile(J9VMThread*, TR_MethodToBeCompiled*, J9::J9SegmentProvider&) ()
   from /sandbox/dchopra/development/openj9-openjdk-jdk8/build/linux-s390x-normal-server-release/images/j2sdk-image/jre/lib/s390x/compressedrefs/libj9jit29.so
#21 0x000003ff8b32a194 in TR::CompilationInfoPerThread::processEntry(TR_MethodToBeCompiled&, J9::J9SegmentProvider&) ()
   from /sandbox/dchopra/development/openj9-openjdk-jdk8/build/linux-s390x-normal-server-release/images/j2sdk-image/jre/lib/s390x/compressedrefs/libj9jit29.so
#22 0x000003ff8b325660 in TR::CompilationInfoPerThread::processEntries() () from /sandbox/dchopra/development/openj9-openjdk-jdk8/build/linux-s390x-normal-server-release/images/j2sdk-image/jre/lib/s390x/compressedrefs/libj9jit29.so
#23 0x000003ff8b325b26 in TR::CompilationInfoPerThread::run() () from /sandbox/dchopra/development/openj9-openjdk-jdk8/build/linux-s390x-normal-server-release/images/j2sdk-image/jre/lib/s390x/compressedrefs/libj9jit29.so
#24 0x000003ff8b325c10 in protectedCompilationThreadProc(J9PortLibrary*, TR::CompilationInfoPerThread*) () from /sandbox/dchopra/development/openj9-openjdk-jdk8/build/linux-s390x-normal-server-release/images/j2sdk-image/jre/lib/s390x/compressedrefs/libj9jit29.so
#25 0x000003ff90ea21e8 in omrsig_protect () from /sandbox/dchopra/development/openj9-openjdk-jdk8/build/linux-s390x-normal-server-release/images/j2sdk-image/jre/lib/s390x/compressedrefs/libj9prt29.so
#26 0x000003ff8b32613a in compilationThreadProc(void*) () from /sandbox/dchopra/development/openj9-openjdk-jdk8/build/linux-s390x-normal-server-release/images/j2sdk-image/jre/lib/s390x/compressedrefs/libj9jit29.so
#27 0x000003ff91185340 in thread_wrapper () from /sandbox/dchopra/development/openj9-openjdk-jdk8/build/linux-s390x-normal-server-release/images/j2sdk-image/jre/lib/s390x/compressedrefs/libj9thr29.so
#28 0x000003ff91d07aa8 in start_thread (arg=0x3ff7137d910) at pthread_create.c:463
#29 0x000003ff91efa936 in thread_start () at ../sysdeps/unix/sysv/linux/s390/s390-64/clone.S:65

On the server, the call stack would look something like below:
VMarrayStoreCHKEvaluator-->
TR_J9SharedCacheServerVM::getSystemClassFromClassName(... isVettedForAOT=true)--> TR_ResolvedRelocatableJ9JITServerMethod::validateArbitraryClass-->
TR_ResolvedRelocatableJ9JITServerMethod::storeValidationRecordIfNecessary-->
TR_ResolvedJ9JITServerMethod::definingClassFromCPFieldRef-->
_stream->write(JITServer::MessageType::ResolvedMethod_definingClassFromCPFieldRef

From here, the client will handle the message and the call stack in the backtrace above can explain which routine we crash in.

The reason this issue is not seen on x86 is because isVettedForAOT is always false there.

@mpirvu FYI

Copy link
Contributor

@mpirvu mpirvu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mpirvu
Copy link
Contributor

mpirvu commented Jul 6, 2020

jenkins test sanity zlinux jdk8

@mpirvu
Copy link
Contributor

mpirvu commented Jul 6, 2020

This item is very old, so it needs a rebase.

@mpirvu mpirvu self-assigned this Jul 6, 2020
Signed-off-by: Dhruv Chopra <Dhruv.C.Chopra@ibm.com>
@dchopra001 dchopra001 changed the base branch from jitaas to master July 6, 2020 18:32
@dchopra001
Copy link
Contributor Author

@mpirvu It should be good now.

@mpirvu
Copy link
Contributor

mpirvu commented Jul 6, 2020

jenkins test sanity all zlinux jdk8

@mpirvu
Copy link
Contributor

mpirvu commented Jul 6, 2020

jenkins test sanity zlinux jdk8

1 similar comment
@mpirvu
Copy link
Contributor

mpirvu commented Jul 6, 2020

jenkins test sanity zlinux jdk8

@mpirvu mpirvu merged commit e565eca into eclipse-openj9:master Jul 6, 2020
@dchopra001 dchopra001 deleted the arrayStoreCHKEval branch July 13, 2021 13:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arch:z comp:jitserver Artifacts related to JIT-as-a-Service project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants