Skip to content
Permalink
Browse files

8238083: Crash: assert(is_object_aligned(v)) failed: address not alig…

…ned: 0xfffffffffffffff1

Reviewed-by: mgronlun
  • Loading branch information
Erik Gahlin
Erik Gahlin committed Jan 29, 2020
1 parent 2f45d46 commit c718a082a4098f91958ad3f40842b875fd22f325
Showing with 12 additions and 6 deletions.
  1. +12 −6 src/jdk.jfr/share/classes/jdk/jfr/internal/Utils.java
@@ -328,17 +328,23 @@ static long nanosToTicks(long nanos) {

static synchronized EventHandler getHandler(Class<? extends jdk.internal.event.Event> eventClass) {
Utils.ensureValidEventSubclass(eventClass);
Object handler = JVM.getJVM().getHandler(eventClass);
if (handler == null || handler instanceof EventHandler) {
return (EventHandler) handler;
try {
Field f = eventClass.getDeclaredField(EventInstrumentation.FIELD_EVENT_HANDLER);
SecuritySupport.setAccessible(f);
return (EventHandler) f.get(null);
} catch (NoSuchFieldException | IllegalArgumentException | IllegalAccessException e) {
throw new InternalError("Could not access event handler");
}
throw new InternalError("Could not access event handler");
}

static synchronized void setHandler(Class<? extends jdk.internal.event.Event> eventClass, EventHandler handler) {
Utils.ensureValidEventSubclass(eventClass);
if (!JVM.getJVM().setHandler(eventClass, handler)) {
throw new InternalError("Could not set event handler");
try {
Field field = eventClass.getDeclaredField(EventInstrumentation.FIELD_EVENT_HANDLER);
SecuritySupport.setAccessible(field);
field.set(null, handler);
} catch (NoSuchFieldException | IllegalArgumentException | IllegalAccessException e) {
throw new InternalError("Could not access event handler");
}
}

0 comments on commit c718a08

Please sign in to comment.