Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: mruby/mruby
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: b83e4df
Choose a base ref
...
head repository: dearblue/mruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 6797ebf
Choose a head ref
  • 18 commits
  • 9 files changed
  • 1 contributor

Commits on Jan 20, 2019

  1. Fix NULL pointer dereference mrb->nomem_err when not initialized

    Add internal functions (not `static`):
    
      * `mrb_raise_nomemory()`
      * `mrb_core_init_abort()`
    dearblue committed Jan 20, 2019
    Configuration menu
    Copy the full SHA
    b4b4773 View commit details
    Browse the repository at this point in the history
  2. Fix stack overflow when out of memory

    As a result of this change, no backtrace information is set
    for NoMemoryError (`mrb->nomem_err`).
    
    Detailes:
    
    When generating a backtrace, called `mrb_intern_lit()`,
    `mrb_str_new_cstr()` and `mrb_obj_iv_set()` function with
    `exc_debug_info()` function in `src/error.c`.
    
    If a `NoMemoryError` exception occurs at this time,
    the `exc_debug_info()` function will be called again,
    and in the same way `NoMemoryError` exception raised will result
    in an infinite loop to occurs stack overflow (and SIGSEGV).
    dearblue committed Jan 20, 2019
    Configuration menu
    Copy the full SHA
    c50f444 View commit details
    Browse the repository at this point in the history
  3. Fix memory leak for string object when out of memory

    The `mrb_str_pool()` function has a path to call `malloc()` twice.
    
    If occurs `NoMemoryError` exception in second `malloc()`,
    first `malloc()` pointer is not freed.
    dearblue committed Jan 20, 2019
    Configuration menu
    Copy the full SHA
    121a9d5 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    32875cf View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    fda84bf View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    bfea659 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    a4f65b4 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    7d063d9 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    a421da5 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    771ae4e View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    76d81d8 View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    12549ec View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    73bedb7 View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    d4e9262 View commit details
    Browse the repository at this point in the history
  15. Configuration menu
    Copy the full SHA
    efc0754 View commit details
    Browse the repository at this point in the history
  16. Configuration menu
    Copy the full SHA
    a0c3d66 View commit details
    Browse the repository at this point in the history
  17. Configuration menu
    Copy the full SHA
    26ab8bb View commit details
    Browse the repository at this point in the history
  18. Fix invalid pointer free inside other heap's block

     1. `e = mrb_obj_alloc(...)`
     2. `e->stack = mrb->c->stack` (`mrb->c->stack` is anywhere in the range `stbase...stend`)
     3. And raised exception by `mrb_malloc()`!
     4. `mrb_free(e->stack)` by GC part (wrong free)
    dearblue committed Jan 20, 2019
    Configuration menu
    Copy the full SHA
    6797ebf View commit details
    Browse the repository at this point in the history
Loading