Giter Site home page Giter Site logo

readytalk / avian Goto Github PK

View Code? Open in Web Editor NEW
1.2K 98.0 170.0 20.01 MB

[INACTIVE] Avian is a lightweight virtual machine and class library designed to provide a useful subset of Java's features, suitable for building self-contained applications.

Home Page: https://readytalk.github.io/avian/

License: Other

Shell 0.15% CMake 0.09% Java 33.67% C++ 61.67% C 0.20% Makefile 2.49% Assembly 1.54% Dockerfile 0.18%
java jit-compiler openjdk jvm portable

avian's People

Contributors

alexey-pelykh avatar anonymouscommitter avatar bgould avatar bigfatbrowncat avatar bonifaido avatar chrisr3 avatar csoren avatar damjanjovanovic avatar dazaar avatar dicej avatar dscho avatar elementalvoid avatar ericscharff avatar gzsombor avatar jentfoo avatar joshuawarner32 avatar keinhaar avatar leonardvanderstel avatar lostdj avatar lwahlmeier avatar maartenr avatar mikehearn avatar mkeesey avatar polivar3 avatar sgoings avatar soc avatar tarotanaka0 avatar teras avatar terekcampbell avatar xranby avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

avian's Issues

Add putOrderedLong and putOrderedObject to sun.misc.Unsafe

I am in progress with implementing the atomic package, and recognized that putOrderedLong is not implemented in avian's unsafe implementation. There may be others I will run into, but this is at least the first one I found that we need.

** Edit added putOrderedObject to the list of what is needed to be added (for AtomicReference).

Building problem under mingw-w64

I'm using the official build of mingw-w64 from http://mingw-w64.sourceforge.net/download.php#mingw-builds

There are 2 problems with building for x86_64 platform.

Problem 1:
At first if you want to get an x86_64 version you have to specify it like

make arch=x86_64

If you just run "make", it fails on linkage cause it builds i386 binaries and tries to link them against system x86_64 libraries. Probably it's a problem in the mingw-w64 platform self-definition, but maybe there should be a workaround in avian makefile...

Problem 2:
The build script can't link avian.exe cause in mingw-w64 there are no tools named

x86_64-w64-mingw32-ar
x86_64-w64-mingw32-dlltool
x86_64-w64-mingw32-ranlib
x86_64-w64-mingw32-strip

There are only

ar
dlltool
ranlib
strip

and when I have modified Avian makefile removing prefixes for these tools like this:

...........
ifeq ($(arch),x86_64)
    ifeq ($(build-platform),cygwin)
        build-cxx = x86_64-w64-mingw32-g++
        build-cc = x86_64-w64-mingw32-gcc
    endif
    cxx = x86_64-w64-mingw32-g++ $(mflag)
    cc = x86_64-w64-mingw32-gcc $(mflag)
    dlltool = dlltool
    ar = ar
    ranlib = ranlib
    strip = strip
    inc = "$(win64)/include"
    lib = "$(win64)/lib"
else
...........

...it builds successfully. Maybe I'm wrong here, but as I understand, such tools are universal and work with any platform, are they? Maybe the difference should be moved from prefix to command line arguments?

I understand that my workaround is dirty and could break something (maybe some other mingw builds) but I want to draw your attention to this problem, since mingw-w64 is very popular.

dcmp fails on arm compiler mode

The following code prints 'false' on arm-android and arm-ios.
On x86-win32, correctly prints 'true'.

public class TestDCMP {
  public static void main(String[] args) {
    System.out.println(test(0));
  }
  private static boolean test(double x) {
    return x < 1.0;
  }
}

Problem with System.out buffer on UTF-8 character output (avian 0.6)

The program:

public class Application
{
public static void main(String... args)
{
System.out.println("a");
System.out.println("b");
System.out.println("й"); // <--- This character produces the problem
System.out.println("c");
System.out.println("d");
}
}

creates the output:

a
b
й
й
c
й
c
d

which looks like the buffer never cleans after println tries to print a character "й" (which seems to be the UTF-8 representation of "й")

If we add System.out.flush() here:

public class Application
{
public static void main(String... args)
{
System.out.println("a");
System.out.println("b");
System.out.println("й");
System.out.println("c");
System.out.println("d");
System.out.flush();
}
}

the output changes! Now it looks like:

a
b
й
й
c
й
c
d
й
c
d

Each buffer repeats twice!

Improve usability of assert/abort

The current requirement to have a System instance in order to call abort on makes it very difficult to write "clean", modular utilities. Anything that could possibly want to assert needs to have either an Aborter (of which System is the only current implementation) or a System parameter. If we want to add an assert somewhere that we don't have one of those, we need to add such a parameter.

Let's make the choice of abort functionality a link-time option rather than a runtime option.

We make sure to include our abort function (which I've called "crash" in #171) in a separate .cpp file from most everything else. Anyone wanting to swap out the implementation can do so at compile time. We can even build a library that has that symbol undefined and expects the executable itself to define it.

The only thing we lose in that case is the context of which VM instance this abort is associated with - and that can be solved pretty simply with thread locals.

Guice dependency injection doesn't appear to work with Avian

I can't get Guice dependency injection to work with Avian using the OpenJDK7 classpath. I have put together a very short sample with instructions on how to reproduce here: https://github.com/csoren/avian-guice

In short, the example works with OpenJDK 7 but fails with Avian.

The result with Avian is
com/google/inject/CreationException
at com/google/inject/internal/Errors.throwCreationExceptionIfErrorsExist (line 435)
at com/google/inject/internal/InternalInjectorCreator.initializeStatically (line 154)
at com/google/inject/internal/InternalInjectorCreator.build (line 106)
at com/google/inject/Guice.createInjector (line 95)
at com/google/inject/Guice.createInjector (line 72)
at com/google/inject/Guice.createInjector (line 62)
at com/example/Main.main (line 36)

OpenJDK 7 produces the expected result: Hello, world!

WinRT in AOT mode

Do you have plans of supporting WinRT or WP8 in AOT mode?

Currently I'm trying to do that on my own, but unfortunately I'm completely lost in makefile, since it seems that when bootimage=true, libavian for target platform still compiles code that supports JIT. Is there any option to split AOT and JIT mode during compilation: e.g. completely ifdef-out JIT code when AOT is requested, or something like that.

arch=i386 mode=debug tests are broken

            ------- Unit tests -------
        RegisterIterator: success
          BasicAssembler: success
        ArchitecturePlan: success
               ArgParser: success

            ------- Java tests -------
               AllFloats: success
             Annotations: success
              ArraysTest: success
             AtomicTests: success
              BitsetTest: fail
                 Buffers: fail
                    Busy: success
             Collections: success
               Datagrams: success
                   Dates: success
             DefineClass: success
            DivideByZero: success
             EnumSetTest: fail
                   Enums: success
              Exceptions: success
              FileOutput: success
                   Files: success
              Finalizers: success
                  Floats: success
                      GC: success
                   Hello: success
            Initializers: success
                Integers: success
                     JNI: success
             LazyLoading: success
                    List: success
                 Logging: success
                   Longs: fail
       MessageFormatTest: success
                    Misc: success
             NullPointer: success
                 Observe: success
             OutOfMemory: success
               Processes: success
                 Proxies: success
              References: success
              Reflection: success
                   Regex: success
               Serialize: fail
                  Simple: success
           StackOverflow: success
                 Strings: success
              Subroutine: success
                  Switch: success
                 Threads: success
     TimeUnitConversions: success
                   Trace: success
                    Tree: success
              UnsafeTest: success
                 UrlTest: success
                     Zip: success
     ZipOutputStreamTest: success

see log.txt for output

All these tests segfault rather anonymously:

Program received signal SIGSEGV, Segmentation fault.
0x0000002b in ?? ()
(gdb) bt
#0  0x0000002b in ?? ()
#1  0x0028fac0 in ?? ()
Backtrace stopped: previous frame inner to this frame (corrupt stack?)

Regex test fails on OpenJDK and with Avian using the OpenJDK classpath

On OpenJDK, we see this:

$ java -cp build/linux-x86_64/test Regex
Exception in thread "main" java.util.regex.PatternSyntaxException: Look-behind group does not have an obvious maximum length near index 19
.(o)(?<=[A-Z][a-z])
^
at java.util.regex.Pattern.error(Pattern.java:1924)
at java.util.regex.Pattern.group0(Pattern.java:2812)
at java.util.regex.Pattern.sequence(Pattern.java:2018)
at java.util.regex.Pattern.expr(Pattern.java:1964)
at java.util.regex.Pattern.compile(Pattern.java:1665)
at java.util.regex.Pattern.(Pattern.java:1337)
at java.util.regex.Pattern.compile(Pattern.java:1022)
at Regex.getMatcher(Regex.java:10)
at Regex.expectGroups(Regex.java:23)
at Regex.main(Regex.java:73)

On Avian using the OpenJDK classpath, we see this:

$ ./build/linux-x86_64-openjdk/avian-dynamic -cp build/linux-x86_64-openjdk/test Regex
java/util/regex/PatternSyntaxException
at java/util/regex/Pattern.error (line 1924)
at java/util/regex/Pattern.group0 (line 2812)
at java/util/regex/Pattern.sequence (line 2018)
at java/util/regex/Pattern.expr (line 1964)
at java/util/regex/Pattern.compile (line 1665)
at java/util/regex/Pattern. (line 1337)
at java/util/regex/Pattern.compile (line 1022)
at Regex.getMatcher (line 10)
at Regex.expectGroups (line 23)
at Regex.main (line 73)

Serialize TreeMap test is broken on Android build

The test in Serialize.java, which serializes a java.util.TreeMap and then compares the result to a specific byte pattern, is too fragile because it assumes TreeMap will have a certain, fixed set of fields. It breaks when using Android's TreeMap, since that has several additional fields which must be serialized.

I humbly suggest we use a class specifically written for this purpose so we can control what fields it has and not make assumptions about the class library's implementation.

Pointer being freed was not allocated -- avian-dynamic & openjdk7 & OSX

I've recently been making Avian work for Clojure.
I went back to try another/fresh openjdk7 build, which completes, but I get:
error for object 0x28: pointer being freed was not allocated

when running:
./avian-dynamic -jar helloworldclj-0.1.0-SNAPSHOT-standalone.jar

... where the jar above is an uberjar of a simple helloworld application.
I did not previously see this happen with an early experiment I was running.

Please let me know what additional information you need.
OSX 10.7.5
2 Ghz Intel Core i7 with 8Gb Ram
java version: openjdk version "1.7.0-u40-b30" (fresh for this build)
Apple clang version 4.0 (tags/Apple/clang-421.0.60) (based on LLVM 3.1svn)
On the latest avian master
JAVA_HOME aliased to the fresh build ala:
JAVA_HOME=/Users/paul/scratch/avian/jdk1.7.0.jdk/Contents/Home/ make openjdk=/Users/paul/scratch/avian/jdk1.7.0.jdk/Contents/Home/

I'm more than happy to jump in the code and work through this issue with you.

Crash with OpenJDK 7 classpath and JNA

I have updated my JNA example project, it now demonstrates a new problem where Avian is hitting an assert.

The example can be found at https://github.com/csoren/avian-jna

The project demonstrates a problem with using JNA on Avian/OpenJDK 7 on Windows. I have used https://github.com/alexkasko/openjdk-unofficial-builds#openjdk-7-update-45-build-31-icedtea-243 as classpath

This example works with the OpenJDK 7 VM.

To reproduce:

mvn package
cd target
avian -jar avian-jna.jar

Observe the result: Crash!

The native callstack is

#0  0x00403770 in avian::system::crash () at src/system/windows/signal.cpp:269
#1  0x004032b4 in (anonymous namespace)::MySystem::abort (this=0x3f1eb0) at src/system/windows.cpp:942
#2  0x04327f19 in avian::util::abort<vm::Thread*> (t=0x3f5b94) at include/avian/util/abort.h:33
#3  0x043280e6 in avian::util::expect<vm::Thread*> (t=0x3f5b94, v=false) at include/avian/util/abort.h:40
#4  0x04328004 in avian::util::assert<vm::Thread*> (t=0x3f5b94, v=false) at include/avian/util/abort.h:49
#5  0x0431cfe8 in vm::byteArrayLength (t=0x3f5b94, o=0x0) at build/windows-i386-debug-openjdk-src/type-declarations.cpp:2943
#6  0x0431a8f1 in vm::byteArrayHash (t=0x3f5b94, array=0x0) at src/avian/machine.h:2325
#7  0x0042872d in vm::hashMapFindNode (t=0x3f5b94, map=0xb791fac, key=0x0, hash=0x431a8d8 <vm::byteArrayHash(vm::Thread*, vm::Object*)>, equal=0x431bb70 <vm::byteArrayEqual(vm::Thread*, vm::Object*, vm::Object*)>) at src/util.cpp:326
#8  0x0431879d in vm::hashMapFind (t=0x3f5b94, map=0xb791fac, key=0x0, hash=0x431a8d8 <vm::byteArrayHash(vm::Thread*, vm::Object*)>, equal=0x431bb70 <vm::byteArrayEqual(vm::Thread*, vm::Object*, vm::Object*)>) at src/avian/util.h:29
#9  0x004187d0 in vm::resolveSystemClass (t=0x3f5b94, loader=0xb791db0, spec=0x0, throw_=true, throwType=vm::Machine::NoClassDefFoundErrorType) at src/machine.cpp:4207
#10 0x00418e2b in vm::resolveClass (t=0x3f5b94, loader=0xb791db0, spec=0x0, throw_=true, throwType=vm::Machine::NoClassDefFoundErrorType) at src/machine.cpp:4324
#11 0x00458f58 in vm::getDeclaringClass (t=0x3f5b94, c=0xb7ccdf0) at src/avian/classpath-common.h:740
#12 0x00464056 in (anonymous namespace)::local::jvmGetDeclaringClass (t=0x3f5b94, arguments=0x28f6ac) at src/classpath-openjdk.cpp:4143
#13 0x004873b4 in vmRun ()
#14 0x043260d8 in vm::runRaw (t=0x3f5b94, function=0x464029 <(anonymous namespace)::local::jvmGetDeclaringClass(vm::Thread*, uintptr_t*)>, arguments=0x28f6ac) at src/avian/machine.h:1914
#15 0x04324894 in vm::run (t=0x3f5b94, function=0x464029 <(anonymous namespace)::local::jvmGetDeclaringClass(vm::Thread*, uintptr_t*)>, arguments=0x28f6ac) at src/avian/machine.h:1921
#16 0x00464092 in JVM_GetDeclaringClass@8 (t=0x3f5b94, c=0x28f870) at src/classpath-openjdk.cpp:4151
#17 0x00487342 in vmNativeCall ()
#18 0x04318626 in vm::dynamicCall (function=0x46406c <JVM_GetDeclaringClass@8>, arguments=0x28f718, argumentsSize=8, returnType=7) at src/avian/x86.h:97
#19 0x00446a47 in (anonymous namespace)::local::invokeNativeSlow (t=0x3f5b94, method=0xb59788c, function=0x46406c <JVM_GetDeclaringClass@8>) at src/compile.cpp:7439
#20 0x00446cbe in (anonymous namespace)::local::invokeNative2 (t=0x3f5b94, method=0xb59788c) at src/compile.cpp:7511
#21 0x00446e27 in (anonymous namespace)::local::invokeNative (t=0x3f5b94) at src/compile.cpp:7543
#22 0x07d60051 in ?? ()

It seems to start going wrong when #10 vm::resolveClass receives 0 in the spec parameter.

VM callstack is:

debug trace for thread 003F5B94
  at java/lang/Class.getDeclaringClass0 (native)
  at java/lang/Class.getDeclaringClass (line 1101)
  at com/sun/jna/Native.findEnclosingLibraryClass (line 471)
  at com/sun/jna/Native.getLibraryOptions (line 496)
  at com/sun/jna/Native.getTypeMapper (line 562)
  at com/sun/jna/CallbackReference.<init> (line 147)
  at com/sun/jna/CallbackReference.getFunctionPointer (line 399)
  at com/sun/jna/CallbackReference.getFunctionPointer (line 381)
  at com/sun/jna/Pointer.setValue (line 960)
  at com/sun/jna/Structure.writeField (line 784)
  at com/sun/jna/Structure.write (line 702)
  at com/example/Main.run (line 32)
  at com/example/Main.main (line 37)

java/util/Collections$UnmodifiableMap.values makes wrong assumptions about underlying map

$ cat ex/Test.java
import java.util.Collections;

public class Test {
    public static void main(String[] args) {
        Collections.unmodifiableMap(Collections.<String, String>emptyMap()).values();
    }
}
$ build/linux-x86_64/avian -cp ex Test
java/lang/ClassCastException: java.util.HashMap$Values cannot be cast to java.util.Set
  at java/util/Collections$UnmodifiableMap.values (line 474)
  at java/util/Collections$UnmodifiableMap.values (line 474)
  at Test.main (line 5)

Avian's File.mkdir() implementation uses 700 permissions, while openJDK uses 777

In investigating an internal issue, @joshuawarner32 and I noticed that the Avian implementation of File.mkdir() calls mkdir with permissions 700, whereas the openJDK uses 777.

Avian:

extern "C" JNIEXPORT void JNICALL
Java_java_io_File_mkdir(JNIEnv* e, jclass, jstring path)
{
  string_t chars = getChars(e, path);
  if (chars) {
    if (not exists(chars)) {
      int r = ::MKDIR(chars, 0700);
      if (r != 0) {
        throwNewErrno(e, "java/io/IOException");
      }
    }
    releaseChars(e, path, chars);
  }
}

OpenJDK:

JNIEXPORT jboolean JNICALL
Java_java_io_UnixFileSystem_createDirectory(JNIEnv *env, jobject this,
                                            jobject file)
{
    jboolean rv = JNI_FALSE;

    WITH_FIELD_PLATFORM_STRING(env, file, ids.path, path) {
        if (mkdir(path, 0777) == 0) {
            rv = JNI_TRUE;
        }
    } END_PLATFORM_STRING(env, path);
    return rv;
}

Though this wasn't causing the issue I was originally investigating, I think it might be worth a conversation about whether or not we want to match the OpenJDK with regards to the permissions we create directories with.

For what it's worth, 700 seems pretty reasonable to me. 777 is a bit "fast-and-loose", but it's possible that this could cause some strange issues if we don't match the behavior.

Performance

Getting back to my previous question: is it truly possible that application under avian in AOT mode works much slower than under OpenJDK? Or maybe it's just me doing something wrong?

Can't find class under Windows

I managed to build Avian with the Android classpath on Windows x86_64 (using mingw-w64), but now I have a strange problem.

If I run such code:

jclass c = e->FindClass("packagename/ClassName");
if (e->ExceptionCheck())
{
    exitCode = -1;
    e->ExceptionDescribe();
}

I get an error report:

java/lang/NoClassDefFoundError: packagename/ClassName

Everything's linked correctly with all jar files (I use static linkage everywhere and build a single executable embedding everything).

This code works like a charm on OS X. And it worked well everywhere with Avian default classpath. I have no idea about how the changing of classpath libraries could influence VM core behavior.

I used some small hacks and tricks to build Android classpath on Windows, for example I changed the definition for jchar from unsigned short to wchar_t (I hope they are the same on Windows) in order to avoid many conversion errors.

I understand that there is too few information, but I just don't know where to find the bug. Debugging everything (including android classpath C++ sources) looks a bit scary.

Delegate Java portions of the build process to Gradle

I'd like to see Gradle take control over the pure Java build portions of this project's build infrastructure in order to reap signifcant benefits in code quality and structure flexibility.

Specifically:

  • Let's move the home-built unit tests to JUnit or TestNG and kick them off with Gradle instead of make. Framework familiarity and ease of integration/addition of more tests is key to having confidence in the quality of Avian's deliverables.

Thread.join() hangs with Android classpath

public class ThreadTest {
    public static void main(String[] args) {
        Thread thread = new Thread(new Runnable() {
            @Override
            public void run() {

            }
        });

        thread.start();
        try {
            thread.join();
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }
}

This simple class makes Avian hang under OS X if it's built with Android classpath.

Actually, I found this bug while porting Android classpath to Windows, so firstly it was discovered under Windows. But it looks like this problem is cross platform.

Please implement Unsafe.getObjectVolatile

I am trying to implement some of java.util.concurrent.locks. In order to do that I need Unsafe.getObjectVolatile to be implemented. That is the only function I saw that I needed to fully implement java.util.concurrent.locks.LockSupport (and thus I think I can do the rest of the locks after that).

How to list loaded classes?

In the case of advanced reflection usage, one of the most common tasks is searching for a class, which implements an interface, extends other class or contains a specific attribute.

In Oracle JVM there is a hack which (as far as I know) is exploited with almostly all such programs - ClassLoader contains "classes" hidden variable inside which is a list of all loaded classes. You should just open it and list them.

How to achieve the same goal in Avian using it's default library?

I accept any solution either via Java or JNI. Just tell me how to do it.

local::getFinder missing for openjdk-src build

When compiling an openjdk-src build for Windows I get the following error:

compiling build/windows-i386-small-openjdk-src/classpath-openjdk.o
src/classpath-openjdk.cpp: In function 'int64_t Avian_java_util_TimeZone_getSystemTimeZoneID(vm::Thread*, vm::object, uintptr_t*)':
src/classpath-openjdk.cpp:5592:20: error: 'getFinder' is not a member of '{anonymous}::local'
src/classpath-openjdk.cpp:5592:20: note: suggested alternatives:
In file included from src/classpath-openjdk.cpp:12:0:
src/avian/classpath-common.h:621:1: note:   'vm::getFinder'
src/avian/classpath-common.h:621:1: note:   'vm::getFinder'
In file included from src/avian/bootimage.h:63:0,
                 from src/avian/processor.h:17,
                 from src/avian/machine.h:19,
                 from src/classpath-openjdk.cpp:11:
src/bootimage-template.cpp: At global scope:
src/bootimage-template.cpp:6:1: error: 'vm::TargetBootFlatConstant' defined but not used [-Werror=unused-variable]
src/bootimage-template.cpp:7:1: error: 'vm::TargetBootHeapOffset' defined but not used [-Werror=unused-variable]
In file included from src/avian/bootimage.h:69:0,
                 from src/avian/processor.h:17,
                 from src/avian/machine.h:19,
                 from src/classpath-openjdk.cpp:11:
src/bootimage-template.cpp:6:16: error: 'vm::BootFlatConstant' defined but not used [-Werror=unused-variable]
src/bootimage-template.cpp:7:16: error: 'vm::BootHeapOffset' defined but not used [-Werror=unused-variable]
cc1plus.exe: all warnings being treated as errors
make: *** [build/windows-i386-small-openjdk-src/classpath-openjdk.o] Error 1

Error to start an embedded tomcat 7 server.

I got this when I try to start an embedded tomcat 7 server using avian:

D:\.techs\launch4j\target>avian -jar xxx.jar
java/lang/NoClassDefFoundError: javax/management/MBeanRegistration
  at org/apache/catalina/startup/Tomcat.getHost (line 435)
  at org/apache/catalina/startup/Tomcat.addWebapp (line 201)
  at com/xxx/xxx/desktop/Bootstrapper.main (line 20)

test/Reflection.java compilation errors

Make output:

compiling test classes
test/Reflection.java:147: set(java.lang.Object,long) has private access in java.lang.reflect.Field
      Reflection.class.getDeclaredField("egads").set(r, 42);
                                                ^
test/Reflection.java:148: inconvertible types
found   : java.lang.Object
required: int
      expect(((int) Reflection.class.getDeclaredField("egads").get(r)) == 42);
                                                                  ^
test/Reflection.java:213: set(java.lang.Object,long) has private access in java.lang.reflect.Field
      Foo.class.getField("foo").set(null, 42);
                               ^
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
3 errors
make: *** [build/linux-x86_64/test.dep] Error 1

My system is Ubuntu linux 13.10 x86-64
JDK version is 1.6.0_45

<Not an issue, just a propose> Adding some classes from the abandoned Apache Harmony project.

Hi! As far as I know, the weakest point of Avian at the moment is its poor and incomplete class library.

Recently I was attempting to improve it a bit (I was adding ServerSocket implementation and some other stuff) and found that a very hard work. Eventually I found out that there is a free and open source (but not GPL-ed) implementation of Java basic classpath containing java.net, java.text and all other pretty good old tested classes. I'm talking about the Apache Harmony project.

It's abandoned now and licensed under Apache v2 license. I took a look at its source code and found it pretty simple to understand.

I want to ask for a permission to grab some code from this source, adapt it for Avian and contribute here. The only disadvantage for you is a need to include some notices about the licensed files (http://www.apache.org/licenses/). As far as I understand, Apache License v2 doesn't restrict developers and end-users in any way excepting that.

If you accept my Idea, at first I'm going to take java.net package from AH and put it here instead of my homemade poor implementation.

As for me it's a better option than using of the OpenJDK classpath...

Problem with string constant encoding in Avian

As far as I understand, Avian converts strings into UTF-8. That leads to some problems. Let me show:

public static void main(String[] args)
{
    System.out.println("Hello! Привет!");
}

The file is encoded in Codepage 866 (old cyrillic Russian encoding, used in Windows console).

Oracle JVM output in console:

Hello! Привет!

Avian output in console:

Hello! ╨П╨░╨Б╤Ю╥Р╨▓!

I thing the root cause is that the Oracle JVM takes string constants AS IS and just puts it into output, while Avian converts all constants from the current system encoding into UTF-8. This behaviour leads to a mess.

Let me show it: let's encode our source file in Windows-1251 (default Windows Cyrillic codepage) and run again.

Oracle JVM output in console:

Hello! ╧ЁштхЄ!

That strange output is correct! We loaded string from a file with Cp1251 and written it into Cp866 (console encoding). This is a default Russian Windows developers curse. We use two different encodings for Win32 UI and for console windows.

Avian output in console:

Hello! ╨Я╤А╨╕╨▓╨╡╤В!

Here we see a different result. What's this? We could answer easily. Let's change console window codepage to UTF-8

>chcp 65001

After that Avian output would be:

Hello! Привет!

If we change console encoding to Cp1251 with

>chcp 1251

Oracle JVM output would be correct:

Hello! Привет!

So just as I said before, Oracle JVM just copies text as is, but Avian converts it from Cp1251 to UTF-8.

Could you change this behavior to improve compatibility between VMs?

And, in addition, Avian default classpath doesn't support a simple way to change the I/O encoding. No methods that are recommended here: http://stackoverflow.com/questions/2415597/java-how-to-detect-and-change-encoding-of-system-console work for Avian.

  1. There is no System.console() by default
  2. You can't write PrintStream out = new PrintStream(System.out, true, "UTF-8"); cause there is no such constructor for PrintStream.
  3. As far as I see, Avian doesn't support -Dfile.encoding (maybe I'm wrong)

If you could implement encoding conversion for PrintStream, that would be a great present...

Avian can't use more than ~2GB of heap space

We're using 32-bit integers (signed in some cases) all over heap.cpp to represent sizes, so we overflow when we get close to 2^31. We should replace these fields and variables with 64-bit integers.

VM deadlock on iOS

Deadlock happens with following Hello.java only on arm-ios-avianclasslib and arm-ios-libcore64.
There is no problem on arm-android, x64-osx and x86-linux.

public class Hello {
  public Hello(long peer) throws Exception {
      final int[] counter = new int[2];
      new Thread() {
          @Override
          public void run() {
              while (true) { // frequent monitorenter/exit
                  synchronized (this) {
                      counter[0]++;
                  }
              }
          }
      }.start();
      new Thread() {
          @Override
          public void run() {
              while (true) { // frequent class metadata search
                  try {
                      Class.forName("java.lang.Object");
                  } catch (ClassNotFoundException e) {
                      e.printStackTrace();
                  }
                  synchronized (this) {
                      counter[1]++;
                  }
              }
          }
      }.start();
      new Thread() {
          @Override
          public void run() {
              while (true) { // watchdog
                  System.err.println(counter[0] + " / " + counter[1]);
                  try {
                      Thread.sleep(1000);
                  } catch (InterruptedException e) {
                      e.printStackTrace();
                  }
              }
          }
      }.start();
  }

  public void draw(int x, int y, int width, int height) {
  }

  public void dispose() {
  }
}

Files test fails with latest openjdk 7

The files test fails thusly:

java/lang/UnsatisfiedLinkError: java/io/FileInputStream.read()I
at java/io/FileInputStream.read (native)
at java/io/FileInputStream.read (native)
at Files.main (line 64)

Note that this was originally discussed in #74

org.eclipse.swt.SWTException: Invalid thread access

I got this exception accidentally and can't understand, why. It's on OS X. Could you help me and tell, how could I make Avian run main() in the first app thread? Does it support -XrunOnFirstThread option?

Error occured when compile avian using cygwin 1.7 on Win 7 sp1

Edison@admin-PC /local/src/avian
$ export JAVA_HOME="/cygdrive/c/Program Files/Java/jdk1.6.0_45"

Edison@admin-PC /local/src/avian
$ make
compiling build/windows-i386/tools/type-generator/main-build.o
src/tools/type-generator/main.cpp:11:20: fatal error: stdlib.h: No such file or                  directory
compilation terminated.
makefile:1717: recipe for target `build/windows-i386/tools/type-generator/main-b                 uild.o' failed
make: *** [build/windows-i386/tools/type-generator/main-build.o] Error 1

Edison@admin-PC /local/src/avian
$ apt-cyg show
The following packages are installed:
_autorebase
_update-info-dir
alternatives
base-cygwin
base-files
bash
bzip2
coreutils
cygutils
cygwin
dash
diffutils
dos2unix
editrights
file
findutils
gawk
gcc-mingw-g++
gettext
grep
groff
gzip
ipc-utils
less
libattr1
libbz2_1
libffi6
libgcc1
libgcrypt11
libgmp10
libgmp3
libgnutls26
libgpg-error0
libiconv2
libidn11
libintl8
liblzma5
liblzo2_2
libmpc3
libmpfr4
libncurses10
libncursesw10
libp11-kit0
libpcre0
libpopt0
libreadline7
libstdc++6
libtasn1_3
login
make
man
mingw-binutils
mingw-gcc-core
mingw-gcc-g++
mingw-pthreads
mingw-runtime
mingw-w32api
mingw64-i686-binutils
mingw64-i686-gcc-core
mingw64-i686-gcc-g++
mingw64-i686-runtime
mingw64-i686-winpthreads
mingw64-x86_64-binutils
mingw64-x86_64-gcc-core
mingw64-x86_64-gcc-g++
mingw64-x86_64-runtime
mingw64-x86_64-winpthreads
mintty
rebase
run
sed
tar
terminfo
texinfo
tzcode
vim-minimal
wget
which
xz
zlib0

openjdk-src problems on osx 10.9

After getting past sever build problems (pull request to come), I'm running into a very strange problem with the openjdk-src build on osx 10.9. When initializing avian (very early in the startup process), osx prompts me to install Java, which it clearly shouldn't be doing. Here's the stack trace:

#0  0x00007fff8318fadb in exit ()
#1  0x00000001077cc76c in CheckForInstalledJavaRuntimes ()
#2  0x00007fff5fc11c2e in __dyld__ZN16ImageLoaderMachO18doModInitFunctionsERKN11ImageLoader11LinkContextE ()
#3  0x00007fff5fc11dba in __dyld__ZN16ImageLoaderMachO16doInitializationERKN11ImageLoader11LinkContextE ()
#4  0x00007fff5fc0ea62 in __dyld__ZN11ImageLoader23recursiveInitializationERKNS_11LinkContextEjRNS_21InitializerTimingListE ()
#5  0x00007fff5fc0e9eb in __dyld__ZN11ImageLoader23recursiveInitializationERKNS_11LinkContextEjRNS_21InitializerTimingListE ()
#6  0x00007fff5fc0e9eb in __dyld__ZN11ImageLoader23recursiveInitializationERKNS_11LinkContextEjRNS_21InitializerTimingListE ()
#7  0x00007fff5fc0e8f6 in __dyld__ZN11ImageLoader15runInitializersERKNS_11LinkContextERNS_21InitializerTimingListE ()
#8  0x00007fff5fc04b0e in __dyld__ZN4dyld15runInitializersEP11ImageLoader ()
#9  0x00007fff5fc0b7cf in __dyld_dlopen ()
#10 0x00007fff844257ef in dlopen ()
#11 0x000000010011c9b6 in getJRSFramework () at build/darwin-x86_64-debug-openjdk-src/openjdk/java_props_macosx.c:42
#12 0x000000010011bb81 in setOSNameAndVersion (sprops=0x104374260) at build/darwin-x86_64-debug-openjdk-src/openjdk/java_props_macosx.c:135
#13 0x0000000100100579 in GetJavaProperties (env=0x105002208) at build/darwin-x86_64-debug-openjdk-src/openjdk/java_props_md.c:459
#14 0x00000001000e0391 in Java_java_lang_System_initProperties (env=0x105002208, cla=0x7fff5fbfeb48, props=0x7fff5fbfec80) at build/darwin-x86_64-debug-openjdk-src/openjdk/System.c:172
#15 0x00000001000ca33e in .Lcall () at allocator.h:18
#16 0x0000000100004599 in vm::dynamicCall (function=0x1000e0360, arguments=0x7fff5fbfe9d0, argumentTypes=0x7fff5fbfe9c0 "\a\a\a\001\001", argumentCount=3, returnType=7) at x86.h:195
#17 0x0000000100001d02 in (anonymous namespace)::MySystem::call (this=0x104600000, function=0x1000e0360, arguments=0x7fff5fbfe9d0, types=0x7fff5fbfe9c0 "\a\a\a\001\001", count=3, size=24, returnType=7) at src/vm/system/posix.cpp:782
#18 0x000000010007a16b in (anonymous namespace)::local::invokeNativeSlow (t=0x105002208, method=0x1048a56e8, function=0x1000e0360) at src/compile.cpp:7774
#19 0x0000000100079a63 in (anonymous namespace)::local::invokeNative2 (t=0x105002208, method=0x1048a56e8) at src/compile.cpp:7852
#20 0x000000010004945d in (anonymous namespace)::local::invokeNative (t=0x105002208) at src/compile.cpp:7884
#21 0x000000010580007b in ?? ()
#22 0x0000000100074aa4 in (anonymous namespace)::local::invoke (thread=0x105002208, method=0x1048a65f0, arguments=0x7fff5fbfef18) at src/compile.cpp:8669
#23 0x000000010004d6cc in (anonymous namespace)::local::MyProcessor::invokeList (this=0x104600a08, t=0x105002208, loader=0x105002cf0, className=0x104368a92 "java/lang/System", methodName=0x104368bd5 "initializeSystemClass", methodSpec=0x10436734f "()V", this_=0x0, arguments=0x7fff5fbff190) at src/compile.cpp:9202
#24 0x000000010009499c in vm::Processor::invoke (this=0x104600a08, t=0x105002208, loader=0x105002cf0, className=0x104368a92 "java/lang/System", methodName=0x104368bd5 "initializeSystemClass", methodSpec=0x10436734f "()V", this_=0x0) at processor.h:202
#25 0x000000010008dd9e in (anonymous namespace)::local::MyClasspath::boot (this=0x1046003f8, t=0x105002208) at src/classpath-openjdk.cpp:769
#26 0x00000001000a1a4a in (anonymous namespace)::local::boot (t=0x105002208) at src/jnienv.cpp:3549
#27 0x00000001000ca3af in vmRun () at allocator.h:18
#28 0x0000000100030fb8 in vm::runRaw (t=0x105002208, function=0x1000a17d0 <(anonymous namespace)::local::boot(vm::Thread*, unsigned long*)>, arguments=0x0) at machine.h:1950
#29 0x000000010002feac in vm::run (t=0x105002208, function=0x1000a17d0 <(anonymous namespace)::local::boot(vm::Thread*, unsigned long*)>, arguments=0x0) at machine.h:1957
#30 0x00000001000a153d in JNI_CreateJavaVM (m=0x7fff5fbff9b0, t=0x7fff5fbff9a8, args=0x7fff5fbffa00) at src/jnienv.cpp:3944
#31 0x000000010011e49e in main (ac=4, av=0x7fff5fbffa58) at src/main.cpp:259

Looking at getJRSFramework, I don't see how this could ever not have been the case:

static void *getJRSFramework() {
    static void *jrsFwk = NULL;
    if (jrsFwk == NULL) {
       jrsFwk = dlopen("/System/Library/Frameworks/JavaVM.framework/Frameworks/JavaRuntimeSupport.framework/JavaRuntimeSupport", RTLD_LAZY | RTLD_LOCAL);
    }
    return jrsFwk;
}

0.7 macos build with openjdk claims test failures (misc/datagrams)

I'm getting test errors when I try to build avain v0.7 for macos (10.8.4):

            ------- Java tests -------
               AllFloats: success
             Annotations: success
                  Arrays: success
              BitsetTest: success
                 Buffers: success
               Datagrams: fail
             DefineClass: success
            DivideByZero: success
             EnumSetTest: success
                   Enums: success
              Exceptions: success
              FileOutput: success
                   Files: success
              Finalizers: success
                  Floats: success
                      GC: success
                   Hello: success
            Initializers: success
                Integers: success
                     JNI: success
             LazyLoading: success
                    List: success
                 Logging: success
                   Longs: success
                    Misc: fail
             NullPointer: success
             OutOfMemory: success
               Processes: success
                 Proxies: success
              References: success
              Reflection: success
                  Simple: success
           StackOverflow: success
                 Strings: success
              Subroutine: success
                  Switch: success
                 Threads: success
                   Trace: success
                    Tree: success
              UnsafeTest: success
                 UrlTest: success
                     Zip: success

see log.txt for output
make: *** [test] Error 255

JAVA_HOME is:

JAVA_HOME=/Users/swade/compile/openjdk/build/macosx-x86_64/j2sdk-image

Running make like this:

make openjdk="$(pwd)/../openjdk/build/macosx-x86_64/j2sdk-image" openjdk-src="$(pwd)/../openjdk/jdk/src" test

Is this expected?

JNI NewString crashes when char length is zero

The following code will crash in Avian:

jstring javaStr = (*jni)->NewString(jni, (jchar *)buffer, 0);

This patch will fix it:

diff --git a/VM/avian/jnienv.cpp b/VM/avian/jnienv.cpp
index 9e1d7e9..52da955 100644
--- a/VM/avian/jnienv.cpp
+++ b/VM/avian/jnienv.cpp
@@ -241,9 +241,8 @@ newString(Thread* t, uintptr_t* arguments)
   const jchar* chars = reinterpret_cast<const jchar*>(arguments[0]);
   jsize size = arguments[1];

-  object a = 0;
+  object a = makeCharArray(t, size);
   if (size) {
-    a = makeCharArray(t, size);
     memcpy(&charArrayBody(t, a, 0), chars, size * sizeof(jchar));
   }

Does not compile with newer versions of clang and gcc

Compiling avian with newer compilers results in a bunch of error messages
such as:

raichoo@lain avian» make use-clang=true
compiling build/linux-x86_64/tools/type-generator/main-build.o
In file included from src/tools/type-generator/main.cpp:11:
/usr/include/stdlib.h:139:8: error: unknown type name 'size_t'
extern size_t __ctype_get_mb_cur_max (void) __THROW __wur;

I'm under a current version of arch linux. Compiler versions are:

clang version 3.2 (tags/RELEASE_32/final)
Target: x86_64-unknown-linux-gnu
Thread model: posix

and

g++ (GCC) 4.8.0 20130411 (prerelease)
Copyright (C) 2013 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Both compilers result in the same error messages.

Kind regards

Running helloworld.rb using JRuby on Avian: ExceptionInInitializerError

Using
Ubuntu 12.04x86
jruby 1.5.6

log:
"root@sdkie:/home/sdkie/Desktop/# jruby hello.rb
java/lang/ExceptionInInitializerError
at org/jruby/Main.main (line 89)
caused by: java/lang/NoSuchMethodError: format (Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String; not found in java/lang/String
at org/jruby/platform/Platform. (line 105)
at org/jruby/Main.main (line 89)"

busy wait can block entire VM

In order for a thread to enter the "exclusive" state such that no other threads are active in the VM, it must wait for all active threads to enter the "idle" state. In order for this to happen in a timely manner, threads must check frequently to see if a thread is waiting to enter the exclusive state. These checks happen at every memory allocation, wait, sleep, native call, etc. However, if a thread is in a busy loop that does none of those things, it will block any other thread from entering that state and eventually cause all other threads to block.

The proper way to address this is to detect such loops (or tail recursion in tail-call-optimized builds) at compile or interpret time and insert explicit checks.

See also 5d3dc70

git repo is way too big

The git repo now weighs in at over 100MB, even though the master working copy is only 4.9MB. That's ridiculous.

I propose we do the following:

  • move obsolete branches to forks (e.g. move the invokeinterface branch to dicej/avian, since it will probably never be merged, but I want to preserve it for later reference)
  • remove gh-pages and figure out a different way to store the website outside the repo without breaking it like we did last time we tried
  • rewrite history to delete accidentally-checked in binaries, e.g. http://www.rallydev.com/community/engineering/shrinking-git-repository-move-githubcom

Fixed buffer size in MyClasspath can crash when JAVA_HOME is in a long path

The buffer size in classpath-openjdk.cpp for JVM arguments is 1024, which can cause a crash when JAVA_HOME is in a really deep path:

15:14 avian$ avian/build/darwin-x86_64-interpret-openjdk-src/avian -Djava.home=/tmp/java_home_folder_path_long_enough_to_overflow_the_avian_openjdk_classpath_buffer_size foobar

java/lang/NoClassDefFoundError: foobar

15:14 avian$ avian/build/darwin-x86_64-interpret-openjdk-src/avian -Djava.home=/tmp/java_home_folder_path_long_enough_to_overflow_the_avian_openjdk_classpath_buffer_size_needs_to_be_really_really_long foobar

Abort trap: 6

The offending code is the BufferSize here:

class MyClasspath : public Classpath {
 public:
  static const unsigned BufferSize = 1024;

  MyClasspath(System* s, Allocator* allocator, const char* javaHome,
              const char* embedPrefix):
    allocator(allocator), ranNetOnLoad(0), ranManagementOnLoad(0)
  {

The buffer should be dynamic, but if needs to be a fixed size, we should at least fail gracefully if it is overflowed.

Investigate moving to Drone.io

It looks like drone.io, being based on docker, might offer some significant advantages over travis ci. In particular, we could add windows, 32-bit linux, arm and powerpc cross-compiler toolchains to the docker images. We might even be able to boot a powerpc/arm qemu machine inside the container to run tests on. Also, it's open-source.

See: http://blog.drone.io/2014/2/5/open-source-ci-docker.html

Lower overhead of safe points

Currently, we add calls to idleIfNecessary on every backwards branch so that no thread can run indefinitely without yielding control (at a safe point) to the VM, mostly in order to perform a GC cycle. This likely has a moderate overhead (unmeasured, as of yet), and we should try to reduce that.

Instead of generating a call, we could (for instance) issue a store to a fixed address at possible pause points in the generated code. The VM then controls the protection status of the memory (writable or not), and catches the signal. When a thread in the VM wants to enter the exclusive state, it simply changes the permissions on the page from writable to read-only, and waits for all threads to get the signal. When the original thread wants to release the exclusive state, it makes the page writable again, and resumes each of the threads.

Compiling with clang: src/arm.S:59:3: error: invalid instruction

Everything seems to compile fine in Avian if you use clang on Mac OS 10.8.2 instead of gcc, with the exception of arm.S, which gives the one error:

09:29 avian$ clang -x assembler-with-cpp -arch armv7 -Isrc -DTARGET_BYTES_PER_WORD=4 -arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.0.sdk/ -c src/arm.S -o build/darwin-arm-interpret-openjdk-src/arm-asm.o
src/arm.S:59:3: error: invalid instruction
  ldmneia r6, {r0-r3}
  ^

Looking at per-gron/silk-arm-ios#1 , it seems that some of the instructions need to be massaged for clang. The following preprocessor hack ("-Dldmneia=ldmiane") makes it compile successfully, so maybe it can be worked into the arm.S with an "#ifdef clang":

clang -Dldmneia=ldmiane -x assembler-with-cpp -arch armv7 -Isrc -DTARGET_BYTES_PER_WORD=4 -arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.0.sdk/ -c src/arm.S -o build/darwin-arm-interpret-openjdk-src/arm-asm.o

Reorganize Android build process

It would be nice to organize the Android build of Avian so it can plug directly into a checked-out Android tree. This makes it convenient for users with a checked-out Android tree, but is should also make it easier for people that don't have an Android tree.

It can use a smaller repo manifest (e.g., "repo init -u http://...") to avoid the long setup instructions.

Specify formatting style for C++ code

We should choose a consistent formatting style for C++.

Desirable characteristics (from my perspective):

  • Tool driven, with checked-in specification
  • Not tied to any particular editor
  • Not too different from exiting style
    • However, I'm personally not a big fan of the parens-on-the-next-line style
    • If possible, I'd prefer to go with an existing, built-in style that's close, rather than a highly-customized style spec that's a little closer.

I propose clang-format, which has a variety of built-in styles, is moderately customizable, can format small sub-sections of files and has plugins for a variety of editors (emacs, sublime text, ... (and a very simple command-line interface if there's not already a plugin)). Most importantly, from my perspective, it's much smarter about where to place line breaks than most (all?) other tools I've used; it uses a LATEX-style line-break optimization algorithm.

I'm of course open to other suggestions.

Also, to be clear, I'm not suggesting a bulk reformat of existing code (yet) - just a consistent format to use for new code.

Exception with JNA on Avian/OpenJDK7

JNA structures with Avian using the OpenJDK 7 classpath throws an exception under certain conditions. I have created a tiny test case that works with straight OpenJDK 7, but fails with Avian using OpenJDK 7 classpath.

It seems that com.sun.jna.Structure is unable to read fields that are defined in a subclass, when the subclass is protected.

https://github.com/csoren/avian-jna

The code is

public class Main {

    protected static class MyStructure extends Structure {

        public int myField = 42;

        @Override
        protected List getFieldOrder() {
            return Arrays.asList("myField");
        }
    }

    public static void main(String[] args) {
        Structure s = new MyStructure();
        s.write();
        System.out.println("Yay, no exceptions");
    }
}

which will throw this exception:

java/lang/Error: Exception reading field 'myField' in class com.example.Main$MyStructure: java.lang.IllegalAccessException: Class com.sun.jna.Structure can not access a member of class com.example.Main$MyStructure with modifiers "public"
  at com/sun/jna/Structure.getFieldValue (line 562)
  at com/sun/jna/Structure.deriveLayout (line 1095)
  at com/sun/jna/Structure.calculateSize (line 966)
  at com/sun/jna/Structure.calculateSize (line 933)
  at com/sun/jna/Structure.allocateMemory (line 360)
  at com/sun/jna/Structure.<init> (line 184)
  at com/sun/jna/Structure.<init> (line 172)
  at com/sun/jna/Structure.<init> (line 159)
  at com/sun/jna/Structure.<init> (line 151)
  at com/example/Main$MyStructure.<init> (line 10)
  at com/example/Main.main (line 21)```

If the MyStructure class is changed to public, the problem goes away.

I don't know if this is related to issue #185. I have applied the patch that supposedly fixed #185, the problem persists.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.