linux: adjust gettid visibility

gettid is currently available as a C++ symbol. This is because it usually does
not appear in standard libc headers. A lot of its callers go through the
syscall() path. But for us, since it is a global symbol, better have C linkage
than C++.

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
java: exclude '.' from default system class loader's class path

If java.class.path is not set the JVM is using '.' by default. This is
causing problems if some of the classes will be put in the root
directory and isolated context will have '.' as part of its class
path.

Let's consider the following command which will start a new isolated
context with classpath consisting of '.' and 'some.jar':

  java.so -cp .:some.jar Main

Suppose that the definition of Main looks like this:

  class Main extends SuperMain {
  }

The SuperMain class definition is in some.jar and Main is defined in
'./Main.class'. When 'Main' class is looked up the parent class
loaders are queried first. Because '.' is on the default system class
loader's class path, that class loader will become a defining class
loader for Main. However, it will not be able to locate the definition
of SuperMain class and loading will fail with
java.lang.NoClassDefFoundError.

To prevent this, we must ensure that the default system class loader
created by the JVM will not "catch" any user classes, which may be
specified on context's class path. Setting "java.lang.classpath" to
/dev/null achieves that goal.

Alternative solution would be to not put the default system class
loader as parent class loader for our app class loader. However the
former one is putting extensions jars on its class path and we need
them to be accessible from isolated constext.

Signed-off-by: Tomasz Grabiec <tgrabiec@cloudius-systems.com>
Signed-off-by: Avi Kivity <avi@cloudius-systems.com>
tests: add test exploiting class path issue

This tests that classes put on '.' are not loaded via global
default system class loader.

Signed-off-by: Tomasz Grabiec <tgrabiec@cloudius-systems.com>
Signed-off-by: Avi Kivity <avi@cloudius-systems.com>
aarch64: handle more page fault cases

we need to handle access faults and permission faults
as well as translation faults, and not only for data
aborts but also for instruction aborts.

Signed-off-by: Claudio Fontana <claudio.fontana@huawei.com>
Cc: Jani Kokkonen <jani.kokkonen@huawei.com>
Signed-off-by: Avi Kivity <avi@cloudius-systems.com>
libc: add finite(), finitef(), finitel()

Signed-off-by: KANATSU Minoru <icc.pot.tyew272@gmail.com>
Signed-off-by: Avi Kivity <avi@cloudius-systems.com>
libc: use weak_alias(); instead of declare eaccess()

Signed-off-by: KANATSU Minoru <icc.pot.tyew272@gmail.com>
Signed-off-by: Avi Kivity <avi@cloudius-systems.com>
modules: make run_java() interface more convenient

All of the following uses are now allowed and equivalent:

  api.run_java(args=['-cp', 'jar1:jar2', 'MainClass'])

  api.run_java(args='-cp jar1:jar2 MainClass')

  api.run_java('-cp jar1:jar2 MainClass')

Signed-off-by: Tomasz Grabiec <tgrabiec@cloudius-systems.com>
Signed-off-by: Avi Kivity <avi@cloudius-systems.com>
tests: Fix misc-readbench

Use stat to follow symbolic links, and get the correct file type.
misc-readbench is supposed to go through jvm directory which now
contains symbolic links.

Signed-off-by: Raphael S. Carvalho <raphaelsc@cloudius-systems.com>
Signed-off-by: Avi Kivity <avi@cloudius-systems.com>
Merge branch 'master' of https://github.com/cloudius-systems/osv