| Age | Commit message (Collapse) | Author | |
|---|---|---|---|
| 2016-01-20 | Add installation instructions | Maxim Abramchuk | |
| 2016-01-20 | Merge pull request #3088 from maclover7/patch-1 | Yukihiro "Matz" Matsumoto | |
| Small grammar fix | |||
| 2016-01-19 | Small grammar fix | Jon Moss | |
| [ci skip] | |||
| 2016-01-19 | Merge pull request #3087 from kou/fix-segv-on-rerasing-no-memory-error | Yukihiro "Matz" Matsumoto | |
| Fix SEGV on re-raising NoMemoryError | |||
| 2016-01-19 | Fix SEGV on re-raising NoMemoryError | Kouhei Sutou | |
| Think about the following Ruby script: segv.rb: begin lambda do lambda do "x" * 1000 # NoMemoryError end.call end.call rescue raise end If memory can't allocate after `"x" * 1000`, mruby crashes. Because L_RAISE: block in mrb_vm_exec() calls mrb_env_unshare() via cipop() and mrb_env_unshare() uses allocated memory without NULL check: L_RAISE: block: L_RAISE: // ... while (ci[0].ridx == ci[-1].ridx) { cipop(mrb); // ... } cipop(): static void cipop(mrb_state *mrb) { struct mrb_context *c = mrb->c; if (c->ci->env) { mrb_env_unshare(mrb, c->ci->env); } c->ci--; } mrb_env_unshare(): MRB_API void mrb_env_unshare(mrb_state *mrb, struct REnv *e) { size_t len = (size_t)MRB_ENV_STACK_LEN(e); // p is NULL in this case mrb_value *p = (mrb_value *)mrb_malloc(mrb, sizeof(mrb_value)*len); MRB_ENV_UNSHARE_STACK(e); if (len > 0) { stack_copy(p, e->stack, len); // p is NULL but used. It causes SEGV. } e->stack = p; mrb_write_barrier(mrb, (struct RBasic *)e); } To solve the SEGV, this change always raises NoMemoryError even when realloc() is failed after the first NoMemoryError in mrb_realloc(). mrb_unv_unshare() doesn't need to check NULL with this change. But it causes infinite loop in the following while: L_RAISE: // ... while (ci[0].ridx == ci[-1].ridx) { cipop(mrb); // ... } Because cipop() never pops ci. This change includes cipop() change. The change pops ci even when mrb_unv_unshare() is failed by NoMemoryError. This case can be reproduced by the following program: #include <stdlib.h> #include <mruby.h> #include <mruby/compile.h> static void * allocf(mrb_state *mrb, void *ptr, size_t size, void *ud) { static mrb_bool always_fail = FALSE; if (size == 1001) { always_fail = TRUE; } if (always_fail) { return NULL; } if (size == 0) { free(ptr); return NULL; } else { return realloc(ptr, size); } } int main(int argc, char **argv) { mrb_state *mrb; mrbc_context *c; FILE *file; mrb = mrb_open_allocf(allocf, NULL); c = mrbc_context_new(mrb); file = fopen(argv[1], "r"); mrb_load_file_cxt(mrb, file, c); fclose(file); mrbc_context_free(mrb, c); mrb_close(mrb); return EXIT_SUCCESS; } Try the following command lines: % cc -I include -L build/host/lib -O0 -g3 -o no-memory no-memory.c -lmruby -lm % ./no-memory segv.rb | |||
| 2016-01-18 | Merge pull request #28 from zzak/port-ntop-pton-win32 | Tomoyuki Sahara | |
| Port inet_ntop and inet_pton for WIN32 | |||
| 2016-01-18 | Merge pull request #27 from zzak/fix-udpsock-warning | Tomoyuki Sahara | |
| Fix warning: variable 'udpsock' set but not used | |||
| 2016-01-18 | Port inet_ntop and inet_pton for WIN32 | Zachary Scott | |
| Without these functions, compilation fails on MinGW | |||
| 2016-01-18 | Fix warning: variable 'udpsock' set but not used | Zachary Scott | |
| 2016-01-18 | Merge pull request #3086 from pra85/2016 | Yukihiro "Matz" Matsumoto | |
| Update license year range to 2016 | |||
| 2016-01-18 | Update license year range to 2016 | Prayag Verma | |
| 2016-01-14 | Merge pull request #3084 from syohex/all-zeros | Yukihiro "Matz" Matsumoto | |
| Fix passing all zero string to Kernel#Integer | |||
| 2016-01-14 | Fix all zero string case | Syohei YOSHIDA | |
| 2016-01-14 | Add tests which passes all zero string to Kernel#Integer | Syohei YOSHIDA | |
| 2016-01-14 | Merge pull request #3082 from ↵ | Yukihiro "Matz" Matsumoto | |
| jefffederman/feature/install-mruby-with-ruby-install Update README to mention ruby version management tools | |||
| 2016-01-13 | Update README to mention ruby version management tools | Jeff Federman | |
| 2016-01-13 | Merge pull request #3081 from val00274/fix_toolchains_params | Yukihiro "Matz" Matsumoto | |
| Fix build error in ruby 1.8. | |||
| 2016-01-13 | Fix build error in ruby 1.8. | asatou | |
| Apply change of #2978 to :clang, :gcc, :visualcpp toolchains | |||
| 2016-01-11 | Merge pull request #3080 from kou/fix-class-variable-in-module | Yukihiro "Matz" Matsumoto | |
| Fix class variable reference in module | |||
| 2016-01-11 | Fix class variable reference in module | Kouhei Sutou | |
| Fix #3079 | |||
| 2016-01-08 | fixed a problem with upvar access from instance_eval; ref #3072 | Yukihiro "Matz" Matsumoto | |
| 2016-01-08 | Merge pull request #3077 from sgnr/output-backtrace-segfault | Yukihiro "Matz" Matsumoto | |
| Fix segfault on mrb_exc_backtrace. | |||
| 2016-01-07 | Fix segfault on mrb_exc_backtrace. | Simon Génier | |
| The code to iterate over backtrace locations was changed in #3065, but unfortunately output_backtrace was not correctly updated to forward the callback. | |||
| 2016-01-07 | replace mrb_toplevel_run() by mrb_top_run() | Yukihiro "Matz" Matsumoto | |
| 2016-01-07 | mruby-eval: fixed receiver value in eval context; close #3072 | Yukihiro "Matz" Matsumoto | |
| 2016-01-07 | change mrb_run related API names; compatibility macros provided | Yukihiro "Matz" Matsumoto | |
| 2016-01-07 | move KHASH_DECLARE(ht..) to mruby/hash.h; close #3073 | Yukihiro "Matz" Matsumoto | |
| 2016-01-07 | mruby-sprintf to use mrb_int formatting macros; ref #3076 | Yukihiro "Matz" Matsumoto | |
| 2016-01-07 | Merge pull request #3074 from syohex/precision-parameter-type | Yukihiro "Matz" Matsumoto | |
| printf precision parameter must be 'int' type | |||
| 2016-01-07 | printf precision parameter must be 'int' type | Syohei YOSHIDA | |
| There is a problem when MRB_INT64 is enabled. | |||
| 2016-01-06 | Merge pull request #3071 from ksss/symbol | Yukihiro "Matz" Matsumoto | |
| symname_p support `!~` | |||
| 2016-01-06 | Merge pull request #3070 from kazuho/kazuho/printf-specifiers | Yukihiro "Matz" Matsumoto | |
| provide macro to ease using printf mrb_int | |||
| 2016-01-06 | define `MRB_PRI?` that map to `PRI?NN` depending on the size of `mrb_int` | Kazuho Oku | |
| 2016-01-06 | symname_p support `!~` | ksss | |
| 2016-01-05 | bytes2chars() conversion to fail if target byte offset is not on the ↵ | Yukihiro "Matz" Matsumoto | |
| character boundary; ref #3067 that means String#index matches first byte of a multi-byte character. this behavior is different from CRuby, but a compromise for mruby which does not have encoding stuffs. | |||
| 2016-01-04 | stack_extend before eval_under() | Yukihiro "Matz" Matsumoto | |
| 2016-01-02 | instance_eval should pass the receiver as a block parameter; close #3029 | Yukihiro "Matz" Matsumoto | |
| 2016-01-02 | mirb: enlarge code buffer size to 4KB | Yukihiro "Matz" Matsumoto | |
| 2016-01-02 | mruby-fiber: fiber_switch() to use nesting VM when it's called from C API or ↵ | Yukihiro "Matz" Matsumoto | |
| mrb_funcall(); close #3056 | |||
| 2016-01-01 | Merge pull request #3068 from kazuho/kazuho/osx-_setjmp | Yukihiro "Matz" Matsumoto | |
| use _setjmp/_longjmp on OS X | |||
| 2016-01-01 | use _setjmp/_longjmp on other BSD flavors | Kazuho Oku | |
| 2016-01-01 | use _setjmp/_longjmp on OS X | Kazuho Oku | |
| 2015-12-31 | mruby-fiber: add Fiber.yield description; close #3066 | Yukihiro "Matz" Matsumoto | |
| Fiber.yield cannot be called from #initialize which is called by mrb_funcall(). It is mruby limitation. | |||
| 2015-12-31 | Merge pull request #3067 from ksss/use-memchr | Yukihiro "Matz" Matsumoto | |
| Use memchr for performance | |||
| 2015-12-31 | Use memchr for performance | ksss | |
| ```ruby s = "b" str = ("a" * 100 + s) t = Time.now str.index(s) puts Time.now - t ``` before => 0.000788 after => 0.000508 --- ```ruby s = "b" str = ("a" * 100 * 1024 * 1024 + s) t = Time.now str.index(s) puts Time.now - t ``` before => 0.225474 after => 0.008658 | |||
| 2015-12-31 | __t_printstr__ may not be available for tests | Yukihiro "Matz" Matsumoto | |
| 2015-12-31 | GC must scan env from fibers even when it's not yet copied to heap; fix #3063 | Yukihiro "Matz" Matsumoto | |
| 2015-12-30 | simpler t_print | Yukihiro "Matz" Matsumoto | |
| 2015-12-29 | Merge pull request #3065 from kou/support-backtrace-after-method-calls | Yukihiro "Matz" Matsumoto | |
| Support backtrace after method calls | |||
| 2015-12-29 | Skip backtrace related tests when backtrace isn't available | Kouhei Sutou | |
