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

Build error after applying light-jdk8u92-b14.patch #117

Closed
saqib-ahmed opened this issue Dec 7, 2016 · 7 comments
Closed

Build error after applying light-jdk8u92-b14.patch #117

saqib-ahmed opened this issue Dec 7, 2016 · 7 comments

Comments

@saqib-ahmed
Copy link

saqib-ahmed commented Dec 7, 2016

Hi,
I downloaded source for openjdk8u92-b14 from openjdk mercurial repositories and applied the patch light-jdk8u92-b14.patch on it using

patch -p1 <light-jdk8u92-b14.patch

It got patched successfully but build is failing after patching. The first error is due to java_lang_invoke_DirectMethodHandle_StaticAccessor field in jvmtiRedefineClasses2.cpp. I couldn't find this class anywhere in the patch and/or source code. Am I doing something wrong? Or patch is faulty? Kindly help me building openjdk with DCEVM.

Regards

@saqib-ahmed
Copy link
Author

saqib-ahmed commented Dec 7, 2016

I got the answer. There were other patches too like dmh-field-accessors-java8.patch etc that had to be applied.

@skybber
Copy link
Contributor

skybber commented Dec 7, 2016

I would recommend you to apply all patches for 8u92 from series as well jvmti-getLoadedClasses-java8.patch since it fixes major bug concerning debugging in IDE. jvmti-getLoadedClasses-java8.patch is used only for 8u122 but could be used for previous versions too.

@saqib-ahmed
Copy link
Author

saqib-ahmed commented Dec 7, 2016

So here's what I did:

  1. Downloaded OpenJDKu92-b14 from mercurial repository.

  2. Coppied arguments-java8.patch, gc-java8.patch, dmh-field-accessors-java8.patch, JVM_SetVmMemoryPressure.patch, jvmti-getLoadedClasses-java8.patch and light-jdk8u92-b14.patch in hotspot folder and applied these patches one by one using patch -p1 < *.patch command.

  3. Finally configured and built the JDK. There was only one minor error remaining so I fixed it by hand. It was in file hotspot/src/share/vm/gc_implementation/g1/heapRegion.cpp:1109.
    I replaced
    ----SCAN_AND_FORWARD(cp, top, block_is_always_obj, block_size);
    by
    +++SCAN_AND_FORWARD(cp, top, block_is_always_obj, block_size, false);

Everything built successfully. I think this last change somehow slipped from the patch. Update the patch accordingly.

And here's what I wanna do:

  • I'm on my way to use the so called Enhanced Redefinition API inside JVM for one of my projects. Is there any documentation or head starts available for using the API inside JVM????

  • Currently I can grab a class and/or a function and can get a pointer to it. My objective is to change it during runtime.

Any help would be appreciated. @skybber @idubrov

Regards
Saqib Ahmed

@skybber
Copy link
Contributor

skybber commented Dec 7, 2016

It is used over JVMTI in the same way in which the standard redefinition api is used. I would recommend you to look at original DCEVM project where you can find out more.

@saqib-ahmed
Copy link
Author

saqib-ahmed commented Dec 7, 2016

Sure, I would definitely see that. Actually I couldn't find any source which describes using standard JVMTI redefinition API inside JVM. I mean, I couldn't find the coding details for the sequence of pausing the threads on safepoints, changing metadata of class files, editing system dictionary and executing the edited bytecodes by resuming threads. Or sequence of the JVMTI redefinition API functions to do that.
I understand it theoretically, but couldn't grasp how to practice this theory.

Any enlightenment?

@skybber
Copy link
Contributor

skybber commented Dec 7, 2016

It is out of topic, you can write me an email or contact me on HotswapAgent's gitter.

@saqib-ahmed
Copy link
Author

Email it is. Thanks for the help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants