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

Add Relocation Error Codes #14893

Merged
merged 8 commits into from
Apr 21, 2022
Merged

Conversation

dsouzai
Copy link
Contributor

@dsouzai dsouzai commented Apr 8, 2022

  • Add Relocation Error codes
  • Update Relocation Infrastructure to return relocation error codes rather than compilation error codes
  • Use generic compilation error code for most relocation failures
  • Fix compilation failure verbose log line to print AOT load if the failed compile was an AOT load
  • Update storing of validation failure SCC hints to capture all validation failures
  • Delete unused compilation error codes

…Relocations

It is possible for a few different exceptions to get thrown during
relocation. This commit adds catch block for some known exceptions so
that the appropriate compilation error code can be set.

Signed-off-by: Irwin D'Souza <[email protected]>
@dsouzai
Copy link
Contributor Author

dsouzai commented Apr 8, 2022

@mpirvu @mstoodle could you please review? fyi @0xdaryl (since I think you were asking about this a few months ago).

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.

Overall it looks good. Only a couple of nitpicks

runtime/compiler/runtime/RelocationRuntime.hpp Outdated Show resolved Hide resolved
runtime/compiler/runtime/RelocationRuntime.hpp Outdated Show resolved Hide resolved
@mpirvu
Copy link
Contributor

mpirvu commented Apr 18, 2022

jenkins test sanity all jdk17

@dsouzai
Copy link
Contributor Author

dsouzai commented Apr 18, 2022

Of course there's a build break on windows...

Reading up online, it seems the error can happen because the enum's already defined elsewhere. I think it's NO_ERROR that's the problem.

I guess I'll have to rename the TR_RelocationErrorCodeType enum values...

@mpirvu
Copy link
Contributor

mpirvu commented Apr 18, 2022

f:\users\jenkins\workspace\build_jdk17_x86-64_windows_personal\openj9\runtime\compiler\runtime/RelocationRuntime.hpp(126): error C2059: syntax error: 'constant'
15:26:36  f:\users\jenkins\workspace\build_jdk17_x86-64_windows_personal\openj9\runtime\compiler\runtime/RelocationRuntime.hpp(130): error C2143: syntax error: missing ';' before '}'
15:26:36  f:\users\jenkins\workspace\build_jdk17_x86-64_windows_personal\openj9\runtime\compiler\runtime/RelocationRuntime.hpp(130): error C2059: syntax error: '}'
15:26:36  f:\users\jenkins\workspace\build_jdk17_x86-64_windows_personal\openj9\runtime\compiler\runtime/RelocationRuntime.hpp(141): error C2589: 'constant': illegal token on right side of '::'
15:26:36  f:\users\jenkins\workspace\build_jdk17_x86-64_windows_personal\openj9\runtime\compiler\runtime/RelocationRuntime.hpp(141): error C2062: type 'unknown-type' unexpected
15:26:36  f:\users\jenkins\workspace\build_jdk17_x86-64_windows_personal\openj9\runtime\compiler\runtime/RelocationRuntime.hpp(143): error C2838: 'MISC': illegal qualified name in member declaration
15:26:36  f:\users\jenkins\workspace\build_jdk17_x86-64_windows_personal\openj9\runtime\compiler\runtime/RelocationRuntime.hpp(144): error C2838: 'MISC': illegal qualified name in member declaration
15:26:36  f:\users\jenkins\workspace\build_jdk17_x86-64_windows_personal\openj9\runtime\compiler\runtime/RelocationRuntime.hpp(145): error C2838: 'MISC': illegal qualified name in member declaration
15:26:36  f:\users\jenkins\workspace\build_jdk17_x86-64_windows_personal\openj9\runtime\compiler\runtime/RelocationRuntime.hpp(146): error C2838: 'MISC': illegal qualified name in member declaration
15:26:36  f:\users\jenkins\workspace\build_jdk17_x86-64_windows_personal\openj9\runtime\compiler\runtime/RelocationRuntime.hpp(147): error C2838: 'MISC': illegal qualified name in member declaration
15:26:36  f:\users\jenkins\workspace\build_jdk17_x86-64_windows_personal\openj9\runtime\compiler\runtime/RelocationRuntime.hpp(148): error C2838: 'MISC': illegal qualified name in member declaration
15:26:36  f:\users\jenkins\workspace\build_jdk17_x86-64_windows_personal\openj9\runtime\compiler\runtime/RelocationRuntime.hpp(150): error C2838: 'VALIDATION': illegal qualified name in member declaration
15:26:36  f:\users\jenkins\workspace\build_jdk17_x86-64_windows_personal\openj9\runtime\compiler\runtime/RelocationRuntime.hpp(151): error C2838: 'VALIDATION': illegal qualified name in member declaration...

@dsouzai
Copy link
Contributor Author

dsouzai commented Apr 18, 2022

jenkins test sanity win jdk17

@dsouzai
Copy link
Contributor Author

dsouzai commented Apr 18, 2022

I was gonna just rename NO_ERROR but I decided to just harden the code, so I scoped the enum in a new struct called TR_RelocationError (since we can't use C++11's enum scoping). I've launched a win64 job to verify that this solves the problem; if it doesn't then I'll have to hop on a win machine and figure it out.

@dsouzai dsouzai marked this pull request as draft April 18, 2022 21:34
@dsouzai
Copy link
Contributor Author

dsouzai commented Apr 18, 2022

Converting to draft until I sort this all out.

Add error codes for all the various relocation errors that can occur.

Signed-off-by: Irwin D'Souza <[email protected]>
The generic compilation error code will be used in places that need to
determine what to do next based on the compilation failure. This is
common across most relocation failures. Therefore, it is best to have a
generic error code for this purpose, and use the relocation error code
for RAS purposes.

Signed-off-by: Irwin D'Souza <[email protected]>
Update the relocation infrastructure to return well defined relocation
error codes rather than 0, -1, or a generic compilation error code.

Signed-off-by: Irwin D'Souza <[email protected]>
The existing logic added a SCC hint for validation failures; this should
be updated to use the relocation error codes. This not only simplifies
the code, but also will now include several validation failures that
were missed.

Signed-off-by: Irwin D'Souza <[email protected]>
An AOT load does not use the SharedCacheVM front end. Therefore, the
compilation failure line in the vlog did not print out whether the
compilation was a failed AOT load. This commit fixes this by passing in
the TR_MethodToBeCompiled entry, which can be used to determine whether
the compile was an AOT load or not.

Signed-off-by: Irwin D'Souza <[email protected]>
@dsouzai
Copy link
Contributor Author

dsouzai commented Apr 19, 2022

Apparently NO_ERROR is a macro in windows, so it can't be addressed even with enum scoping. I renamed it to NO_RELO_ERROR (see force push). Verified the build succeeded on a win machine.

@dsouzai
Copy link
Contributor Author

dsouzai commented Apr 19, 2022

jenkins test sanity win jdk17

@dsouzai dsouzai marked this pull request as ready for review April 19, 2022 18:07
@dsouzai
Copy link
Contributor Author

dsouzai commented Apr 19, 2022

Ready for final review @mpirvu

@mpirvu
Copy link
Contributor

mpirvu commented Apr 19, 2022

jenkins compile all jdk17

@mpirvu
Copy link
Contributor

mpirvu commented Apr 19, 2022

jenkins test sanity.functional+aot all jdk17

@dsouzai
Copy link
Contributor Author

dsouzai commented Apr 20, 2022

AIX failure

[2022-04-20T00:28:59.944Z]  [OUT] fontmanger LIB: libfontmanager.so
[2022-04-20T00:28:59.944Z]  [ERR] Exception in thread "main" java.awt.AWTError: Can't connect to X11 window server using 'unix:0' as the value of the DISPLAY variable.

is a known issue; see #14894 (comment) and #14943.

AArch64 failure

[2022-04-19T22:51:26.287Z] Running command: "/home/jenkins/workspace/Test_openjdk17_j9_sanity.functional_aarch64_linux_Personal_testList_1/openjdkbinary/j2sdk-image/bin/java" -Xshareclasses:name=test_aot -Xscmx400M -Xscmaxaot256m   -Xdump -cp "/home/jenkins/workspace/Test_openjdk17_j9_sanity.functional_aarch64_linux_Personal_testList_1/aqa-tests/TKG/../../jvmtest/functional/cmdLineTests/utils/utils.jar" -Xlockword:mode=minimizeFootprint VMBench.FibBench
[2022-04-19T22:51:26.287Z] Time spent starting: 2 milliseconds
[2022-04-19T22:51:28.539Z] Time spent executing: 2168 milliseconds
[2022-04-19T22:51:28.539Z] Test result: FAILED
[2022-04-19T22:51:28.539Z] Output from test:
[2022-04-19T22:51:28.539Z]  [OUT] Fibonacci: iterations = 10000
[2022-04-19T22:51:28.539Z]  [OUT] fibonacci(12) = 144
[2022-04-19T22:51:28.539Z]  [ERR] Unhandled exception
[2022-04-19T22:51:28.539Z]  [ERR] Type=Segmentation error vmState=0x00000000

is due to #13577.

@mpirvu
Copy link
Contributor

mpirvu commented Apr 21, 2022

Merging since the two tests that are failing are not due to this PR.

@mpirvu mpirvu merged commit 20ba075 into eclipse-openj9:master Apr 21, 2022
@dsouzai dsouzai deleted the reloErrorCodes branch February 3, 2023 16:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants