- Jan 02, 2014
-
-
Tomasz Grabiec authored
Currently we just call poweroff() which does not umount file systems which leads to data loss on next boot. This happens for example if you start the CLI and type exit. On next boot you will get: TX_CREATE TX_CREATE Solaris: WARNING: ZFS replay transaction error 95, dataset osv/zfs, seq 0x1, txtype 2 Reported-by:
Pekka Enberg <penberg@cloudius-systems.com> Signed-off-by:
Tomasz Grabiec <tgrabiec@cloudius-systems.com> Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
Tomasz Grabiec authored
When compiling with -O3 gcc detects that 'th' may be uninitialized. This is true, it happens when prio_find_thread is given which == PRIO_USER or which == PRIO_PGRP. Signed-off-by:
Tomasz Grabiec <tgrabiec@cloudius-systems.com> Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
- Dec 30, 2013
-
-
Or Cohen authored
getgrgid_r(3) is needed when querying file attributes from Java (see java.nio.file.Files.readAttributes()). This is needed for long format (-l) flag of ls. getgrgid_r also requires sysconf(_SC_GETGR_R_SIZE_MAX) Signed-off-by:
Or Cohen <orc@fewbytes.com> Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
- Dec 18, 2013
-
-
Glauber Costa authored
Just came across this. Trivial to fix. Signed-off-by:
Glauber Costa <glommer@cloudius-systems.com> Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
- Dec 15, 2013
-
-
Avi Kivity authored
Now that backtrace() doesn't use libunwind, we can remove it. Signed-off-by:
Avi Kivity <avi@cloudius-systems.com>
-
- Dec 12, 2013
-
-
Pekka Enberg authored
Move mincore() to libc/mman.cc where all other memory mapping libc functions are. Reviewed-by:
Raphael S. Carvalho <raphaelsc@cloudius-systems.com> Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
Pekka Enberg authored
Add a mmu::is_page_aligned() helper function and use it to get rid of open-coded checks. Reviewed-by:
Raphael S. Carvalho <raphaelsc@cloudius-systems.com> Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
- Dec 09, 2013
-
-
Avi Kivity authored
prio_find_thread() is not checking correctly for missing threads, and may return nulls to the caller. Signed-off-by:
Avi Kivity <avi@cloudius-systems.com> Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
- Dec 05, 2013
-
-
Glauber Costa authored
Cassandra is crashing for me in some invocations (I really don't understand how it was running before), because it can't find setpriority and getpriority symbols. Since now we have priorities implemented in our scheduler, we can implement the equivalent functions of linux' getpriority and setpriority. We will ignore all non-thread entities for now (and possibly forever). Signed-off-by:
Glauber Costa <glommer@cloudius-systems.com> Looks-Gooded-by:
Nadav Har'El <nyh@cloudius-systems.com> Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
- Nov 26, 2013
-
-
Raphael S. Carvalho authored
v2: Check limit of microseconds, among other minor changes (Nadav Har'El, Avi Kivity). v3: Get rid of goto & label by adding an else clause (Nadav Har'El). - This patch adds utimes support. - This patch addresses the issue #93 Signed-off-by:
Raphael S. Carvalho <raphaelsc@cloudius-systems.com> Tested-by:
Tomasz Grabiec <tgrabiec@gmail.com> Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
- Oct 24, 2013
-
-
Benoît Canet authored
Signed-off-by:
Benoit Canet <benoit@irqsave.net> Signed-off-by:
Avi Kivity <avi@cloudius-systems.com>
-
- Oct 23, 2013
-
-
Tomasz Grabiec authored
Signed-off-by:
Tomasz Grabiec <tgrabiec@cloudius-systems.com>
-
Tomasz Grabiec authored
Signed-off-by:
Tomasz Grabiec <tgrabiec@cloudius-systems.com>
-
Pekka Enberg authored
Use osv::poweroff() instead of abort() in exit() to make the VM stop cleanly on JVM System.exit(). Needed by DaCapo. Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
- Oct 14, 2013
-
-
Pekka Enberg authored
Fix mincore() to follow Linux ABI and return ENOMEM only if (part of the) memory range is unmapped even if it's not resident. This is needed for mincore() to work with demand paged mmaps. Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
- Oct 07, 2013
-
-
Pekka Enberg authored
Make mincore() error-path compatible with Linux by requiring 'addr' to be page aligned. Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
- Sep 25, 2013
-
-
Nadav Har'El authored
GCC implements static destructors in shared-objects (DSO) by registering a single finalization function, __cxa_finalize(), to run when the DSO is unloaded, and each constructor calls __cxa_atexit() to register a destructor which __cxa_finalize() should call. This patch implements the missing __cxa_finalize() and __cxa_atexit() functions. The do-nothing stubs we had never registered, and never ran, destructors. The implementation in this patch is amazingly simple to write in C++11 :-) Before this fix, we had a crash when running tst-tracepoint.so twice: The first run ran the tracepoints' constructors, which added to the global linked list of tracepoints pointers into the mapped DSO. When the DSO was later unmapped but destructors not run, the linked list of tracepoints was left with pointers to unmapped memory. When we ran the test again, and it wanted to construct more tracepoints, it accessed the broken linked list and crashed. Signed-off-by:
Nadav Har'El <nyh@cloudius-systems.com>
-
Nadav Har'El authored
Add to libc/user.cc stub setresgid(), setresgid(), which as usual in OSv only allow user and group 0. These functions are used by Rogue ;-) Also move getuid() and friends from runtime.cc to libc/user.cc, where they feel more at home. Signed-off-by:
Nadav Har'El <nyh@cloudius-systems.com>
-
- Sep 17, 2013
-
-
Nadav Har'El authored
runtime.cc included a verbatim copy of the structure __locale_data from glibc. We don't need it (not to mention that we're not supposed to copy anything from glibc, it has the wrong license). We previously believed that libstdc++ pokes into this structure, so it needs to be in the exact format of glibc, but now I believe this is not the case, and it only uses __nl_langinfo_l, which in our implementation doesn't even adhere to the locale, and just uses the C locale.
-
- Sep 15, 2013
-
-
Nadav Har'El authored
Add copyright statement to the source files in the top-level directory (except the trivial dummy-shlib.cc). By the way, I don't think this code really belongs in the top-level directory.
-
- Sep 14, 2013
-
-
Pekka Enberg authored
Needed by JMX.
-
- Aug 27, 2013
-
-
Nadav Har'El authored
Commit 65afd075 fixed mincore() to recognize unmapped addresses. However, it used mmu::ismapped() which just checks for mmap()'ed addresses, and doesn't know about malloc()ed memory. This causes trouble for libunwind (which we use for backtrace()) which tests mincore() on an on-stack variable, and for non-pthread threads, this stack might be malloc'ed, not mmap'ed. So this patch adds mmu::isreadable(), which checks that a given memory range is all readable (this memory can be mmapped, malloced, stack, whatever). mincore() now uses that. mmu::isreadable() is implemented, following Avi's idea, by trying to read, with safe_load(), one byte from every page in the range. This approach is faster than page-table-walking especially for one-byte checks (which all libunwind uses anyway), and also very simple.
-
- Aug 26, 2013
-
-
Pekka Enberg authored
Fix mincore() to deal with unmapped addresses like msync() does. This fixes a SIGSEGV in libunwind's access_mem() when leak detector is enabled: (gdb) bt #0 page_fault (ef=0xffffc0003ffe7008) at ../../core/mmu.cc:871 #1 <signal handler called> #2 ContiguousSpace::block_start_const (this=<optimized out>, p=0x77d2f3968) at /usr/src/debug/java-1.7.0-openjdk-1.7.0.25-2.3.12.3.fc19.x86_64/openjdk/hotspot/src/share/vm/oops/oop.inline.hpp:411 #3 0x00001000008ae16c in GenerationBlockStartClosure::do_space (this=0x2000001f9100, s=<optimized out>) at /usr/src/debug/java-1.7.0-openjdk-1.7.0.25-2.3.12.3.fc19.x86_64/openjdk/hotspot/src/share/vm/memory/generation.cpp:242 #4 0x00001000007f097c in DefNewGeneration::space_iterate (this=0xffffc0003fb68c00, blk=0x2000001f9100, usedOnly=<optimized out>) at /usr/src/debug/java-1.7.0-openjdk-1.7.0.25-2.3.12.3.fc19.x86_64/openjdk/hotspot/src/share/vm/memory/defNewGeneration.cpp:480 #5 0x00001000008aca0e in Generation::block_start (this=<optimized out>, p=<optimized out>) at /usr/src/debug/java-1.7.0-openjdk-1.7.0.25-2.3.12.3.fc19.x86_64/openjdk/hotspot/src/share/vm/memory/generation.cpp:251 #6 0x0000100000b06d2f in os::print_location (st=st@entry=0x2000001f9560, x=32165017960, verbose=verbose@entry=false) at /usr/src/debug/java-1.7.0-openjdk-1.7.0.25-2.3.12.3.fc19.x86_64/openjdk/hotspot/src/share/vm/runtime/os.cpp:868 #7 0x0000100000b11b5b in os::print_register_info (st=0x2000001f9560, context=0x2000001f9740) at /usr/src/debug/java-1.7.0-openjdk-1.7.0.25-2.3.12.3.fc19.x86_64/openjdk/hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.cpp:839 #8 0x0000100000c6cde8 in VMError::report (this=0x2000001f9610, st=st@entry=0x2000001f9560) at /usr/src/debug/java-1.7.0-openjdk-1.7.0.25-2.3.12.3.fc19.x86_64/openjdk/hotspot/src/share/vm/utilities/vmError.cpp:551 #9 0x0000100000c6da3b in VMError::report_and_die (this=this@entry=0x2000001f9610) at /usr/src/debug/java-1.7.0-openjdk-1.7.0.25-2.3.12.3.fc19.x86_64/openjdk/hotspot/src/share/vm/utilities/vmError.cpp:984 #10 0x0000100000b1109f in JVM_handle_linux_signal (sig=11, info=0x2000001f9bb8, ucVoid=0x2000001f9740, abort_if_unrecognized=<optimized out>) at /usr/src/debug/java-1.7.0-openjdk-1.7.0.25-2.3.12.3.fc19.x86_64/openjdk/hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.cpp:528 #11 0x000000000039f242 in call_signal_handler (frame=0x2000001f9b10) at ../../arch/x64/signal.cc:69 #12 <signal handler called> #13 0x000000000057d721 in access_mem () #14 0x000000000057cb1d in dwarf_get () #15 0x000000000057ce51 in _ULx86_64_step () #16 0x00000000004315fd in backtrace (buffer=0x1ff9d80 <memory::alloc_tracker::remember(void*, int)::bt>, size=20) at ../../libc/misc/backtrace.cc:16 #17 0x00000000003b8d99 in memory::alloc_tracker::remember (this=0x1777ae0 <memory::tracker>, addr=0xffffc0004508de00, size=54) at ../../core/alloctracker.cc:59 #18 0x00000000003b0504 in memory::tracker_remember (addr=0xffffc0004508de00, size=54) at ../../core/mempool.cc:43 #19 0x00000000003b2152 in std_malloc (size=54) at ../../core/mempool.cc:723 #20 0x00000000003b259c in malloc (size=54) at ../../core/mempool.cc:856 #21 0x0000100001615e4c in JNU_GetStringPlatformChars (env=env@entry=0xffffc0003a4dc1d8, jstr=jstr@entry=0xffffc0004591b800, isCopy=isCopy@entry=0x0) at ../../../src/share/native/common/jni_util.c:801 #22 0x000010000161ada6 in Java_java_io_UnixFileSystem_getBooleanAttributes0 (env=0xffffc0003a4dc1d8, this=<optimized out>, file=<optimized out>) at ../../../src/solaris/native/java/io/UnixFileSystem_md.c:111 #23 0x000020000021ed8e in ?? () #24 0x00002000001faa58 in ?? () #25 0x00002000001faac0 in ?? () #26 0x00002000001faa50 in ?? () #27 0x0000000000000000 in ?? () Spotted by Avi Kivity.
-
- Aug 22, 2013
-
-
Or Cohen authored
Needed for SSHD when using sshfs
-
- Aug 14, 2013
-
-
Avi Kivity authored
Needed for libstdc++ from gcc 4.8.1
-
- Aug 12, 2013
-
-
Avi Kivity authored
Currently we statically link to libstdc++ and libgcc_s, and also dynamically link to the same libraries (since the payload requires them). This causes some symbols to be available from both the static and dynamic version. With the resolution order change introduced by 82513d41, we can resolve the same symbol to different addresses at different times. This violates the One Definition Rule, and in fact breaks std::string's destructor. Fix by only linking in the libraries statically. We use ld's --whole-archive flag to bring in all symbols, including those that may be used by the payload but not by the kernel. Some symbols now become duplicates; we drop our version.
-
Avi Kivity authored
Needed to link the entirety of libstdc++.a.
-
- Aug 06, 2013
-
-
Pekka Enberg authored
As pointed out by Nadav, posix_fadvise() doesn't set errno. Instead, it returns the error number: http://pubs.opengroup.org/onlinepubs/009695399/functions/posix_fadvise.html
-
Glauber Costa authored
For now, ignore permitted advice and reject invalid ones.
-
- Jul 27, 2013
-
-
Glauber Costa authored
We will never implement them as is. But some code will still insist in calling them. Our best effort is to return an error, and hope the code copes well with it.
-
- Jul 11, 2013
-
-
Glauber Costa authored
No plans in sight to page out anonymous memory, so for now, stub this. We may have to revisit this once we support proper mmap semantics, specially with ranged mlock/munlock
-
- Jun 09, 2013
-
-
Nadav Har'El authored
Recently Guy fixed abort() so it will *really* not infinitely recurse trying to print a message, using a lock, causing a new abort, ad infinitum. Unfortunately, that didn't fix one remaining case: DUMMY_HANDLER (see exceptions.cc) used the idiom debug(....); abort(); which can again cause infinite recursion - a #GP calls debug() which causes a new #GP, which again calls debug, etc. Instead of the above broken idiom, created a new function abort(msg), which is just like the familiar abort(), just changes the "Aborted" message to some other message (a constant string). Like abort(), the new variant abort(msg) will only print the message once even if called recursively - and uses a lockless version of debug(). Note that the new abort(msg) is a C++-only API. C will only see the abort(void) which is extern "C". At first I wanted to call the new function panic(msg) and export it to C, but gave when I saw the name panic() was already in use in a bunch of BSD code.
-
- May 29, 2013
-
-
Nadav Har'El authored
Don't abort on an unimplemented sysconf parameter. One of the documented functions of sysconf(3) is to "test ... whether certain options are supported", so programs are free to test for features we don't support yet, and we're supposed to return -1 with errno set to EINVAL. For example, Boost tested _SC_THREAD_SAFE_FUNCTIONS which we didn't support. It would have been fine if we set EINVAL (it would switch from *_r functions to the non-reenatrant ones) - but it wasn't fine that we abort()ed because of this test :-) To be on the safe side, this patch still prints a message if we see an unknown sysconf - in case in the future we'll come across a new one we must treat. But eventually, the message should go away too.
-
Nadav Har'El authored
Implement the _SC_THREAD_SAFE_FUNCTIONS sysconf, returning 1. _SC_THREAD_SAFE_FUNCTIONS is defined in Posix 1003.1c ("posix threads"), and is supposed to return 1 if the thread-safe functions option is supported (*_r() functions). Since we do implement those, we should return 1 for this sysconf. Boost's system library uses this sysconf, and if it sees it is not available, restorts to the _r()-less variants, for no good reason.
-
- May 27, 2013
-
-
Guy Zana authored
the debug() console function is taking a lock before it access the console driver, it does that by acquiring a mutex which may sleep. since we want to be able to debug (and abort) in contexts where it's not possible sleep, such as in page_fault, a lockless debug print method is introduced. previousely to this patch, any abort on page_fault would cause an "endless" recursive abort() loop which hanged the system in a peculiar state.
-
Guy Zana authored
the current code handles the case of recursive aborts incorrectly, while the existing comment is very precise :)
-
- May 22, 2013
-
-
Nadav Har'El authored
abort() did the same thing as the new osv::hang(), so let's just use osv::hang(). Note that it's important that osv::hang() doesn't print anything - abort() does, but avoids infinite recursion that can happen when abort()'s printing itself causes a crash, and another abort().
-
- May 18, 2013
-
-
Avi Kivity authored
musl doesn't provide these defines, and it isn't really necessary to put them in some header.
-
- May 02, 2013
-
-
Avi Kivity authored
-
- Apr 24, 2013
-
-
Avi Kivity authored
-