{"action":"created","issue":{"url":"https://api.github.com/repos/eclipse/openj9/issues/2751","repository_url":"https://api.github.com/repos/eclipse/openj9","labels_url":"https://api.github.com/repos/eclipse/openj9/issues/2751/labels{/name}","comments_url":"https://api.github.com/repos/eclipse/openj9/issues/2751/comments","events_url":"https://api.github.com/repos/eclipse/openj9/issues/2751/events","html_url":"https://github.com/eclipse/openj9/issues/2751","id":355617080,"node_id":"MDU6SXNzdWUzNTU2MTcwODA=","number":2751,"title":"Getting JRebel to work with -agentpath on openJ9","user":{"login":"andresluuk","id":2578472,"node_id":"MDQ6VXNlcjI1Nzg0NzI=","avatar_url":"https://avatars1.githubusercontent.com/u/2578472?v=4","gravatar_id":"","url":"https://api.github.com/users/andresluuk","html_url":"https://github.com/andresluuk","followers_url":"https://api.github.com/users/andresluuk/followers","following_url":"https://api.github.com/users/andresluuk/following{/other_user}","gists_url":"https://api.github.com/users/andresluuk/gists{/gist_id}","starred_url":"https://api.github.com/users/andresluuk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andresluuk/subscriptions","organizations_url":"https://api.github.com/users/andresluuk/orgs","repos_url":"https://api.github.com/users/andresluuk/repos","events_url":"https://api.github.com/users/andresluuk/events{/privacy}","received_events_url":"https://api.github.com/users/andresluuk/received_events","type":"User","site_admin":false},"labels":[{"id":697961487,"node_id":"MDU6TGFiZWw2OTc5NjE0ODc=","url":"https://api.github.com/repos/eclipse/openj9/labels/jdk10","name":"jdk10","color":"d93f0b","default":false},{"id":807670015,"node_id":"MDU6TGFiZWw4MDc2NzAwMTU=","url":"https://api.github.com/repos/eclipse/openj9/labels/jdk11","name":"jdk11","color":"d93f0b","default":false},{"id":697961365,"node_id":"MDU6TGFiZWw2OTc5NjEzNjU=","url":"https://api.github.com/repos/eclipse/openj9/labels/jdk9","name":"jdk9","color":"d93f0b","default":false},{"id":822706839,"node_id":"MDU6TGFiZWw4MjI3MDY4Mzk=","url":"https://api.github.com/repos/eclipse/openj9/labels/userRaised","name":"userRaised","color":"bfdadc","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-08-30T14:41:06Z","updated_at":"2018-08-30T14:46:36Z","closed_at":null,"author_association":"NONE","body":"We are having some issues to get JRebel to work with openJ9 as with a native agent bootstrap (-agentpath)\r\n\r\nThe current main question is: Is there some way to define a class into the 'java.base' module very early on; by early I mean so it can be used as a super-type to String.\r\n\r\nPotentially something equivalent of '--patch-module', but accessible at 'Agent_OnLoad' time. I know the equivalent system properties have already been read at that time, and none of the JVM-TI or JNI spec functions allows for setting patch module paths.\r\n\r\nWhen I use a plain javaagent and --patch-module then I am able to get our stuff working. Because classes from --patch-module java.base path are defined into java.base.\r\n\r\nI got it working on my machine with a hack for createramclass.cpp~2800\r\n\r\nI played around with hardcoded positions of javaBaseModule and unamedModuleForSystemLoader in J9JavaVM before defining a class.\r\n\r\ne.g. Before defining one of our classes, that is suppoesd to go into java.base, I sat J9JavaVM->unamedModuleForSystemLoader=J9JavaVM->javaBaseModule in our agent and reverted if after define was done.\r\n\r\nI know now that the pointer offset of javaBaseModule from the beginning of J9JavaVM is 18800 in my local openJ9 build.\r\n\r\nBut this has the problem that the relative locations of those modules probably changes from JVM version to JVM version.\r\n\r\nWe would need some reliable way to get the classes we need into java.base.\r\n\r\nIf possible maybe a new internal JVM property? That we could set in our native agent using the default jni APIs and that is read in createramclass.cpp~2800? to return javaBaseModule instead of unamedModuleForSystemLoader etc?\r\n\r\nSome differences open JDK:\r\n\r\nAfter the Object is loaded open JDK does not have the concept of a module so all the classes defined there will go to java.base."},"comment":{"url":"https://api.github.com/repos/eclipse/openj9/issues/comments/417346098","html_url":"https://github.com/eclipse/openj9/issues/2751#issuecomment-417346098","issue_url":"https://api.github.com/repos/eclipse/openj9/issues/2751","id":417346098,"node_id":"MDEyOklzc3VlQ29tbWVudDQxNzM0NjA5OA==","user":{"login":"DanHeidinga","id":8503711,"node_id":"MDQ6VXNlcjg1MDM3MTE=","avatar_url":"https://avatars2.githubusercontent.com/u/8503711?v=4","gravatar_id":"","url":"https://api.github.com/users/DanHeidinga","html_url":"https://github.com/DanHeidinga","followers_url":"https://api.github.com/users/DanHeidinga/followers","following_url":"https://api.github.com/users/DanHeidinga/following{/other_user}","gists_url":"https://api.github.com/users/DanHeidinga/gists{/gist_id}","starred_url":"https://api.github.com/users/DanHeidinga/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DanHeidinga/subscriptions","organizations_url":"https://api.github.com/users/DanHeidinga/orgs","repos_url":"https://api.github.com/users/DanHeidinga/repos","events_url":"https://api.github.com/users/DanHeidinga/events{/privacy}","received_events_url":"https://api.github.com/users/DanHeidinga/received_events","type":"User","site_admin":false},"created_at":"2018-08-30T14:46:36Z","updated_at":"2018-08-30T14:46:36Z","author_association":"CONTRIBUTOR","body":"Reference to the JVMTI spec's VMStart event: https://docs.oracle.com/javase/10/docs/specs/jvmti.html#VMStart\r\n\r\n```\r\nIf the capability has not been added then the VM delays posting this event until it is capable of loading classes in modules other than java.base or the VM has completed its initialization.\r\n```\r\n\r\nWe'll need to check when OpenJ9 sends the event and check the RI's behaviour to see if all classes loaded before this event are loaded into `java.base` or not. "}}
{"actor":{"display_login":"DanHeidinga"}}