Skip to content
Snippets Groups Projects
  1. Jul 27, 2013
    • Glauber Costa's avatar
      stub fork and vfork · 60a5b5fa
      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.
      60a5b5fa
  2. Jul 11, 2013
    • Glauber Costa's avatar
      stub mlock and mlockall · e0948398
      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
      e0948398
  3. Jun 09, 2013
    • Nadav Har'El's avatar
      Add, and use, new abort(msg) function · e6208f1e
      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.
      e6208f1e
  4. May 29, 2013
    • Nadav Har'El's avatar
      Don't abort on unknown sysconf. · 05c34106
      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.
      05c34106
    • Nadav Har'El's avatar
      Implement _SC_THREAD_SAFE_FUNCTIONS sysconf · a25cb86b
      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.
      a25cb86b
  5. May 27, 2013
    • Guy Zana's avatar
      debug: introduce debug_ll() and use it in abort() · 6ebb582e
      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.
      6ebb582e
    • Guy Zana's avatar
      abort: debug() may cause an abort() as well · 9ef87755
      Guy Zana authored
      the current code handles the case of recursive aborts incorrectly, while
      the existing comment is very precise :)
      9ef87755
  6. May 22, 2013
    • Nadav Har'El's avatar
      Use osv::hang() in abort() · 17a79e66
      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().
      17a79e66
  7. May 18, 2013
  8. May 02, 2013
  9. Apr 24, 2013
  10. Apr 23, 2013
    • Nadav Har'El's avatar
      Avoid recursive "Aborted" printout. · 17216873
      Nadav Har'El authored
      When memory is badly corrupted, our attempt to print "Aborted" in abort()
      can cause an endless recursion of abort()s, filling the stack and eventually
      (since we don't have a stack guard) everything. Let's just avoid printing
      the "Aborted" message if inside an abort().
      17216873
    • Avi Kivity's avatar
      libc: fix sysconf(_SC_NPROCESSORS_*) · 1733c8f1
      Avi Kivity authored
      The current implementation returns 1, leading the JRE to optimize for
      a uniprocessor host.  Unfortunately those optimizations are unsafe on SMP,
      leading to hangs.
      
      Fix by returning the real number of processors.
      1733c8f1
  11. Apr 11, 2013
  12. Apr 07, 2013
  13. Mar 18, 2013
  14. Feb 11, 2013
  15. Feb 07, 2013
  16. Feb 06, 2013
  17. Feb 05, 2013
  18. Jan 31, 2013
    • Avi Kivity's avatar
      runtime: implement __cxa_guard_acquire() · 4e7d8cce
      Avi Kivity authored
      Otherwise, static constructors in functions are never called.  This
      manifested itself in the jit generating wrong code when compiling a function,
      as the register calling convention was not initialized, and the jvm tried
      to load all method arguments into %rax.
      4e7d8cce
  19. Jan 27, 2013
  20. Jan 21, 2013
  21. Jan 20, 2013
  22. Jan 19, 2013
  23. Jan 18, 2013
  24. Jan 17, 2013
  25. Jan 16, 2013
    • Christoph Hellwig's avatar
      add the string library from musl · 5cd0168f
      Christoph Hellwig authored
      Import the whole string library, as well as the ctype functions from the musl
      C library.  Must is a BSD licensed library that aims to be API and mostly ABI
      compatible with glibc, so it's our easiest way to provide the ABI we need
      without reinventing the wheel.  I will import more of the traditional non-syscall
      C library code from it and expect libc/ to eventually mostly consist of slightly
      modified musl code.
      5cd0168f
  26. Jan 15, 2013
Loading