Switch branches/tags
Commits on May 28, 2013
  1. Fix code generation for JIT stubs

    dbussink committed May 28, 2013
    This would check against the wrong variable for NULL. This could result
    in an incorrect NULL deference in the JIT helper.
Commits on May 27, 2013
  1. Change AtomicReference#initialize to accept false

    timabdulla committed May 27, 2013
    Currently, Rubinius::AtomicReference#initialize will
    silently discard the desired initial value for the
    reference if it is 'false'. If one opts not to provide
    an initial value for the reference, it defaults to nil.
    In this case, the #initialize method will not set the
    value of the AtomicReference to nil. However, rather
    than checking if the initial value argument is nil,
    it checks if it is falsey. This means that both nil
    and false values are excluded. This patch modifies the
    method to explicitly check if the value is nil.
  2. Add name for respond_to sites we see

    dbussink committed May 27, 2013
    This ensures we properly bump serial numbers when we see a method with
    this name defined.
    Fixes rubinius#2366
  3. Merge pull request rubinius#2359 from LTe/require_relative_symlink

    dbussink committed May 27, 2013
    Require relative symlink
  4. Use realdirpath instead of dirname

    LTe committed May 24, 2013
    When rubinius try to execute require_relative with symlinked path
    File#dirname will not recognize symlink and returns wrong path. But
    File#realdirpath will follow symlink and return proper path for
  5. Bump config_version

    haines committed May 27, 2013
  6. Wrap strerror_r to return the error message string

    haines committed May 27, 2013
    GNU `strerror_r` returns a pointer to a string containing the error
    message, which may be the buffer passed as `buf`, or a pointer to an
    immutable static string, in which case `buf` is unused.
    XSI `strerror_r` always stores the error message in `buf`, and
    returns an integer (0 for success).
    This modifies the RBX_STRERROR macro to ensure that we match the
    GNU-style use of the function.
  7. Wrap up strerror_r usage inside macro

    dbussink committed May 27, 2013
    This wraps up the uglyness needed to hide the annoying fact that
    strerror_r has different signatures for GNU and XSI. On GNU it also
    marks the return value as not ignorable. By using a hacky if() around
    it, we can ignore the value.
    We wrap up the uglyness in a macro so we don't see it everywhere...
    Fixes rubinius#2363
  8. Move Thread setup into the VM and fix GC issues with rb_thread_create

    dbussink committed May 27, 2013
    This moves thread setup into the VM, because if it happens in Ruby it
    might trigger a GC. This is problematic with rb_thread_create, which
    uses a void* pointer to pass arguments around that might get cleaned up
    too soon then.
    By using setup this way, we can ensure no GC happens before the new
    thread is properly started and has extracted the possible argument. We
    also need to make sure we reload the thread object in case of an
    exception so we don't accidentally refer to an old / moved version of
    the object.
  9. Fix GC issue with rb_ary_to_ary

    dbussink committed May 27, 2013
    The problem was that `obj` could have moved because of GC happening when
    respond_to was called. So we should reread the value from the handle
    here instead of using it directly.
  10. Add RBX_GC_STRESS compile time flag to enable GC stress testing

    dbussink committed May 27, 2013
    This allows for defining stress testing of the young and / or mature GC.
    This means that the given GC will run as often as possible on every
    possible GC checkpoint. This makes it easier to flush out issues due
    to for example the GC moving objects.
  11. Print warning after determining return value

    dbussink committed May 27, 2013
    rb_warn() calls back into Ruby and can result in a GC. Therefore we
    print the warning after determining the result, otherwise the `big`
    variable might point to invalid memory due to it being moved.
    Also improve the style to better match style guide for bignum methods.
Commits on May 26, 2013
  1. Use strerror_r over strerror for thread safety

    dbussink committed May 26, 2013
    strerror is not reentrant and not guaranteed to be thread safe, so we
    should use strerror_r instead.
  2. Synchronized around Etc.passwd

    dbussink committed May 26, 2013
    This uses non thread safe methods. Sadly Ruby exposes the underying
    methods directly as well, so people using those have to be aware of
    their thread unsafeness, but we can't do anything about it.
  3. Use getpwnam_r over getpwnam

    dbussink committed May 26, 2013
    The latter is not thread safe, so using the first makes sure this works
  4. Lock around crypt() because it's not thread safe

    dbussink committed May 26, 2013
    Linux provides crypt_r, but this is not a standard and common extension.
    Therefore we lock around it as the easiest solution.
  5. Lock around ttyname() because it's not thread safe

    dbussink committed May 26, 2013
    Also check the return value to verify that the call actually succeeds.
  6. Define methods as const where appropriate

    dbussink committed May 26, 2013
    This makes them explicit about not modifying the current receiving
    object. Also removes a few unused pieces of code that were still
    lingering in here.
  7. Additional header cleanup

    dbussink committed May 26, 2013
    Also replaces usage of stringstream with ostringstream where we only use
    it for outputting data.
  8. Cleanup headers for builtin types

    dbussink committed May 26, 2013
    This makes header inclusion more consistent and loads less headers for
    cases where they aren't needed.
  9. Use thread safe readdir_r instread of readdir

    dbussink committed May 25, 2013
    readdir is not reentrant so not guaranteed to be thread safe. Use
    readdir_r with our own memory so this is not a problem.
Commits on May 25, 2013
  1. Assign the first block argument named "_" on 1.9

    leocassarani committed May 25, 2013
    On 1.9, block arguments named "_" are treated as completely separate
    and renamed to "_0", "_1" etc behind the scenes.
    Previously, accessing the value of the "_" variable inside the body of
    the block would treat it as a previously-undeclared local variable,
    which would have nil value.
    To make "_" resolve to the first argument named "_", we simply avoid
    renaming the first argument to "_0".
    Fixes rubinius#1697
  2. Merge pull request rubinius#2360 from LTe/load_specs_wrong

    dbussink committed May 25, 2013
    Kernel#load should load file twice