@rkapsi - Is `PlatformDependent.throwException(null)` called from Netty code, and if so do you know where from?
 @Scottmitch no, not from Netty code. It was some code I wrote and one can argue it was my own fault (given the nature of that class) but I wish it'd have failed more gracefully.
 @rkapsi - Humm I guess at least in the case of unsafe we should ensure the language specification is honored:

http://docs.oracle.com/javase/specs/jls/se8/html/jls-14.html#jls-14.18

>  If evaluation of the Expression completes normally, producing a null value, then an instance V' of class NullPointerException is created and thrown instead of null. The throw statement then completes abruptly, the reason being a throw with value V'.

@trustin @normanmaurer - WDYT?
 I have a PR pending for this.
 +1. Thanks for taking care.

Maybe renaming t to cause might make the exception message more sense?
 Will do.

PlatformDependent.throwException() with null argument takes down the JVM
I'm not sure if it's a bug or feature but it's certainly not easy to debug.

Netty 4.1.0-Beta6-SNAPSHOT

```
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x00007f80fbe956c9, pid=1196, tid=140191066928896
#
# JRE version: Java(TM) SE Runtime Environment (8.0_40-b25) (build 1.8.0_40-b25)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.40-b25 mixed mode linux-amd64 compressed oops)
# Problematic frame:
# V  [libjvm.so+0x5756c9]  Exceptions::_throw(Thread*, char const*, int, Handle, char const*)+0x1d9
#
# Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# An error report file with more information is saved as:
# /<path>/hs_err_pid1196.log
#
# If you would like to submit a bug report, please visit:
#   http://bugreport.sun.com/bugreport/
#
```

common/src/main/java/io/netty/util/internal/PlatformDependent0.java
common/src/main/java/io/netty/util/internal/PlatformDependent0.java
diff --git a/common/src/main/java/io/netty/util/internal/PlatformDependent0.java b/common/src/main/java/io/netty/util/internal/PlatformDependent0.java
index e72627a18d3..ef9e3b09186 100644
--- a/common/src/main/java/io/netty/util/internal/PlatformDependent0.java
+++ b/common/src/main/java/io/netty/util/internal/PlatformDependent0.java
@@ -30,6 +30,8 @@
 import java.util.concurrent.atomic.AtomicLongFieldUpdater;
 import java.util.concurrent.atomic.AtomicReferenceFieldUpdater;
 
+import static io.netty.util.internal.ObjectUtil.checkNotNull;
+
 /**
  * The {@link PlatformDependent} operations which requires access to {@code sun.misc.*}.
  */
@@ -137,8 +139,9 @@ static boolean hasUnsafe() {
         return UNSAFE != null;
     }
 
-    static void throwException(Throwable t) {
-        UNSAFE.throwException(t);
+    static void throwException(Throwable cause) {
+        // JVM has been observed to crash when passing a null argument. See https://github.com/netty/netty/issues/4131.
+        UNSAFE.throwException(checkNotNull(cause, "cause"));
     }
 
     static void freeDirectBuffer(ByteBuffer buffer) {
