Skip to main content

Java (OpenJDK 9), 311 227227 223 bytes

import sun.misc.*;import java.lang.reflect.*;class MainM{public static void main(String[] argsString[]args) throws Exception{Constructor<Unsafe> c=Unsafe.class.getDeclaredConstructor();c.setAccessible(true);c.newInstance().getAddress(0);}}

Try it online!

Ungolfed:

import sun.misc.Unsafe;

import java.lang.reflect.Constructor;

public class SegFault {

    public static void main(String[] args) throws Exception {
        Constructor<Unsafe> unsafeConstructor = Unsafe.class.getDeclaredConstructor();
        unsafeConstructor.setAccessible(true);
        Unsafe unsafe = unsafeConstructor.newInstance();
        System.out.println(unsafe.getAddress(0));
    }
}

Saved 84 Bytes thanks to Mistah Figg

Java (OpenJDK 9), 311 227 bytes

import sun.misc.*;import java.lang.reflect.*;class Main{public static void main(String[] args) throws Exception{Constructor<Unsafe> c=Unsafe.class.getDeclaredConstructor();c.setAccessible(true);c.newInstance().getAddress(0);}}

Try it online!

Ungolfed:

import sun.misc.Unsafe;

import java.lang.reflect.Constructor;

public class SegFault {

    public static void main(String[] args) throws Exception {
        Constructor<Unsafe> unsafeConstructor = Unsafe.class.getDeclaredConstructor();
        unsafeConstructor.setAccessible(true);
        Unsafe unsafe = unsafeConstructor.newInstance();
        System.out.println(unsafe.getAddress(0));
    }
}

Saved 84 Bytes thanks to Mistah Figg

Java (OpenJDK 9), 311 227 223 bytes

import sun.misc.*;import java.lang.reflect.*;class M{public static void main(String[]args) throws Exception{Constructor<Unsafe> c=Unsafe.class.getDeclaredConstructor();c.setAccessible(true);c.newInstance().getAddress(0);}}

Try it online!

Ungolfed:

import sun.misc.Unsafe;

import java.lang.reflect.Constructor;

public class SegFault {

    public static void main(String[] args) throws Exception {
        Constructor<Unsafe> unsafeConstructor = Unsafe.class.getDeclaredConstructor();
        unsafeConstructor.setAccessible(true);
        Unsafe unsafe = unsafeConstructor.newInstance();
        System.out.println(unsafe.getAddress(0));
    }
}

Saved 84 Bytes thanks to Mistah Figg

deleted 44 characters in body
Source Link
Serverfrog
  • 255
  • 2
  • 11

Java (OpenJDK 9), 311311 227 bytes

import sun.misc.Unsafe;import*;import java.lang.reflect.Constructor;class*;class Main{public static void main(String[] args) throws Exception{Constructor<Unsafe> unsafeConstructor=Unsafec=Unsafe.class.getDeclaredConstructor();unsafeConstructor;c.setAccessible(true);Unsafe unsafe=unsafeConstructor;c.newInstance();unsafe.getAddress(0);}}

Try it online!Try it online!

Ungolfed:

import sun.misc.Unsafe;

import java.lang.reflect.Constructor;

public class SegFault {

    public static void main(String[] args) throws Exception {
        Constructor<Unsafe> unsafeConstructor = Unsafe.class.getDeclaredConstructor();
        unsafeConstructor.setAccessible(true);
        Unsafe unsafe = unsafeConstructor.newInstance();
        System.out.println(unsafe.getAddress(0));
    }
}

Saved 84 Bytes thanks to Mistah Figg

Java (OpenJDK 9), 311 bytes

import sun.misc.Unsafe;import java.lang.reflect.Constructor;class Main{public static void main(String[] args) throws Exception{Constructor<Unsafe> unsafeConstructor=Unsafe.class.getDeclaredConstructor();unsafeConstructor.setAccessible(true);Unsafe unsafe=unsafeConstructor.newInstance();unsafe.getAddress(0);}}

Try it online!

Ungolfed:

import sun.misc.Unsafe;

import java.lang.reflect.Constructor;

public class SegFault {

    public static void main(String[] args) throws Exception {
        Constructor<Unsafe> unsafeConstructor = Unsafe.class.getDeclaredConstructor();
        unsafeConstructor.setAccessible(true);
        Unsafe unsafe = unsafeConstructor.newInstance();
        System.out.println(unsafe.getAddress(0));
    }
}

Java (OpenJDK 9), 311 227 bytes

import sun.misc.*;import java.lang.reflect.*;class Main{public static void main(String[] args) throws Exception{Constructor<Unsafe> c=Unsafe.class.getDeclaredConstructor();c.setAccessible(true);c.newInstance().getAddress(0);}}

Try it online!

Ungolfed:

import sun.misc.Unsafe;

import java.lang.reflect.Constructor;

public class SegFault {

    public static void main(String[] args) throws Exception {
        Constructor<Unsafe> unsafeConstructor = Unsafe.class.getDeclaredConstructor();
        unsafeConstructor.setAccessible(true);
        Unsafe unsafe = unsafeConstructor.newInstance();
        System.out.println(unsafe.getAddress(0));
    }
}

Saved 84 Bytes thanks to Mistah Figg

deleted 86 characters in body
Source Link
Serverfrog
  • 255
  • 2
  • 11

Java (OpenJDK 9), 311 bytes

import sun.misc.Unsafe;import java.lang.reflect.Constructor;class Main{public static void main(String[] args) throws Exception{Constructor<Unsafe> unsafeConstructor=Unsafe.class.getDeclaredConstructor();unsafeConstructor.setAccessible(true);Unsafe unsafe=unsafeConstructor.newInstance();unsafe.getAddress(0);}}

Try it online!

Ungolfed:

import sun.misc.Unsafe;

import java.lang.reflect.Constructor;

public class SegFault {

    public static void main(String[] args) throws Exception {
        Constructor<Unsafe> unsafeConstructor = Unsafe.class.getDeclaredConstructor();
        unsafeConstructor.setAccessible(true);
        Unsafe unsafe = unsafeConstructor.newInstance();
        System.out.println(unsafe.getAddress(0));
    }
}

This is the nearest I currently get to a SegFault. It creates a Access Violation.

Java (OpenJDK 9), 311 bytes

import sun.misc.Unsafe;import java.lang.reflect.Constructor;class Main{public static void main(String[] args) throws Exception{Constructor<Unsafe> unsafeConstructor=Unsafe.class.getDeclaredConstructor();unsafeConstructor.setAccessible(true);Unsafe unsafe=unsafeConstructor.newInstance();unsafe.getAddress(0);}}

Try it online!

Ungolfed:

import sun.misc.Unsafe;

import java.lang.reflect.Constructor;

public class SegFault {

    public static void main(String[] args) throws Exception {
        Constructor<Unsafe> unsafeConstructor = Unsafe.class.getDeclaredConstructor();
        unsafeConstructor.setAccessible(true);
        Unsafe unsafe = unsafeConstructor.newInstance();
        System.out.println(unsafe.getAddress(0));
    }
}

This is the nearest I currently get to a SegFault. It creates a Access Violation.

Java (OpenJDK 9), 311 bytes

import sun.misc.Unsafe;import java.lang.reflect.Constructor;class Main{public static void main(String[] args) throws Exception{Constructor<Unsafe> unsafeConstructor=Unsafe.class.getDeclaredConstructor();unsafeConstructor.setAccessible(true);Unsafe unsafe=unsafeConstructor.newInstance();unsafe.getAddress(0);}}

Try it online!

Ungolfed:

import sun.misc.Unsafe;

import java.lang.reflect.Constructor;

public class SegFault {

    public static void main(String[] args) throws Exception {
        Constructor<Unsafe> unsafeConstructor = Unsafe.class.getDeclaredConstructor();
        unsafeConstructor.setAccessible(true);
        Unsafe unsafe = unsafeConstructor.newInstance();
        System.out.println(unsafe.getAddress(0));
    }
}
added 891 characters in body
Source Link
Serverfrog
  • 255
  • 2
  • 11
Loading
Source Link
Serverfrog
  • 255
  • 2
  • 11
Loading