profile
viewpoint
Yukihiro "Matz" Matsumoto matz Ruby Association,NaCl Matsue, Japan

matz/streem 4461

prototype of stream based programming language

matz/mruby 88

Lightweight Ruby

matz/mail 11

A Really Ruby Mail Library

matz/csv_parser 4

Simple CSV parser written in C

matz/lockfree-queue 3

A simple lock-free queue implementation.

matz/mruby-onig-regexp 1

mrbgem of 鬼雲's Regular Expression

matz/mruby-process 1

Process module for mruby

matz/qmk_firmware 1

keyboard controller firmware for Atmel AVR and ARM USB families

pull request commentmruby/mruby

Mruby3

I am not sure whether I understand your statement. mrbc is built using the core, core using symbols generated from presym. If we update the presym we need to compile everything again. If we use mrbc to generate presym, the build steps would be:

  • build core without presym
  • build mrbc using the first core
  • generate binary files and presym using mrbc
  • recompile everything again (this time including gems)

It is redundant. I have several ideas to avoid recompilation, but it requires a big rewrite regarding mrbc.

matz

comment created time in 3 days

pull request commentmruby/mruby

Mruby3

To avoid repeated compilation, presym' need to be generated beforemrbc`. That is the biggest constraint. If you have any idea, let me know.

matz

comment created time in 3 days

push eventmruby/mruby

dearblue

commit sha 57611240a972932ef26a13c6998a7fa90fd33371

Prohibit string changes by "s"/"z" specifier of `mrb_get_args()` - The `s` specifier is a string pointer obtained without performing `mrb_str_modify()`, so it cannot be changed. - The `z` specifier cannot be changed because it is a string pointer obtained by `RSTRING_CSTR()` which returns `const char *`.

view details

Yukihiro "Matz" Matsumoto

commit sha 9ea7b718683386d2dc0787e919fc3d413ab20e67

Merge pull request #5087 from dearblue/get-args-string Prohibit string changes by "s"/"z" specifier of `mrb_get_args()`

view details

push time in 3 days

PR merged mruby/mruby

Prohibit string changes by "s"/"z" specifier of `mrb_get_args()`
  • The s specifier is a string pointer obtained without performing mrb_str_modify(), so it cannot be changed.
  • The z specifier cannot be changed because it is a string pointer obtained by RSTRING_CSTR() which returns const char *.
+23 -18

0 comment

6 changed files

dearblue

pr closed time in 3 days

Pull request review commentmruby/mruby

Prohibit string changes by "s"/"z" specifier of `mrb_get_args()`

 void mrb_hash_check_kdict(mrb_state *mrb, mrb_value self);     S:      String         [mrb_value]            when ! follows, the value may be nil     A:      Array          [mrb_value]            when ! follows, the value may be nil     H:      Hash           [mrb_value]            when ! follows, the value may be nil-    s:      String         [char*,mrb_int]        Receive two arguments; s! gives (NULL,0) for nil-    z:      String         [char*]                NUL terminated string; z! gives NULL for nil+    s:      String         [char const*,mrb_int]  Receive two arguments; s! gives (NULL,0) for nil+    z:      String         [char const*]          NUL terminated string; z! gives NULL for nil

L775 uses const char* and here it's char const*. Aren't they inconsistent?

dearblue

comment created time in 4 days

PullRequestReviewEvent

push eventmruby/mruby

Yukihiro "Matz" Matsumoto

commit sha d78f1f983511bd80631f41b0112cd7e10863969f

Add `bintest` to `host-m32` target.

view details

Yukihiro "Matz" Matsumoto

commit sha 1b2dcb4b81fa88e60f565c782e8400736182a1a0

Remove the length of `Float' pool from the binary dump. Also fixed the size calculation of `irep` dump, that could cause memory corruption.

view details

Yukihiro "Matz" Matsumoto

commit sha 14f80395554cc952b90c56d4fb48575714c375b2

Update `MRB_FLOAT_FMT` to always use double precision.

view details

Yukihiro "Matz" Matsumoto

commit sha ab67241ec2660cfeb683f12c31913aa1ac9b59a5

No need to get the `irep` record size twice.

view details

push time in 7 days

push eventmruby/mruby

Yukihiro "Matz" Matsumoto

commit sha 3985d3ac0e98387efd92c1ae96c02eb8d6631ae9

Unify `mrb_str_to_str` to `mrb_obj_as_string`. Redirect `mrb_str_to_str` to `mrb_obj_as_string` via C macro. Inspired by #5082

view details

Yukihiro "Matz" Matsumoto

commit sha 0bb76dde3d8b8d3ee595b9752ac2a643fae992b4

Remove `DEBUG_ONLY_EXPR()` from `CHECKPOINT_*` macros; ref #5060 To allow C++ compilation. Fix suggested by @dearblue.

view details

push time in 7 days

push eventmruby/mruby

Yukihiro "Matz" Matsumoto

commit sha db839a16bdcd078b0336c15c228a6e5e8b41e876

Dump/load 16 bits for `ilen` and `slen` in `irep`. Those types are `uint16_t` in definition. Also we no longer need padding for `iseq`.

view details

Yukihiro "Matz" Matsumoto

commit sha f1265d018a779c882f8fd87138b8961b79ca5ca6

Unify `mrb_str_to_str` to `mrb_obj_as_string`. Redirect `mrb_str_to_str` to `mrb_obj_as_string` via C macro.

view details

push time in 7 days

pull request commentmruby/mruby

Improve `ensure`

I modified the line that caused the problem. It could be my fault. Sorry if it's the case. I'd rather remove DEBUG_ONLY_EXPR() lines here.

dearblue

comment created time in 7 days

pull request commentmruby/mruby

Improve `ensure`

@dearblue This PR cannot be compiled by the C++ compiler regarding goto in vm.c. Try rake TARGET=host-cxx. I will investigate it later, but if you have any idea, let me know.

dearblue

comment created time in 8 days

issue commentmruby/mruby

[RFC] Support startless/endless `Range` (`N..`, `..N`)

Accepted. I have a plan to support these features. But the priority was low.

wataash

comment created time in 8 days

issue closedmruby/mruby

[newbie] decompiler for mruby bytecode ?

Hi

Sorry if it is not the right place to ask that, but I am wondering if a mruby bytecode decompiler exists somewhere.

JCLL

closed time in 9 days

JC-LL

issue commentmruby/mruby

[newbie] decompiler for mruby bytecode ?

We have no decompiler yet (no plan). Disassembled bytecode is shown with the -v option.

❯ mruby -v -e 'p "hello"'
mruby 2.1.2 (2020-08-06)
00001 NODE_SCOPE:
00001   NODE_BEGIN:
00001     NODE_FCALL:
00001       NODE_SELF
00001       method='p' (3242)
00001       args:
00001         NODE_STR "hello" len 5
irep 0x55d24b7d3500 nregs=4 nlocals=1 pools=1 syms=1 reps=0 iseq=12
file: -e
    1 000 OP_LOADSELF	R1		
    1 002 OP_STRING	R2	L(0)	; hello
    1 005 OP_SEND	R1	:p	1
    1 009 OP_RETURN	R1		
    1 011 OP_STOP

"hello"
JC-LL

comment created time in 9 days

push eventmruby/mruby

Yukihiro "Matz" Matsumoto

commit sha df2e736c36a82a140f0588197243ef9443f80656

Use Markdown section marker `#`; ref #5084 [ci skip] The fix was proposed by @dearblue

view details

Yukihiro "Matz" Matsumoto

commit sha 584fdb16cb5281d823ad67fe7a6bdeded6f76151

Remove duplicated constant `IREP_TT_SFLAG`; #5084

view details

Yukihiro "Matz" Matsumoto

commit sha 4cde19e80f610b7698b33f05babad86cbf857323

Clarify the meaning of `MRB_IREP_STATIC`; ref #5084

view details

push time in 9 days

Pull request review commentmruby/mruby

Mruby3

 typedef struct mrb_kwargs mrb_kwargs;  struct mrb_kwargs {-  uint32_t num;-  mrb_value *values;-  const char *const *table;-  uint32_t required;-  mrb_value *rest;+  uint32_t num;                 /* number of keyword arguments */+  uint32_t required;            /* number of required keyword arguments */+  mrb_sym *table;               /* C array of symbols for keyword names */

Indeed. Thank you.

matz

comment created time in 9 days

PullRequestReviewEvent

push eventmruby/mruby

Yukihiro "Matz" Matsumoto

commit sha 44f910c50bfd5c4fe8e9d8ff8acc36ef1373c406

Should use `PRId32` to dump `.i32`; ref #5084 The fix was proposed by @dearblue

view details

Yukihiro "Matz" Matsumoto

commit sha df6b16180064c399870f22626d06ea4188f78898

Add `const` modifier to `table` in `mrb_kwargs`; #5084 The fix was proposed by @dearblue

view details

push time in 9 days

Pull request review commentmruby/mruby

Mruby3

 mrb_dump_irep_cfunc(mrb_state *mrb, mrb_irep *irep, uint8_t flags, FILE *fp, con   return result; } +static int+dump_pool(mrb_state *mrb, const mrb_pool_value *p, FILE *fp)+{+  if (p->tt & IREP_TT_NFLAG) {  /* number */+    switch (p->tt) {+#ifdef MRB_64BIT+    case IREP_TT_INT64:+      if (p->u.i64 < INT32_MIN || INT32_MAX < p->u.i64) {+        fprintf(fp, "{IREP_TT_INT64, {.i64=%" PRId64 "}},\n", p->u.i64);+      }+      else {+        fprintf(fp, "{IREP_TT_INT32, {.i64=%" PRId64 "}},\n", p->u.i64);

It should be. I will fix.

matz

comment created time in 9 days

PullRequestReviewEvent

issue commentmruby/mruby

Wrong behavior in `while false`

Maybe we will support this syntax in the near future. Stay tuned.

kaz0505

comment created time in 10 days

PR opened mruby/mruby

Mruby3

Update to mruby3.

+9448 -7794

0 comment

164 changed files

pr created time in 11 days

pull request commentmruby/mruby

examples/mrbgems: clarify the caller

Thank you for your contribution. @wataash Do you want to add your name to the AUTHORS file? If you are willing, send us PR to update the file.

wataash

comment created time in 11 days

push eventmruby/mruby

Wataru Ashihara

commit sha 2bf9fd06d248de4d85989aa25c2e7b4dcdf6b333

examples/mrbgems: clarify the caller Before this commit: mruby -e 'CRubyExtension.ruby_method' # => A Ruby Extension mruby -e 'CRubyExtension.c_method' # => A C Extension mruby -e 'CExtension.c_method' # => A C Extension mruby -e 'RubyExtension.ruby_method' # => A Ruby Extension After this commit: mruby -e 'CRubyExtension.ruby_method' # => CRubyExtension: A Ruby Extension mruby -e 'CRubyExtension.c_method' # => CRubyExtension: A C Extension mruby -e 'CExtension.c_method' # => CExtension: A C Extension mruby -e 'RubyExtension.ruby_method' # => RubyExtension: A Ruby Extension

view details

Yukihiro "Matz" Matsumoto

commit sha a97f085c52c3a98ffd26e69ac1fd0d43dc83864c

Merge pull request #5083 from wataash/example-clarify-caller examples/mrbgems: clarify the caller

view details

push time in 11 days

PR merged mruby/mruby

examples/mrbgems: clarify the caller

Before this commit:

mruby -e 'CRubyExtension.ruby_method' # => A Ruby Extension
mruby -e 'CRubyExtension.c_method'    # => A C Extension
mruby -e 'CExtension.c_method'        # => A C Extension
mruby -e 'RubyExtension.ruby_method'  # => A Ruby Extension

After this commit:

mruby -e 'CRubyExtension.ruby_method' # => CRubyExtension: A Ruby Extension
mruby -e 'CRubyExtension.c_method'    # => CRubyExtension: A C Extension
mruby -e 'CExtension.c_method'        # => CExtension: A C Extension
mruby -e 'RubyExtension.ruby_method'  # => RubyExtension: A Ruby Extension
+12 -4

0 comment

4 changed files

wataash

pr closed time in 11 days

push eventmruby/mruby

Wataru Ashihara

commit sha 4375bffee59254d9d8506c7e22d4986711604281

Remove redundant type-check since mrb_str_to_str() also does it.

view details

Yukihiro "Matz" Matsumoto

commit sha dffe4bc8ba9c8802f5270f9cf101799df90316b2

Merge pull request #5082 from wataash/remove-type-check Remove redundant type-check

view details

Yukihiro "Matz" Matsumoto

commit sha e9b8bf8941df2153c63e261716e2d8e77e09ff18

Generate a table for preallocated symbols (`presym`). `presym` are symbols used in the C source files. `gensym` rake rule scans the entire C source files and collect symbols referenced from them.

view details

Yukihiro "Matz" Matsumoto

commit sha a436972f4ad46a14659fef28d144bbdcafc523bf

Support `presym` in `symbol.c`.

view details

Yukihiro "Matz" Matsumoto

commit sha 92541bd2881c454f80bad0e807b70f1112faf4a2

Update Rakefile to generate presym.

view details

Yukihiro "Matz" Matsumoto

commit sha 183a650f1d8256c50a877d2ec2c4c1488adb4bc9

Add `MRB_SYM()` for inline symbols.

view details

Yukihiro "Matz" Matsumoto

commit sha bfcea6aaaf150c16c98559046389d866ecba1ae1

Update `presym_find` to use more efficient binary search.

view details

Yukihiro "Matz" Matsumoto

commit sha a1a1e834290d0a54bea761789634e6c3e808e243

Scan `.rb` files as well to generate `presym` table.

view details

Yukihiro "Matz" Matsumoto

commit sha 1014a15af8f0854703db26b7902b448845225fbe

Remove `build/presym` and `build/presym.inc` on `rake clean`.

view details

Yukihiro "Matz" Matsumoto

commit sha 19b0cc61f66de7a5060a383b0dbd8499d4d8528a

Remove the temporary file from the `AF_UNIX` socket test; #4981

view details

Yukihiro "Matz" Matsumoto

commit sha 562aeb0446458799e5bf7d5edb5fd113fb0db41f

Avoid `snprintf` in `mruby-io` test; ref #4981

view details

Yukihiro "Matz" Matsumoto

commit sha 31b017088c4ee7359dc34ba8fc3cb4f6015c2d78

Fix `presym_find` for strings without `NUL` terminators.

view details

Yukihiro "Matz" Matsumoto

commit sha 23a20d720d71b25c6ddc7752e7823c552dc98f10

Prepend `gensym` rule to `depfiles`.

view details

Yukihiro "Matz" Matsumoto

commit sha 7457a0e1f7685348bce1692abf7fce56b4014d34

Keep `build/presym` through `rake clean`.

view details

Yukihiro "Matz" Matsumoto

commit sha 0cb700e9988dba37d8cd4c08bd4fc31b0cbae85b

Run `rake gensym` before the build.

view details

Yukihiro "Matz" Matsumoto

commit sha 6af192d5012f153f265db4335549cee731acfef5

Fixed wrong condition in #4981.

view details

Yukihiro "Matz" Matsumoto

commit sha aae02f689954dbb75b8047567435296b8b3a5e07

Should not use `assert` with expressions with side-effect; ref #4981 `assert()` can be completely removed when `NDEBUG` is set.

view details

KOBAYASHI Shuji

commit sha a6ae82a7fda6196a5361099ce089fab98d2e8c69

Refine `.travis.yml` * Disable automatic update and clean up on `brew install` (install time 160 sec -> 5 sec). * Avoid using deprecated keys.

view details

KOBAYASHI Shuji

commit sha 41c058b2359f7792aa4cd5419873ccb5d40ec057

Avoid changing directory in `mruby-io` test

view details

Yukihiro "Matz" Matsumoto

commit sha 1661a400c8aed3fd8f6161c933c495df14ce1fd1

Build process updated: You have to specify `TARGET` to specify a configuration, e.g. ``` rake TARGET=host-debug all test ``` When you port `mruby` to a new configuration: 1. copy an existing configuration under `target` directory 2. modify the new configuration file 3. build using the new configuration 4. send PR if you please

view details

push time in 11 days

push eventmruby/mruby

Wataru Ashihara

commit sha 4375bffee59254d9d8506c7e22d4986711604281

Remove redundant type-check since mrb_str_to_str() also does it.

view details

Yukihiro "Matz" Matsumoto

commit sha dffe4bc8ba9c8802f5270f9cf101799df90316b2

Merge pull request #5082 from wataash/remove-type-check Remove redundant type-check

view details

push time in 11 days

PR merged mruby/mruby

Remove redundant type-check

since mrb_str_to_str() also does it.

+0 -3

0 comment

1 changed file

wataash

pr closed time in 11 days

push eventmruby/mruby

dearblue

commit sha 893cc2780cbf866a28a74a98128ffe8eefb20d03

Add `mrbc_cleanup_local_variables()` with `mrbc_context`; ref #4931 Clean up defined local variables.

view details

dearblue

commit sha 2bab6e197de0d6903e3cb2642af83ff277e133fb

Fix take over file scope variables with `mruby` command Resolve #4931

view details

dearblue

commit sha 25d9370f97d204524a200594faa2bb0adee0e23a

Fix take over file scope variable names with `mirb` command Ref #4931 With this change, the `_` variable is defined after the `-r` switch.

view details

dearblue

commit sha 0aa5aa1de29d61e40a0c1e9be40ee9e14fe284bd

Add test for top level local variables are in file scope; ref #4931

view details

dearblue

commit sha 9840e5352b2abf96235068f0e9d08f14b1d333cf

Isolate top-level local variables by file scope; fix #4931

view details

dearblue

commit sha f99c315400fe43574c165f5a49032be9e88455c5

Remove `enum call_type` It seems to be unnecessary from mruby-1.0.0 or earlier.

view details

Yukihiro "Matz" Matsumoto

commit sha c345fe432171cc2b90b614a0b44305b218090de6

Merge pull request #5076 from dearblue/call_type Remove `enum call_type`

view details

Yukihiro "Matz" Matsumoto

commit sha c27e45193177b6e4d09d526a248af63c0961035a

Merge pull request #4933 from dearblue/variables Fix take over file scope variables with `mruby` and `mirb` command

view details

Yukihiro "Matz" Matsumoto

commit sha 4e158320000322f3601647332727b59a4d797cb7

Update `y.tab.c`; ref #4933

view details

Yukihiro "Matz" Matsumoto

commit sha 8b65e4b73c93f38df8960c698d9bcf34851b6764

Add test to ensure #5077

view details

Yukihiro "Matz" Matsumoto

commit sha 5bfb70e9dbc8636730bab7725b3eaf5423a2e30f

Fix `File.extname` bug; fix #5077

view details

Wataru Ashihara

commit sha e8723a4f3f604135cd32cf926acd26eb46b905ff

Fix *.d parsing with gcc 9.3.0 Before this commit: $ rake ... $ rm build/host/src/gc.o $ rake rake aborted! Don't know how to build task '/home/foo/mruby/build/host/src/gc.o' (See the list of available tasks with `rake --tasks`) ... After this commit: $ rake ... $ rm build/host/src/gc.o $ rake CC src/gc.c -> build/host/src/gc.o ... With gcc 9.3.0 on Ubuntu 20.04, build/host/src/array.d looks like: /build/host/src/array.o: /src/array.c \ /include/mruby.h /include/mrbconf.h \ /include/mruby/common.h \ ... /include/mruby/range.h \ /src/value_array.h and it has been parsed to: [ # /src/array.c missing "/include/mruby.h /include/mrbconf.h", # incorrectly parsed "/include/mruby/common.h", ... "/src/value_array.h", ] After this change, *.d will be parsed correctly. [ "/src/array.c", "/include/mruby.h", "/include/mrbconf.h", "/include/mruby/common.h", ... "/src/value_array.h", ]

view details

Yukihiro "Matz" Matsumoto

commit sha 9757616c57d9180add83f5f88e6a2d6a5a90f02a

Merge pull request #5079 from wataash/fix-dep-parse Fix *.d parsing with gcc 9.3.0

view details

Wataru Ashihara

commit sha 069d9bb4d7de5b632d3c53078126e0aad1e55660

Fix skipping reading file

view details

Wataru Ashihara

commit sha ea3b02e387b15406d96b30eb98e5afbd101083c5

*.d format is version-independent As pointed out by @shuujii on https://github.com/mruby/mruby/pull/5079 , multi-path in single-line could be appear even with older-gcc or clang.

view details

Yukihiro "Matz" Matsumoto

commit sha 758f8f4baf8189260af3025d1d183f255adaea64

Merge pull request #5080 from wataash/fix-dep-read Fix skipping reading file

view details

Yukihiro "Matz" Matsumoto

commit sha e440681a0603e9ef3c5b471e31645fc3b29e647a

Merge pull request #5081 from wataash/d-format-comment *.d format is version-independent

view details

Yukihiro "Matz" Matsumoto

commit sha 1df9630105c993b4aa186b68151548f2afccaca7

Generate a table for preallocated symbols (`presym`). `presym` are symbols used in the C source files. `gensym` rake rule scans the entire C source files and collect symbols referenced from them.

view details

Yukihiro "Matz" Matsumoto

commit sha 7f558f52fefb6f60b8738f9d7ea4182b92baa353

Support `presym` in `symbol.c`.

view details

Yukihiro "Matz" Matsumoto

commit sha d116282df6cb2196305cef59983ba58e10234973

Update Rakefile to generate presym.

view details

push time in 11 days

push eventmruby/mruby

Wataru Ashihara

commit sha ea3b02e387b15406d96b30eb98e5afbd101083c5

*.d format is version-independent As pointed out by @shuujii on https://github.com/mruby/mruby/pull/5079 , multi-path in single-line could be appear even with older-gcc or clang.

view details

Yukihiro "Matz" Matsumoto

commit sha e440681a0603e9ef3c5b471e31645fc3b29e647a

Merge pull request #5081 from wataash/d-format-comment *.d format is version-independent

view details

push time in 11 days

PR merged mruby/mruby

*.d format is version-independent

As pointed out by @shuujii on https://github.com/mruby/mruby/pull/5079 , multi-path in single-line could be appear even with older-gcc or clang.

+4 -17

0 comment

1 changed file

wataash

pr closed time in 11 days

push eventmruby/mruby

Wataru Ashihara

commit sha 069d9bb4d7de5b632d3c53078126e0aad1e55660

Fix skipping reading file

view details

Yukihiro "Matz" Matsumoto

commit sha 758f8f4baf8189260af3025d1d183f255adaea64

Merge pull request #5080 from wataash/fix-dep-read Fix skipping reading file

view details

push time in 11 days

PR merged mruby/mruby

Fix skipping reading file

I did a stupid mistake on https://github.com/mruby/mruby/pull/5079 by accident, I'm sorry.

+1 -1

0 comment

1 changed file

wataash

pr closed time in 11 days

push eventmruby/mruby

Wataru Ashihara

commit sha e8723a4f3f604135cd32cf926acd26eb46b905ff

Fix *.d parsing with gcc 9.3.0 Before this commit: $ rake ... $ rm build/host/src/gc.o $ rake rake aborted! Don't know how to build task '/home/foo/mruby/build/host/src/gc.o' (See the list of available tasks with `rake --tasks`) ... After this commit: $ rake ... $ rm build/host/src/gc.o $ rake CC src/gc.c -> build/host/src/gc.o ... With gcc 9.3.0 on Ubuntu 20.04, build/host/src/array.d looks like: /build/host/src/array.o: /src/array.c \ /include/mruby.h /include/mrbconf.h \ /include/mruby/common.h \ ... /include/mruby/range.h \ /src/value_array.h and it has been parsed to: [ # /src/array.c missing "/include/mruby.h /include/mrbconf.h", # incorrectly parsed "/include/mruby/common.h", ... "/src/value_array.h", ] After this change, *.d will be parsed correctly. [ "/src/array.c", "/include/mruby.h", "/include/mrbconf.h", "/include/mruby/common.h", ... "/src/value_array.h", ]

view details

Yukihiro "Matz" Matsumoto

commit sha 9757616c57d9180add83f5f88e6a2d6a5a90f02a

Merge pull request #5079 from wataash/fix-dep-parse Fix *.d parsing with gcc 9.3.0

view details

push time in 11 days

PR merged mruby/mruby

Fix *.d parsing with gcc 9.3.0
Before this commit:

  $ rake
  ...
  $ rm build/host/src/gc.o
  $ rake
  rake aborted!
  Don't know how to build task '/home/foo/mruby/build/host/src/gc.o' (See the list of available tasks with `rake --tasks`)
  ...

After this commit:

  $ rake
  ...
  $ rm build/host/src/gc.o
  $ rake
  CC    src/gc.c -> build/host/src/gc.o
  ...

With gcc 9.3.0 on Ubuntu 20.04, build/host/src/array.d looks like:

  /build/host/src/array.o: /src/array.c \
   /include/mruby.h /include/mrbconf.h \
   /include/mruby/common.h \
   ...
   /include/mruby/range.h \
   /src/value_array.h

and it has been parsed to:

  [
                                           # /src/array.c missing
    "/include/mruby.h /include/mrbconf.h", # incorrectly parsed
    "/include/mruby/common.h",
    ...
    "/src/value_array.h",
  ]

After this change, *.d will be parsed correctly.

  [
    "/src/array.c",
    "/include/mruby.h",
    "/include/mrbconf.h",
    "/include/mruby/common.h",
    ...
    "/src/value_array.h",
  ]

Ref. https://github.com/mruby/mruby/pull/4571 cc @shuujii

+21 -5

0 comment

1 changed file

wataash

pr closed time in 11 days

issue closedmruby/mruby

Flaky test fail of `File#mtime`.

Happens some time in mrbgems CI too. https://travis-ci.org/mruby/mruby/jobs/395290744

closed time in 14 days

take-cheeze

issue commentmruby/mruby

Flaky test fail of `File#mtime`.

It was caused by the Fixnum overflow. Fixed.

take-cheeze

comment created time in 14 days

issue closedmruby/mruby

Unable to build on macOS 10.14.5: Undefined symbol _rl_free in mirb.o

On latest master (23783a44300a39efbbc312a6ca22fe61d94db857):

$ make
...
LD    build/test/bin/mruby-strip
LD    build/test/bin/mruby
LD    build/test/bin/mirb
Undefined symbols for architecture x86_64:
  "_rl_free", referenced from:
      _main in mirb.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

<details> <summary> Full stacktrace </summary> <pre> $ make ruby ./minirake (in /Users/seb/src/github.com/mruby/mruby) CC mrbgems/mruby-compiler/core/codegen.c -> build/test/mrbgems/mruby-compiler/core/codegen.o CC src/gc.c -> build/test/src/gc.o CC src/variable.c -> build/test/src/variable.o CC src/load.c -> build/test/src/load.o CC src/crc.c -> build/test/src/crc.o CC src/version.c -> build/test/src/version.o CC src/compar.c -> build/test/src/compar.o CC src/pool.c -> build/test/src/pool.o CC src/proc.c -> build/test/src/proc.o CC src/symbol.c -> build/test/src/symbol.o CC src/enum.c -> build/test/src/enum.o CC src/numeric.c -> build/test/src/numeric.o CC src/backtrace.c -> build/test/src/backtrace.o CC src/error.c -> build/test/src/error.o CC src/dump.c -> build/test/src/dump.o CC src/fmt_fp.c -> build/test/src/fmt_fp.o CC src/range.c -> build/test/src/range.o CC src/debug.c -> build/test/src/debug.o CC src/codedump.c -> build/test/src/codedump.o CC src/hash.c -> build/test/src/hash.o CC src/string.c -> build/test/src/string.o CC src/vm.c -> build/test/src/vm.o CC src/init.c -> build/test/src/init.o CC src/state.c -> build/test/src/state.o CC src/etc.c -> build/test/src/etc.o CC src/array.c -> build/test/src/array.o CC src/class.c -> build/test/src/class.o CC src/print.c -> build/test/src/print.o CC src/kernel.c -> build/test/src/kernel.o CC src/object.c -> build/test/src/object.o CC mrbgems/mruby-error/src/exception.c -> build/host-debug/mrbgems/mruby-error/src/exception.o CC mrbgems/mruby-compiler/core/codegen.c -> build/host-debug/mrbgems/mruby-compiler/core/codegen.o CC mrbgems/mruby-class-ext/src/class.c -> build/host-debug/mrbgems/mruby-class-ext/src/class.o CC mrbgems/mruby-kernel-ext/src/kernel.c -> build/host-debug/mrbgems/mruby-kernel-ext/src/kernel.o CC mrbgems/mruby-fiber/src/fiber.c -> build/host-debug/mrbgems/mruby-fiber/src/fiber.o CC mrbgems/mruby-objectspace/src/mruby_objectspace.c -> build/host-debug/mrbgems/mruby-objectspace/src/mruby_objectspace.o CC mrbgems/mruby-object-ext/src/object.c -> build/host-debug/mrbgems/mruby-object-ext/src/object.o CC mrbgems/mruby-random/src/random.c -> build/host-debug/mrbgems/mruby-random/src/random.o CC mrbgems/mruby-random/src/mt19937ar.c -> build/host-debug/mrbgems/mruby-random/src/mt19937ar.o CC mrbgems/mruby-symbol-ext/src/symbol.c -> build/host-debug/mrbgems/mruby-symbol-ext/src/symbol.o CC mrbgems/mruby-proc-ext/src/proc.c -> build/host-debug/mrbgems/mruby-proc-ext/src/proc.o CC mrbgems/mruby-range-ext/src/range.c -> build/host-debug/mrbgems/mruby-range-ext/src/range.o CC mrbgems/mruby-hash-ext/src/hash-ext.c -> build/host-debug/mrbgems/mruby-hash-ext/src/hash-ext.o CC mrbgems/mruby-array-ext/src/array.c -> build/host-debug/mrbgems/mruby-array-ext/src/array.o CC mrbgems/mruby-numeric-ext/src/numeric_ext.c -> build/host-debug/mrbgems/mruby-numeric-ext/src/numeric_ext.o CC mrbgems/mruby-string-ext/src/string.c -> build/host-debug/mrbgems/mruby-string-ext/src/string.o CC mrbgems/mruby-struct/src/struct.c -> build/host-debug/mrbgems/mruby-struct/src/struct.o CC mrbgems/mruby-time/src/time.c -> build/host-debug/mrbgems/mruby-time/src/time.o CC mrbgems/mruby-math/src/math.c -> build/host-debug/mrbgems/mruby-math/src/math.o CC mrbgems/mruby-print/src/print.c -> build/host-debug/mrbgems/mruby-print/src/print.o CC mrbgems/mruby-sprintf/src/sprintf.c -> build/host-debug/mrbgems/mruby-sprintf/src/sprintf.o CC mrbgems/mruby-sprintf/src/kernel.c -> build/host-debug/mrbgems/mruby-sprintf/src/kernel.o CC mrbgems/mruby-pack/src/pack.c -> build/host-debug/mrbgems/mruby-pack/src/pack.o CC mrbgems/mruby-io/src/file.c -> build/host-debug/mrbgems/mruby-io/src/file.o CC mrbgems/mruby-io/src/mruby_io_gem.c -> build/host-debug/mrbgems/mruby-io/src/mruby_io_gem.o CC mrbgems/mruby-io/src/io.c -> build/host-debug/mrbgems/mruby-io/src/io.o CC mrbgems/mruby-io/src/file_test.c -> build/host-debug/mrbgems/mruby-io/src/file_test.o CC mrbgems/mruby-metaprog/src/metaprog.c -> build/host-debug/mrbgems/mruby-metaprog/src/metaprog.o CC src/gc.c -> build/host-debug/src/gc.o CC src/variable.c -> build/host-debug/src/variable.o CC src/load.c -> build/host-debug/src/load.o CC src/crc.c -> build/host-debug/src/crc.o CC src/version.c -> build/host-debug/src/version.o CC src/compar.c -> build/host-debug/src/compar.o CC src/pool.c -> build/host-debug/src/pool.o CC src/proc.c -> build/host-debug/src/proc.o CC src/symbol.c -> build/host-debug/src/symbol.o CC src/enum.c -> build/host-debug/src/enum.o CC src/numeric.c -> build/host-debug/src/numeric.o CC src/backtrace.c -> build/host-debug/src/backtrace.o CC src/error.c -> build/host-debug/src/error.o CC src/dump.c -> build/host-debug/src/dump.o CC src/fmt_fp.c -> build/host-debug/src/fmt_fp.o CC src/range.c -> build/host-debug/src/range.o CC src/debug.c -> build/host-debug/src/debug.o CC src/codedump.c -> build/host-debug/src/codedump.o CC src/hash.c -> build/host-debug/src/hash.o CC src/string.c -> build/host-debug/src/string.o CC src/vm.c -> build/host-debug/src/vm.o CC src/init.c -> build/host-debug/src/init.o CC src/state.c -> build/host-debug/src/state.o CC src/etc.c -> build/host-debug/src/etc.o CC src/array.c -> build/host-debug/src/array.o CC src/class.c -> build/host-debug/src/class.o CC src/print.c -> build/host-debug/src/print.o CC src/kernel.c -> build/host-debug/src/kernel.o CC src/object.c -> build/host-debug/src/object.o CC mrbgems/mruby-error/src/exception.c -> build/host/mrbgems/mruby-error/src/exception.o CC mrbgems/mruby-class-ext/src/class.c -> build/host/mrbgems/mruby-class-ext/src/class.o CC mrbgems/mruby-kernel-ext/src/kernel.c -> build/host/mrbgems/mruby-kernel-ext/src/kernel.o CC mrbgems/mruby-fiber/src/fiber.c -> build/host/mrbgems/mruby-fiber/src/fiber.o CC mrbgems/mruby-objectspace/src/mruby_objectspace.c -> build/host/mrbgems/mruby-objectspace/src/mruby_objectspace.o CC mrbgems/mruby-object-ext/src/object.c -> build/host/mrbgems/mruby-object-ext/src/object.o CC mrbgems/mruby-random/src/random.c -> build/host/mrbgems/mruby-random/src/random.o CC mrbgems/mruby-random/src/mt19937ar.c -> build/host/mrbgems/mruby-random/src/mt19937ar.o CC mrbgems/mruby-symbol-ext/src/symbol.c -> build/host/mrbgems/mruby-symbol-ext/src/symbol.o CC mrbgems/mruby-proc-ext/src/proc.c -> build/host/mrbgems/mruby-proc-ext/src/proc.o CC mrbgems/mruby-range-ext/src/range.c -> build/host/mrbgems/mruby-range-ext/src/range.o CC mrbgems/mruby-hash-ext/src/hash-ext.c -> build/host/mrbgems/mruby-hash-ext/src/hash-ext.o CC mrbgems/mruby-array-ext/src/array.c -> build/host/mrbgems/mruby-array-ext/src/array.o CC mrbgems/mruby-numeric-ext/src/numeric_ext.c -> build/host/mrbgems/mruby-numeric-ext/src/numeric_ext.o CC mrbgems/mruby-string-ext/src/string.c -> build/host/mrbgems/mruby-string-ext/src/string.o CC mrbgems/mruby-struct/src/struct.c -> build/host/mrbgems/mruby-struct/src/struct.o CC mrbgems/mruby-time/src/time.c -> build/host/mrbgems/mruby-time/src/time.o CC mrbgems/mruby-math/src/math.c -> build/host/mrbgems/mruby-math/src/math.o CC mrbgems/mruby-print/src/print.c -> build/host/mrbgems/mruby-print/src/print.o CC mrbgems/mruby-sprintf/src/sprintf.c -> build/host/mrbgems/mruby-sprintf/src/sprintf.o CC mrbgems/mruby-sprintf/src/kernel.c -> build/host/mrbgems/mruby-sprintf/src/kernel.o CC mrbgems/mruby-pack/src/pack.c -> build/host/mrbgems/mruby-pack/src/pack.o CC mrbgems/mruby-io/src/file.c -> build/host/mrbgems/mruby-io/src/file.o CC mrbgems/mruby-io/src/mruby_io_gem.c -> build/host/mrbgems/mruby-io/src/mruby_io_gem.o CC mrbgems/mruby-io/src/io.c -> build/host/mrbgems/mruby-io/src/io.o CC mrbgems/mruby-io/src/file_test.c -> build/host/mrbgems/mruby-io/src/file_test.o CC mrbgems/mruby-metaprog/src/metaprog.c -> build/host/mrbgems/mruby-metaprog/src/metaprog.o CC mrbgems/mruby-bin-strip/tools/mruby-strip/mruby-strip.c -> build/host/mrbgems/mruby-bin-strip/tools/mruby-strip/mruby-strip.o CC mrbgems/mruby-bin-mruby/tools/mruby/mruby.c -> build/host/mrbgems/mruby-bin-mruby/tools/mruby/mruby.o CC mrbgems/mruby-bin-mirb/tools/mirb/mirb.c -> build/host/mrbgems/mruby-bin-mirb/tools/mirb/mirb.o CC mrbgems/mruby-compiler/core/codegen.c -> build/host/mrbgems/mruby-compiler/core/codegen.o CC src/gc.c -> build/host/src/gc.o CC src/variable.c -> build/host/src/variable.o CC src/load.c -> build/host/src/load.o CC src/crc.c -> build/host/src/crc.o CC src/version.c -> build/host/src/version.o CC src/compar.c -> build/host/src/compar.o CC src/pool.c -> build/host/src/pool.o CC src/proc.c -> build/host/src/proc.o CC src/symbol.c -> build/host/src/symbol.o CC src/enum.c -> build/host/src/enum.o CC src/numeric.c -> build/host/src/numeric.o CC src/backtrace.c -> build/host/src/backtrace.o CC src/error.c -> build/host/src/error.o CC src/dump.c -> build/host/src/dump.o CC src/fmt_fp.c -> build/host/src/fmt_fp.o CC src/range.c -> build/host/src/range.o CC src/debug.c -> build/host/src/debug.o CC src/codedump.c -> build/host/src/codedump.o CC src/hash.c -> build/host/src/hash.o CC src/string.c -> build/host/src/string.o CC src/vm.c -> build/host/src/vm.o CC src/init.c -> build/host/src/init.o CC src/state.c -> build/host/src/state.o CC src/etc.c -> build/host/src/etc.o CC src/array.c -> build/host/src/array.o CC src/class.c -> build/host/src/class.o CC src/print.c -> build/host/src/print.o CC src/kernel.c -> build/host/src/kernel.o CC src/object.c -> build/host/src/object.o CC mrbgems/mruby-bin-mrbc/tools/mrbc/mrbc.c -> build/host/mrbgems/mruby-bin-mrbc/tools/mrbc/mrbc.o CC mrbgems/mruby-error/test/exception.c -> build/test/mrbgems/mruby-error/test/exception.o CC mrbgems/mruby-proc-ext/test/proc.c -> build/test/mrbgems/mruby-proc-ext/test/proc.o CC mrbgems/mruby-io/test/mruby_io_test.c -> build/test/mrbgems/mruby-io/test/mruby_io_test.o CC mrbgems/mruby-test/driver.c -> build/test/mrbgems/mruby-test/driver.o CC mrbgems/mruby-error/src/exception.c -> build/test/mrbgems/mruby-error/src/exception.o YACC mrbgems/mruby-compiler/core/parse.y -> build/test/mrbgems/mruby-compiler/core/y.tab.c CC mrbgems/mruby-class-ext/src/class.c -> build/test/mrbgems/mruby-class-ext/src/class.o CC mrbgems/mruby-kernel-ext/src/kernel.c -> build/test/mrbgems/mruby-kernel-ext/src/kernel.o CC mrbgems/mruby-fiber/src/fiber.c -> build/test/mrbgems/mruby-fiber/src/fiber.o CC mrbgems/mruby-objectspace/src/mruby_objectspace.c -> build/test/mrbgems/mruby-objectspace/src/mruby_objectspace.o CC mrbgems/mruby-object-ext/src/object.c -> build/test/mrbgems/mruby-object-ext/src/object.o CC mrbgems/mruby-random/src/random.c -> build/test/mrbgems/mruby-random/src/random.o CC mrbgems/mruby-random/src/mt19937ar.c -> build/test/mrbgems/mruby-random/src/mt19937ar.o CC mrbgems/mruby-symbol-ext/src/symbol.c -> build/test/mrbgems/mruby-symbol-ext/src/symbol.o CC mrbgems/mruby-proc-ext/src/proc.c -> build/test/mrbgems/mruby-proc-ext/src/proc.o CC mrbgems/mruby-range-ext/src/range.c -> build/test/mrbgems/mruby-range-ext/src/range.o CC mrbgems/mruby-hash-ext/src/hash-ext.c -> build/test/mrbgems/mruby-hash-ext/src/hash-ext.o CC mrbgems/mruby-array-ext/src/array.c -> build/test/mrbgems/mruby-array-ext/src/array.o CC mrbgems/mruby-numeric-ext/src/numeric_ext.c -> build/test/mrbgems/mruby-numeric-ext/src/numeric_ext.o CC mrbgems/mruby-string-ext/src/string.c -> build/test/mrbgems/mruby-string-ext/src/string.o CC mrbgems/mruby-struct/src/struct.c -> build/test/mrbgems/mruby-struct/src/struct.o CC mrbgems/mruby-time/src/time.c -> build/test/mrbgems/mruby-time/src/time.o CC mrbgems/mruby-math/src/math.c -> build/test/mrbgems/mruby-math/src/math.o CC mrbgems/mruby-print/src/print.c -> build/test/mrbgems/mruby-print/src/print.o CC mrbgems/mruby-sprintf/src/sprintf.c -> build/test/mrbgems/mruby-sprintf/src/sprintf.o CC mrbgems/mruby-sprintf/src/kernel.c -> build/test/mrbgems/mruby-sprintf/src/kernel.o CC mrbgems/mruby-pack/src/pack.c -> build/test/mrbgems/mruby-pack/src/pack.o CC mrbgems/mruby-io/src/file.c -> build/test/mrbgems/mruby-io/src/file.o CC mrbgems/mruby-io/src/mruby_io_gem.c -> build/test/mrbgems/mruby-io/src/mruby_io_gem.o CC mrbgems/mruby-io/src/io.c -> build/test/mrbgems/mruby-io/src/io.o CC mrbgems/mruby-io/src/file_test.c -> build/test/mrbgems/mruby-io/src/file_test.o CC mrbgems/mruby-metaprog/src/metaprog.c -> build/test/mrbgems/mruby-metaprog/src/metaprog.o CC build/host-debug/mrbgems/gem_init.c -> build/host-debug/mrbgems/gem_init.o CC mrbgems/mruby-eval/src/eval.c -> build/host-debug/mrbgems/mruby-eval/src/eval.o YACC mrbgems/mruby-compiler/core/parse.y -> build/host-debug/mrbgems/mruby-compiler/core/y.tab.c CC build/host/mrbgems/gem_init.c -> build/host/mrbgems/gem_init.o CC mrbgems/mruby-bin-strip/tools/mruby-strip/mruby-strip.c -> build/test/mrbgems/mruby-bin-strip/tools/mruby-strip/mruby-strip.o CC mrbgems/mruby-bin-mruby/tools/mruby/mruby.c -> build/test/mrbgems/mruby-bin-mruby/tools/mruby/mruby.o CC mrbgems/mruby-bin-mirb/tools/mirb/mirb.c -> build/test/mrbgems/mruby-bin-mirb/tools/mirb/mirb.o CC mrbgems/mruby-bin-debugger/tools/mrdb/apilist.c -> build/host-debug/mrbgems/mruby-bin-debugger/tools/mrdb/apilist.o CC mrbgems/mruby-bin-debugger/tools/mrdb/cmdrun.c -> build/host-debug/mrbgems/mruby-bin-debugger/tools/mrdb/cmdrun.o CC mrbgems/mruby-bin-debugger/tools/mrdb/mrdb.c -> build/host-debug/mrbgems/mruby-bin-debugger/tools/mrdb/mrdb.o CC mrbgems/mruby-bin-debugger/tools/mrdb/cmdbreak.c -> build/host-debug/mrbgems/mruby-bin-debugger/tools/mrdb/cmdbreak.o CC mrbgems/mruby-bin-debugger/tools/mrdb/apibreak.c -> build/host-debug/mrbgems/mruby-bin-debugger/tools/mrdb/apibreak.o CC mrbgems/mruby-bin-debugger/tools/mrdb/cmdmisc.c -> build/host-debug/mrbgems/mruby-bin-debugger/tools/mrdb/cmdmisc.o CC mrbgems/mruby-bin-debugger/tools/mrdb/apiprint.c -> build/host-debug/mrbgems/mruby-bin-debugger/tools/mrdb/apiprint.o CC mrbgems/mruby-bin-debugger/tools/mrdb/cmdprint.c -> build/host-debug/mrbgems/mruby-bin-debugger/tools/mrdb/cmdprint.o YACC mrbgems/mruby-compiler/core/parse.y -> build/host/mrbgems/mruby-compiler/core/y.tab.c CC build/test/mrbgems/gem_init.c -> build/test/mrbgems/gem_init.o CC build/test/mrbgems/mruby-compiler/core/y.tab.c -> build/test/mrbgems/mruby-compiler/core/y.tab.o CC build/host-debug/mrbgems/mruby-compiler/core/y.tab.c -> build/host-debug/mrbgems/mruby-compiler/core/y.tab.o CC build/host/mrbgems/mruby-compiler/core/y.tab.c -> build/host/mrbgems/mruby-compiler/core/y.tab.o AR build/host/lib/libmruby_core.a LD build/host/bin/mrbc MRBC mrbgems/mruby-error/test/exception.rb MRBC test/t/localjumperror.rb MRBC test/t/string.rb MRBC test/t/bs_literal.rb MRBC test/t/module.rb MRBC test/t/array.rb MRBC test/t/codegen.rb MRBC test/t/class.rb MRBC test/t/numeric.rb MRBC test/t/basicobject.rb MRBC test/t/nil.rb MRBC test/t/syntax.rb MRBC test/t/indexerror.rb MRBC test/t/comparable.rb MRBC test/t/rangeerror.rb MRBC test/t/integer.rb MRBC test/t/false.rb MRBC test/t/hash.rb MRBC test/t/argumenterror.rb MRBC test/t/nomethoderror.rb MRBC test/t/symbol.rb MRBC test/t/standarderror.rb MRBC test/t/literals.rb MRBC test/t/regexperror.rb MRBC test/t/float.rb MRBC test/t/ensure.rb MRBC test/t/iterations.rb MRBC test/t/bs_block.rb MRBC test/t/range.rb MRBC test/t/runtimeerror.rb MRBC test/t/kernel.rb MRBC test/t/methods.rb MRBC test/t/object.rb MRBC test/t/proc.rb MRBC test/t/typeerror.rb MRBC test/t/true.rb MRBC test/t/unicode.rb MRBC test/t/gc.rb MRBC test/t/superclass.rb MRBC test/t/nameerror.rb MRBC test/t/lang.rb MRBC test/t/enumerable.rb MRBC test/t/exception.rb MRBC mrbgems/mruby-class-ext/test/module.rb MRBC mrbgems/mruby-kernel-ext/test/kernel.rb MRBC mrbgems/mruby-toplevel-ext/test/toplevel.rb MRBC mrbgems/mruby-enum-lazy/test/lazy.rb MRBC mrbgems/mruby-enumerator/test/enumerator.rb MRBC mrbgems/mruby-fiber/test/fiber.rb MRBC mrbgems/mruby-objectspace/test/objectspace.rb MRBC mrbgems/mruby-object-ext/test/nil.rb MRBC mrbgems/mruby-object-ext/test/object.rb MRBC mrbgems/mruby-random/test/random.rb MRBC mrbgems/mruby-symbol-ext/test/symbol.rb MRBC mrbgems/mruby-proc-ext/test/proc.rb MRBC mrbgems/mruby-range-ext/test/range.rb MRBC mrbgems/mruby-hash-ext/test/hash.rb MRBC mrbgems/mruby-array-ext/test/array.rb MRBC mrbgems/mruby-numeric-ext/test/numeric.rb MRBC mrbgems/mruby-string-ext/test/string.rb MRBC mrbgems/mruby-enum-ext/test/enum.rb MRBC mrbgems/mruby-struct/test/struct.rb MRBC mrbgems/mruby-time/test/time.rb MRBC mrbgems/mruby-math/test/math.rb MRBC mrbgems/mruby-sprintf/test/sprintf.rb MRBC mrbgems/mruby-pack/test/pack.rb MRBC mrbgems/mruby-io/test/file.rb MRBC mrbgems/mruby-io/test/file_test.rb MRBC mrbgems/mruby-io/test/io.rb MRBC mrbgems/mruby-metaprog/test/metaprog.rb MRBC test/assert.rb GEN *.rb -> build/test/mrbgems/mruby-test/mrbtest.c MRBC mrbgems/mruby-class-ext/mrblib/module.rb MRBC mrbgems/mruby-toplevel-ext/mrblib/toplevel.rb MRBC mrbgems/mruby-enum-lazy/mrblib/lazy.rb MRBC mrbgems/mruby-enumerator/mrblib/enumerator.rb MRBC mrbgems/mruby-object-ext/mrblib/object.rb MRBC mrbgems/mruby-symbol-ext/mrblib/symbol.rb MRBC mrbgems/mruby-proc-ext/mrblib/proc.rb MRBC mrbgems/mruby-range-ext/mrblib/range.rb MRBC mrbgems/mruby-hash-ext/mrblib/hash.rb MRBC mrbgems/mruby-array-ext/mrblib/array.rb MRBC mrbgems/mruby-numeric-ext/mrblib/numeric_ext.rb MRBC mrbgems/mruby-string-ext/mrblib/string.rb MRBC mrbgems/mruby-enum-ext/mrblib/enum.rb MRBC mrbgems/mruby-compar-ext/mrblib/compar.rb MRBC mrbgems/mruby-struct/mrblib/struct.rb MRBC mrbgems/mruby-time/mrblib/time.rb MRBC mrbgems/mruby-print/mrblib/print.rb MRBC mrbgems/mruby-sprintf/mrblib/string.rb MRBC mrbgems/mruby-io/mrblib/file.rb MRBC mrbgems/mruby-io/mrblib/file_constants.rb MRBC mrbgems/mruby-io/mrblib/io.rb MRBC mrbgems/mruby-io/mrblib/kernel.rb GEN *.rb -> build/test/mrblib/mrblib.c MRBC mrblib/00class.rb MRBC mrblib/10error.rb MRBC mrblib/array.rb MRBC mrblib/compar.rb MRBC mrblib/enum.rb MRBC mrblib/hash.rb MRBC mrblib/kernel.rb MRBC mrblib/numeric.rb MRBC mrblib/range.rb MRBC mrblib/string.rb MRBC mrblib/symbol.rb MRBC mrbgems/mruby-class-ext/mrblib/module.rb MRBC mrbgems/mruby-toplevel-ext/mrblib/toplevel.rb MRBC mrbgems/mruby-enum-lazy/mrblib/lazy.rb MRBC mrbgems/mruby-enumerator/mrblib/enumerator.rb MRBC mrbgems/mruby-object-ext/mrblib/object.rb MRBC mrbgems/mruby-symbol-ext/mrblib/symbol.rb MRBC mrbgems/mruby-proc-ext/mrblib/proc.rb MRBC mrbgems/mruby-range-ext/mrblib/range.rb MRBC mrbgems/mruby-hash-ext/mrblib/hash.rb MRBC mrbgems/mruby-array-ext/mrblib/array.rb MRBC mrbgems/mruby-numeric-ext/mrblib/numeric_ext.rb MRBC mrbgems/mruby-string-ext/mrblib/string.rb MRBC mrbgems/mruby-enum-ext/mrblib/enum.rb MRBC mrbgems/mruby-compar-ext/mrblib/compar.rb MRBC mrbgems/mruby-struct/mrblib/struct.rb MRBC mrbgems/mruby-time/mrblib/time.rb MRBC mrbgems/mruby-print/mrblib/print.rb MRBC mrbgems/mruby-sprintf/mrblib/string.rb MRBC mrbgems/mruby-io/mrblib/file.rb MRBC mrbgems/mruby-io/mrblib/file_constants.rb MRBC mrbgems/mruby-io/mrblib/io.rb MRBC mrbgems/mruby-io/mrblib/kernel.rb GEN *.rb -> build/host-debug/mrblib/mrblib.c MRBC mrblib/00class.rb MRBC mrblib/10error.rb MRBC mrblib/array.rb MRBC mrblib/compar.rb MRBC mrblib/enum.rb MRBC mrblib/hash.rb MRBC mrblib/kernel.rb MRBC mrblib/numeric.rb MRBC mrblib/range.rb MRBC mrblib/string.rb MRBC mrblib/symbol.rb MRBC mrbgems/mruby-class-ext/mrblib/module.rb MRBC mrbgems/mruby-toplevel-ext/mrblib/toplevel.rb MRBC mrbgems/mruby-enum-lazy/mrblib/lazy.rb MRBC mrbgems/mruby-enumerator/mrblib/enumerator.rb MRBC mrbgems/mruby-object-ext/mrblib/object.rb MRBC mrbgems/mruby-symbol-ext/mrblib/symbol.rb MRBC mrbgems/mruby-proc-ext/mrblib/proc.rb MRBC mrbgems/mruby-range-ext/mrblib/range.rb MRBC mrbgems/mruby-hash-ext/mrblib/hash.rb MRBC mrbgems/mruby-array-ext/mrblib/array.rb MRBC mrbgems/mruby-numeric-ext/mrblib/numeric_ext.rb MRBC mrbgems/mruby-string-ext/mrblib/string.rb MRBC mrbgems/mruby-enum-ext/mrblib/enum.rb MRBC mrbgems/mruby-compar-ext/mrblib/compar.rb MRBC mrbgems/mruby-struct/mrblib/struct.rb MRBC mrbgems/mruby-time/mrblib/time.rb MRBC mrbgems/mruby-print/mrblib/print.rb MRBC mrbgems/mruby-sprintf/mrblib/string.rb MRBC mrbgems/mruby-io/mrblib/file.rb MRBC mrbgems/mruby-io/mrblib/file_constants.rb MRBC mrbgems/mruby-io/mrblib/io.rb MRBC mrbgems/mruby-io/mrblib/kernel.rb GEN *.rb -> build/host/mrblib/mrblib.c MRBC mrblib/00class.rb MRBC mrblib/10error.rb MRBC mrblib/array.rb MRBC mrblib/compar.rb MRBC mrblib/enum.rb MRBC mrblib/hash.rb MRBC mrblib/kernel.rb MRBC mrblib/numeric.rb MRBC mrblib/range.rb MRBC mrblib/string.rb MRBC mrblib/symbol.rb CC build/test/mrbgems/mruby-error/gem_test.c -> build/test/mrbgems/mruby-error/gem_test.o CC build/test/mrbgems/mruby-test/gem_test.c -> build/test/mrbgems/mruby-test/gem_test.o CC build/test/mrbgems/mruby-compiler/gem_test.c -> build/test/mrbgems/mruby-compiler/gem_test.o CC build/test/mrbgems/mruby-class-ext/gem_test.c -> build/test/mrbgems/mruby-class-ext/gem_test.o CC build/test/mrbgems/mruby-kernel-ext/gem_test.c -> build/test/mrbgems/mruby-kernel-ext/gem_test.o CC build/test/mrbgems/mruby-bin-strip/gem_test.c -> build/test/mrbgems/mruby-bin-strip/gem_test.o CC build/test/mrbgems/mruby-bin-mruby/gem_test.c -> build/test/mrbgems/mruby-bin-mruby/gem_test.o CC build/test/mrbgems/mruby-bin-mirb/gem_test.c -> build/test/mrbgems/mruby-bin-mirb/gem_test.o CC build/test/mrbgems/mruby-toplevel-ext/gem_test.c -> build/test/mrbgems/mruby-toplevel-ext/gem_test.o CC build/test/mrbgems/mruby-enum-lazy/gem_test.c -> build/test/mrbgems/mruby-enum-lazy/gem_test.o CC build/test/mrbgems/mruby-enumerator/gem_test.c -> build/test/mrbgems/mruby-enumerator/gem_test.o CC build/test/mrbgems/mruby-fiber/gem_test.c -> build/test/mrbgems/mruby-fiber/gem_test.o CC build/test/mrbgems/mruby-objectspace/gem_test.c -> build/test/mrbgems/mruby-objectspace/gem_test.o CC build/test/mrbgems/mruby-object-ext/gem_test.c -> build/test/mrbgems/mruby-object-ext/gem_test.o CC build/test/mrbgems/mruby-random/gem_test.c -> build/test/mrbgems/mruby-random/gem_test.o CC build/test/mrbgems/mruby-symbol-ext/gem_test.c -> build/test/mrbgems/mruby-symbol-ext/gem_test.o CC build/test/mrbgems/mruby-proc-ext/gem_test.c -> build/test/mrbgems/mruby-proc-ext/gem_test.o CC build/test/mrbgems/mruby-range-ext/gem_test.c -> build/test/mrbgems/mruby-range-ext/gem_test.o CC build/test/mrbgems/mruby-hash-ext/gem_test.c -> build/test/mrbgems/mruby-hash-ext/gem_test.o CC build/test/mrbgems/mruby-array-ext/gem_test.c -> build/test/mrbgems/mruby-array-ext/gem_test.o CC build/test/mrbgems/mruby-numeric-ext/gem_test.c -> build/test/mrbgems/mruby-numeric-ext/gem_test.o CC build/test/mrbgems/mruby-string-ext/gem_test.c -> build/test/mrbgems/mruby-string-ext/gem_test.o CC build/test/mrbgems/mruby-enum-ext/gem_test.c -> build/test/mrbgems/mruby-enum-ext/gem_test.o CC build/test/mrbgems/mruby-compar-ext/gem_test.c -> build/test/mrbgems/mruby-compar-ext/gem_test.o CC build/test/mrbgems/mruby-struct/gem_test.c -> build/test/mrbgems/mruby-struct/gem_test.o CC build/test/mrbgems/mruby-time/gem_test.c -> build/test/mrbgems/mruby-time/gem_test.o CC build/test/mrbgems/mruby-math/gem_test.c -> build/test/mrbgems/mruby-math/gem_test.o CC build/test/mrbgems/mruby-print/gem_test.c -> build/test/mrbgems/mruby-print/gem_test.o CC build/test/mrbgems/mruby-sprintf/gem_test.c -> build/test/mrbgems/mruby-sprintf/gem_test.o CC build/test/mrbgems/mruby-pack/gem_test.c -> build/test/mrbgems/mruby-pack/gem_test.o CC build/test/mrbgems/mruby-io/gem_test.c -> build/test/mrbgems/mruby-io/gem_test.o CC build/test/mrbgems/mruby-metaprog/gem_test.c -> build/test/mrbgems/mruby-metaprog/gem_test.o CC build/test/mrbgems/mruby-test/assert.c -> build/test/mrbgems/mruby-test/assert.o CC build/test/mrbgems/mruby-test/mrbtest.c -> build/test/mrbgems/mruby-test/mrbtest.o CC build/test/mrbgems/mruby-error/gem_init.c -> build/test/mrbgems/mruby-error/gem_init.o CC build/test/mrbgems/mruby-class-ext/gem_init.c -> build/test/mrbgems/mruby-class-ext/gem_init.o CC build/test/mrbgems/mruby-kernel-ext/gem_init.c -> build/test/mrbgems/mruby-kernel-ext/gem_init.o CC build/test/mrbgems/mruby-toplevel-ext/gem_init.c -> build/test/mrbgems/mruby-toplevel-ext/gem_init.o CC build/test/mrbgems/mruby-enum-lazy/gem_init.c -> build/test/mrbgems/mruby-enum-lazy/gem_init.o CC build/test/mrbgems/mruby-enumerator/gem_init.c -> build/test/mrbgems/mruby-enumerator/gem_init.o CC build/test/mrbgems/mruby-fiber/gem_init.c -> build/test/mrbgems/mruby-fiber/gem_init.o CC build/test/mrbgems/mruby-objectspace/gem_init.c -> build/test/mrbgems/mruby-objectspace/gem_init.o CC build/test/mrbgems/mruby-object-ext/gem_init.c -> build/test/mrbgems/mruby-object-ext/gem_init.o CC build/test/mrbgems/mruby-random/gem_init.c -> build/test/mrbgems/mruby-random/gem_init.o CC build/test/mrbgems/mruby-symbol-ext/gem_init.c -> build/test/mrbgems/mruby-symbol-ext/gem_init.o CC build/test/mrbgems/mruby-proc-ext/gem_init.c -> build/test/mrbgems/mruby-proc-ext/gem_init.o CC build/test/mrbgems/mruby-range-ext/gem_init.c -> build/test/mrbgems/mruby-range-ext/gem_init.o CC build/test/mrbgems/mruby-hash-ext/gem_init.c -> build/test/mrbgems/mruby-hash-ext/gem_init.o CC build/test/mrbgems/mruby-array-ext/gem_init.c -> build/test/mrbgems/mruby-array-ext/gem_init.o CC build/test/mrbgems/mruby-numeric-ext/gem_init.c -> build/test/mrbgems/mruby-numeric-ext/gem_init.o CC build/test/mrbgems/mruby-string-ext/gem_init.c -> build/test/mrbgems/mruby-string-ext/gem_init.o CC build/test/mrbgems/mruby-enum-ext/gem_init.c -> build/test/mrbgems/mruby-enum-ext/gem_init.o CC build/test/mrbgems/mruby-compar-ext/gem_init.c -> build/test/mrbgems/mruby-compar-ext/gem_init.o CC build/test/mrbgems/mruby-struct/gem_init.c -> build/test/mrbgems/mruby-struct/gem_init.o CC build/test/mrbgems/mruby-time/gem_init.c -> build/test/mrbgems/mruby-time/gem_init.o CC build/test/mrbgems/mruby-math/gem_init.c -> build/test/mrbgems/mruby-math/gem_init.o CC build/test/mrbgems/mruby-print/gem_init.c -> build/test/mrbgems/mruby-print/gem_init.o CC build/test/mrbgems/mruby-sprintf/gem_init.c -> build/test/mrbgems/mruby-sprintf/gem_init.o CC build/test/mrbgems/mruby-pack/gem_init.c -> build/test/mrbgems/mruby-pack/gem_init.o CC build/test/mrbgems/mruby-io/gem_init.c -> build/test/mrbgems/mruby-io/gem_init.o CC build/test/mrbgems/mruby-metaprog/gem_init.c -> build/test/mrbgems/mruby-metaprog/gem_init.o CC build/test/mrblib/mrblib.c -> build/test/mrblib/mrblib.o CC build/host-debug/mrbgems/mruby-eval/gem_init.c -> build/host-debug/mrbgems/mruby-eval/gem_init.o CC build/host-debug/mrbgems/mruby-error/gem_init.c -> build/host-debug/mrbgems/mruby-error/gem_init.o CC build/host-debug/mrbgems/mruby-class-ext/gem_init.c -> build/host-debug/mrbgems/mruby-class-ext/gem_init.o CC build/host-debug/mrbgems/mruby-kernel-ext/gem_init.c -> build/host-debug/mrbgems/mruby-kernel-ext/gem_init.o CC build/host-debug/mrbgems/mruby-toplevel-ext/gem_init.c -> build/host-debug/mrbgems/mruby-toplevel-ext/gem_init.o CC build/host-debug/mrbgems/mruby-enum-lazy/gem_init.c -> build/host-debug/mrbgems/mruby-enum-lazy/gem_init.o CC build/host-debug/mrbgems/mruby-enumerator/gem_init.c -> build/host-debug/mrbgems/mruby-enumerator/gem_init.o CC build/host-debug/mrbgems/mruby-fiber/gem_init.c -> build/host-debug/mrbgems/mruby-fiber/gem_init.o CC build/host-debug/mrbgems/mruby-objectspace/gem_init.c -> build/host-debug/mrbgems/mruby-objectspace/gem_init.o CC build/host-debug/mrbgems/mruby-object-ext/gem_init.c -> build/host-debug/mrbgems/mruby-object-ext/gem_init.o CC build/host-debug/mrbgems/mruby-random/gem_init.c -> build/host-debug/mrbgems/mruby-random/gem_init.o CC build/host-debug/mrbgems/mruby-symbol-ext/gem_init.c -> build/host-debug/mrbgems/mruby-symbol-ext/gem_init.o CC build/host-debug/mrbgems/mruby-proc-ext/gem_init.c -> build/host-debug/mrbgems/mruby-proc-ext/gem_init.o CC build/host-debug/mrbgems/mruby-range-ext/gem_init.c -> build/host-debug/mrbgems/mruby-range-ext/gem_init.o CC build/host-debug/mrbgems/mruby-hash-ext/gem_init.c -> build/host-debug/mrbgems/mruby-hash-ext/gem_init.o CC build/host-debug/mrbgems/mruby-array-ext/gem_init.c -> build/host-debug/mrbgems/mruby-array-ext/gem_init.o CC build/host-debug/mrbgems/mruby-numeric-ext/gem_init.c -> build/host-debug/mrbgems/mruby-numeric-ext/gem_init.o CC build/host-debug/mrbgems/mruby-string-ext/gem_init.c -> build/host-debug/mrbgems/mruby-string-ext/gem_init.o CC build/host-debug/mrbgems/mruby-enum-ext/gem_init.c -> build/host-debug/mrbgems/mruby-enum-ext/gem_init.o CC build/host-debug/mrbgems/mruby-compar-ext/gem_init.c -> build/host-debug/mrbgems/mruby-compar-ext/gem_init.o CC build/host-debug/mrbgems/mruby-struct/gem_init.c -> build/host-debug/mrbgems/mruby-struct/gem_init.o CC build/host-debug/mrbgems/mruby-time/gem_init.c -> build/host-debug/mrbgems/mruby-time/gem_init.o CC build/host-debug/mrbgems/mruby-math/gem_init.c -> build/host-debug/mrbgems/mruby-math/gem_init.o CC build/host-debug/mrbgems/mruby-print/gem_init.c -> build/host-debug/mrbgems/mruby-print/gem_init.o CC build/host-debug/mrbgems/mruby-sprintf/gem_init.c -> build/host-debug/mrbgems/mruby-sprintf/gem_init.o CC build/host-debug/mrbgems/mruby-pack/gem_init.c -> build/host-debug/mrbgems/mruby-pack/gem_init.o CC build/host-debug/mrbgems/mruby-io/gem_init.c -> build/host-debug/mrbgems/mruby-io/gem_init.o CC build/host-debug/mrbgems/mruby-metaprog/gem_init.c -> build/host-debug/mrbgems/mruby-metaprog/gem_init.o CC build/host-debug/mrblib/mrblib.c -> build/host-debug/mrblib/mrblib.o CC build/host/mrbgems/mruby-error/gem_init.c -> build/host/mrbgems/mruby-error/gem_init.o CC build/host/mrbgems/mruby-class-ext/gem_init.c -> build/host/mrbgems/mruby-class-ext/gem_init.o CC build/host/mrbgems/mruby-kernel-ext/gem_init.c -> build/host/mrbgems/mruby-kernel-ext/gem_init.o CC build/host/mrbgems/mruby-toplevel-ext/gem_init.c -> build/host/mrbgems/mruby-toplevel-ext/gem_init.o CC build/host/mrbgems/mruby-enum-lazy/gem_init.c -> build/host/mrbgems/mruby-enum-lazy/gem_init.o CC build/host/mrbgems/mruby-enumerator/gem_init.c -> build/host/mrbgems/mruby-enumerator/gem_init.o CC build/host/mrbgems/mruby-fiber/gem_init.c -> build/host/mrbgems/mruby-fiber/gem_init.o CC build/host/mrbgems/mruby-objectspace/gem_init.c -> build/host/mrbgems/mruby-objectspace/gem_init.o CC build/host/mrbgems/mruby-object-ext/gem_init.c -> build/host/mrbgems/mruby-object-ext/gem_init.o CC build/host/mrbgems/mruby-random/gem_init.c -> build/host/mrbgems/mruby-random/gem_init.o CC build/host/mrbgems/mruby-symbol-ext/gem_init.c -> build/host/mrbgems/mruby-symbol-ext/gem_init.o CC build/host/mrbgems/mruby-proc-ext/gem_init.c -> build/host/mrbgems/mruby-proc-ext/gem_init.o CC build/host/mrbgems/mruby-range-ext/gem_init.c -> build/host/mrbgems/mruby-range-ext/gem_init.o CC build/host/mrbgems/mruby-hash-ext/gem_init.c -> build/host/mrbgems/mruby-hash-ext/gem_init.o CC build/host/mrbgems/mruby-array-ext/gem_init.c -> build/host/mrbgems/mruby-array-ext/gem_init.o CC build/host/mrbgems/mruby-numeric-ext/gem_init.c -> build/host/mrbgems/mruby-numeric-ext/gem_init.o CC build/host/mrbgems/mruby-string-ext/gem_init.c -> build/host/mrbgems/mruby-string-ext/gem_init.o CC build/host/mrbgems/mruby-enum-ext/gem_init.c -> build/host/mrbgems/mruby-enum-ext/gem_init.o CC build/host/mrbgems/mruby-compar-ext/gem_init.c -> build/host/mrbgems/mruby-compar-ext/gem_init.o CC build/host/mrbgems/mruby-struct/gem_init.c -> build/host/mrbgems/mruby-struct/gem_init.o CC build/host/mrbgems/mruby-time/gem_init.c -> build/host/mrbgems/mruby-time/gem_init.o CC build/host/mrbgems/mruby-math/gem_init.c -> build/host/mrbgems/mruby-math/gem_init.o CC build/host/mrbgems/mruby-print/gem_init.c -> build/host/mrbgems/mruby-print/gem_init.o CC build/host/mrbgems/mruby-sprintf/gem_init.c -> build/host/mrbgems/mruby-sprintf/gem_init.o CC build/host/mrbgems/mruby-pack/gem_init.c -> build/host/mrbgems/mruby-pack/gem_init.o CC build/host/mrbgems/mruby-io/gem_init.c -> build/host/mrbgems/mruby-io/gem_init.o CC build/host/mrbgems/mruby-metaprog/gem_init.c -> build/host/mrbgems/mruby-metaprog/gem_init.o CC build/host/mrblib/mrblib.c -> build/host/mrblib/mrblib.o AR build/test/mrbgems/mruby-test/mrbtest.a AR build/test/lib/libmruby.a AR build/host-debug/lib/libmruby.a AR build/host/lib/libmruby.a LD build/test/bin/mruby-strip LD build/test/bin/mruby LD build/test/bin/mirb Undefined symbols for architecture x86_64: "_rl_free", referenced from: _main in mirb.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) rake aborted! Command Failed: [gcc -o /Users/seb/src/github.com/mruby/mruby/build/test/bin/mirb /Users/seb/src/github.com/mruby/mruby/build/test/mrbgems/mruby-bin-mirb/tools/mirb/mirb.o /Users/seb/src/github.com/mruby/mruby/build/test/lib/libmruby.a -lm -lreadline -lncurses ]

make: *** [all] Error 1 </pre> </details>

$ gcc -v -o /Users/seb/src/github.com/mruby/mruby/build/test/bin/mirb /Users/seb/src/github.com/mruby/mruby/build/test/mrbgems/mruby-bin-mirb/tools/mirb/mirb.o /Users/seb/src/github.com/mruby/mruby/build/test/lib/libmruby.a -lm -lreadline -lncurses
Apple LLVM version 10.0.1 (clang-1001.0.46.4)
Target: x86_64-apple-darwin18.6.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld" -demangle -lto_library /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/libLTO.dylib -dynamic -arch x86_64 -macosx_version_min 10.14.0 -o /Users/seb/src/github.com/mruby/mruby/build/test/bin/mirb /Users/seb/src/github.com/mruby/mruby/build/test/mrbgems/mruby-bin-mirb/tools/mirb/mirb.o /Users/seb/src/github.com/mruby/mruby/build/test/lib/libmruby.a -lm -lreadline -lncurses -lSystem /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/10.0.1/lib/darwin/libclang_rt.osx.a
Undefined symbols for architecture x86_64:
  "_rl_free", referenced from:
      _main in mirb.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
$ which gcc
/usr/bin/gcc
$ sw_vers
ProductName:    Mac OS X
ProductVersion: 10.14.5
BuildVersion:   18F132
$ xcodebuild -version
Xcode 10.2.1
Build version 10E1001

closed time in 14 days

lavoiesl

issue closedmruby/mruby

integer underflow in ary_expand_capa in src/array.c:215

build mruby in ubuntu18.04 64 bit with ASAN

poc:

a=0
b="asdfasdfasdf adaf asdf asdfa sdf asdfasdfasdfa sdf"
c={1=>1, 2=>"foo", "foo"=>nil, nil=> nil}
d=[1,nil," sdfg"]
srand(1337)
a = d.__id__(){||  }
a = d.initialize(a,){||  }

result:

result:
==128448==ERROR: AddressSanitizer: requested allocation size 0x8000000000000 (0x8000000001000 after adjustments for alignment, red zones etc.) exceeds maximum supported size of 0x10000000000 (thread T0)
    #0 0x4a9388 in realloc /home/casper/fuzz/fuzzdeps/llvm-9.0.0.src/projects/compiler-rt/lib/asan/asan_malloc_linux.cc:164
    #1 0x543a35 in mrb_default_allocf /home/casper/targets/gramma/mruby/dbg/BUILD/src/state.c:56:12
    #2 0x4f56ab in mrb_realloc_simple /home/casper/targets/gramma/mruby/dbg/BUILD/src/gc.c:209:8
    #3 0x4f5dae in mrb_realloc /home/casper/targets/gramma/mruby/dbg/BUILD/src/gc.c:223:8
    #4 0x4f6563 in mrb_malloc /home/casper/targets/gramma/mruby/dbg/BUILD/src/gc.c:245:10
    #5 0x5478e1 in ary_expand_capa /home/casper/targets/gramma/mruby/dbg/BUILD/src/array.c:215:44
    #6 0x54d8ed in mrb_ary_set /home/casper/targets/gramma/mruby/dbg/BUILD/src/array.c:680:7
    #7 0x5585b4 in mrb_ary_aset /home/casper/targets/gramma/mruby/dbg/BUILD/src/array.c:935:7
    #8 0x59356f in mrb_vm_exec /home/casper/targets/gramma/mruby/dbg/BUILD/src/vm.c:1444:18
    #9 0x583324 in mrb_vm_run /home/casper/targets/gramma/mruby/dbg/BUILD/src/vm.c:947:12
    #10 0x5da14f in mrb_top_run /home/casper/targets/gramma/mruby/dbg/BUILD/src/vm.c:2850:12
    #11 0x6a450d in mrb_load_exec /home/casper/targets/gramma/mruby/dbg/BUILD/mrbgems/mruby-compiler/core/parse.y:6438:7
    #12 0x6a521d in mrb_load_file_cxt /home/casper/targets/gramma/mruby/dbg/BUILD/mrbgems/mruby-compiler/core/parse.y:6447:10
    #13 0x4f24ff in main /home/casper/targets/gramma/mruby/dbg/BUILD/mrbgems/mruby-bin-mruby/tools/mruby/mruby.c:327:11
    #14 0x7f3e7269cb96 in __libc_start_main /build/glibc-OTsEL5/glibc-2.27/csu/../csu/libc-start.c:310

==128448==HINT: if you don't care about these errors you may set allocator_may_return_null=1
SUMMARY: AddressSanitizer: allocation-size-too-big /home/casper/fuzz/fuzzdeps/llvm-9.0.0.src/projects/compiler-rt/lib/asan/asan_malloc_linux.cc:164 in realloc
==128448==ABORTING

closed time in 14 days

sleicasper

issue closedmruby/mruby

Introduce malloc_trim on linux to fix dirty page leak

To begin please understand that mruby is not doing anything incorrectly. There is no issue with the way mruby allocates and releases memory and does not have a memory leak. This is a discussion on using the glibc malloc/realloc/free as default will not return dirty allocated pages back to the kernel managed heap automatically. This issue exists on any dynamic language using glib allocator.

Summary

  • The glib allocator doesn't return dirty pages back to the OS heap automatically until the program allocations meet rare conditions
  • Calling glib specific malloc_trim forces glib allocator to return dirty heap pages
  • I propose adding a call to malloc_trim on a major GC and as a final step in mrb_close
  • Asking for advice on the lowest impact way of adding this code

Research

Following up on @FooBarWidget absolutely wonderful research about the glibc allocator I wanted to test the same with mruby. The short summary from his research is by default glibc free does not automatically mark free pages as unused with madvise without hitting a frankly absurd page usage threshold.

This is not a new discovery. It is obscure though discussed elsewhere through the years, and on C Ruby

  • https://stackoverflow.com/a/47061458
  • https://stackoverflow.com/a/3860495
  • https://bugs.ruby-lang.org/issues/15667

We can force marking the free pages by calling the glib specific malloc_trim. The results I observed with mruby are the same as presented with C Ruby, which is not a surprise.

Here is what I used for a test program along with a Rake file for automation. First, I built libmruby.a from master using defaults, and then libmruby-gcpatched.a using this patch. It calls malloc_trim on a major GC cycle

diff --git a/src/gc.c b/src/gc.c
index fd4fb240..8d653dfb 100644
--- a/src/gc.c
+++ b/src/gc.c
@@ -19,6 +19,7 @@
 #include <mruby/gc.h>
 #include <mruby/error.h>
 #include <mruby/throw.h>
+#include <malloc.h>

 /*
   = Tri-color Incremental Garbage Collection
@@ -1314,7 +1315,7 @@ mrb_full_gc(mrb_state *mrb)
     gc->majorgc_old_threshold = gc->live_after_mark/100 * MAJOR_GC_INC_RATIO;
     gc->full = FALSE;
   }
-
+  malloc_trim(0);
   GC_TIME_STOP_AND_REPORT;
 }

I also used the excellent heap analyzer tool from @FooBarWidget, placing ptmallocdump.c and visualize_heap.rb along side.

// main.c
#include <stdlib.h>
#include <stdint.h>
#include <sys/types.h>
#include <unistd.h>
#include <mruby.h>
#include <mruby/compile.h>
#include <malloc.h>

#include "./ptmallocdump.c"

int main(int argc, char **argv) {
  uint64_t base_address = 0;
  uint64_t pid_offset = 0;
  uint64_t total = 0;
  char cmd[255];
  char buf[255];
  FILE *f;
  struct malloc_state* ptr = 0;
  uint64_t trim = 0;
  memset(cmd, 0, 255);
  memset(buf, 0, 255);
  if(argc > 1 && (strcmp(argv[1], "trim") == 0)) {
    trim = 1;
  }

  // debug libc in a different place depending on platform
  // debian buster kind of hides it in a non obvious location
  // /usr/lib/debug/.build-id/ef/dd27c16f5283e5c53dcbd1bbc3ef136e312d1b.debug
  // use objdump or gdb on libc.so to find the real location
  // these use 2.27 on ubuntu x64, 2.28 on ARM also works so far
  f = popen("objdump -t /usr/lib/debug/lib/x86_64-linux-gnu/libc-2.27.so | grep ' main_arena' | awk '{ print $1 }'", "r");
  while(fgets(buf, sizeof(buf), f) != NULL) {
    base_address = strtoull(buf, 0, 16);
    break;
  }

  memset(buf, 0, 255);
  sprintf(cmd, "grep '/libc-2.27.so$' /proc/%i/maps | grep ' r-xp ' | cut -d- -f 1", getpid());;
  f = popen(cmd, "r");
  while(fgets(buf, sizeof(buf), f) != NULL) {
    pid_offset = strtoull(buf, 0, 16);
    break;
  }

  total = base_address + pid_offset;
  ptr = (struct malloc_state*) total;

  mrb_state *mrb = mrb_open();

  // create a lot of 'heavy' objects, then free half of them
  // we want contigious segments of memory demonstrating how the default glib
  // allocator does not mark empty pages back to the OS without triggering absurdly
  // high thresholds defaults or forcing the allocator using malloc_trim
  mrb_load_string(mrb, "$a = []; $b = []; $c = []; $d = []; 2_500.times { $a.push(Fiber.new {}) }; 2_500.times { $b.push(Fiber.new {})}; 2_500.times { $c.push(Fiber.new {})}; 2_500.times { $d.push(Fiber.new {})}; $b = nil; $d = nil; GC.start;");

  if(trim) {
    malloc_trim(0);
    remove("trimmed.dmp");
    dump_main_heap("trimmed.dmp", ptr);
  }
  else {
    remove("default.dmp");
    dump_main_heap("default.dmp", ptr);
  }


  mrb_close(mrb);
  // chance for viewing mem usage before exit
  getchar();
  printf("exit\n");
  return 0;
}
task :default do
  sh 'cc -I../mruby/include -lm -g -o unpatched main.c libmruby.a'
  sh 'cc -I../mruby/include -lm -g -o patched main.c libmruby-gcpatched.a'
  rm_rf 'trimmed'
  rm_rf 'default'
  rm_rf 'default-patched'
  mkdir 'trimmed'
  mkdir 'default'
  mkdir 'default-patched'
  sh './unpatched'
  sh './unpatched trim'
  sh 'ruby visualize_heap.rb trimmed.dmp trimmed/'
  sh 'ruby visualize_heap.rb default.dmp default/'
  sh './patched'
  sh 'ruby visualize_heap.rb default.dmp default-patched/'
end

It finds the base address of glibc and then finds the base address of the shared glibc within the current program and uses it as the base address of the memory heap. Then, after creating a new mrb_state, creates 10,000 empty Fiber objects within the VM, partitioned into four global arrays. Then remove the second and fourth arrays and forcing garbage collection. After, code takes two paths. One is entirely default behavior with no changes from mruby master and then dumps the heap layout. The second when passed a trim parameter. When passed trim it calls malloc_trim(0) before dumping the heap layout. This gives us an indication on how mruby behaves and whether calling malloc_trim helps here.

The visualization divides the OS heap pages used by the program. Red dots are usage within the heap page. Grey dots are usage within the heap page marked as 'free, dirty' and not yet reclaimed by the kernel. White is previously allocated dirty pages marked as unused to the kernel.

This is the result of default behavior on a standard Ubuntu 18.04 system

default

The result of calling malloc_trim before dumping the heap.

malloc-trim

And finally, default behavior with the patch, which calls malloc_trim after every major GC cycle.

patched

We can also observe this by looking at heap memory usage as reported by the kernel. We can see that the defaults consume 19MB of heap memory reported by the kernel, while calling malloc_trim consumes 10mb of memory reported.

Since all of the VM is encapsulated in mrb_state we can go further with our research than observing C Ruby's global VM state. Moving the call to mrb_close in the above program to right after the mrb_load_string call we see some major results, like this

mrb_load_string(mrb, "$a = []; $b = []; $c = []; $d = []; 2_500.times { $a.push(Fiber.new {}) }; 2_500.times { $b.push(Fiber.new {})}; 2_500.times { $c.push(Fiber.new {})}; 2_500.times { $d.push(Fiber.new {})}; $b = nil; $d = nil; GC.start;");
mrb_close(mrb);

Calling mrb_close on the default path

clsoe-no-trim

Calling it on the trimmed path

close-trim

Heap difference reported by the kernel.

close-trim-report

I also replicated all results on the standard Raspberry Pi raspbian distribution. The results are 100% identical, so they're not worth including. It does give more evidence that in Linux systems with more of a focus on low power do not change glib defaults.

For fun I repeated the same experiment except I created 500,000 Fiber objects, then freed all of them using mrb_close with and without trim. The results are similar. Even at program exit without calling malloc_trim the program consumes 900 mb of memory, whereas calling malloc_trim right after mrb_close memory usage drops back to 0.3 mb.

high-object-count

(The heap visualizer as it is right now does not function well with this amount of memory usage)

Even after allocating 933MB of memory and marking all of it free, as the mrb_close function correctly does, that still does not trigger glibc defaults on marking memory as unused to the kernel! This is a major problem!

And finally, changing the code for using 4 mrb_states and closing half of them. Given the previous knowledge it also provides a predictable pattern. Changing the test program a bit

mrb_state *states[] = { mrb_open(), mrb_open(), mrb_open(), mrb_open() };

for(uint32_t i = 0; i < 4; ++i) {
  mrb_load_string(states[i], "$a = []; $b = []; $c = []; $d = []; 2_500.times { $a.push(Fiber.new {}) }; 2_500.times { $b.push(Fiber.new {})}; 2_500.times { $c.push(Fiber.new {})}; 2_500.times { $d.push(Fiber.new {})}; $b = nil; $d = nil; GC.start;");
}

mrb_close(states[0]);
mrb_close(states[2]);

Full defaults

state-array-no-trim

Using malloc_trim

state-array-trim

Knowing this I tried mruby-thread. Because it reads the parent mrb_state from the parent thread, copies that state into a child thread, and then deletes the child thread on join, the kernel reclaims the memory on joining the child thread.

About the glib defaults. We can control them through documented parameters, either through env vars or glibc compile time defines. I followed the research done with C Ruby by setting M_ARENA_MAX=2 and running the default program. An interesting difference is I do not observe a change in behavior running with that env var set with the default program, the heap output is the same as the default unpatched program. I also don't think it's responsible to make the end user set some obscure system parameters anyway.

It's a common scenario using linux and default glib even for linux systems destined for lower power devices. The default glibc allocator behavior defaults are dramatically out of line for this situation. This situation is obscure enough that I strongly suspect other embedded linux systems do not change any defaults either.

Because of that I feel we should introduce malloc_trim into mruby. The conditions for usage are if the compilation target uses glibc and mrb_malloc uses the default glibc allocator. I observed that calling malloc_trim after a major GC produces the same results as calling it outside of the VM execution. C Ruby reports the same behavior. I think that calling malloc_trim after a full GC is the most appropriate place as I'm not sure what the performance implications are if we call on every mruby page free. Also, because a host program can open and close mrb_state at will we should also call malloc_trim after freeing all the memory used.

I think the detection should go into the Rake tasks and set a define for the compiler, say MRB_GLIB_MALLOC_TRIM, and then within the C code do #ifdef MRB_GLIB_MALLOC_TRIM on that. These are simple additions that I will make a PR for. I am providing extensive documentation as to why here. I am also asking if there are ideas for a different way of detecting the environment for glibc and calling from the code.

closed time in 14 days

RoryO

issue closedmruby/mruby

Hash content is broken if an exception occurs when rebuilding the hash buckets

Example

class A
  def hash
    $error ? raise("#{inspect}#hash") : super
  end
end

a = A.new
h = {a => :a}
2.upto(24) {|n| h[n] = n}
p h[a]                     #=> :a
p h.to_a[0]                #=> [#<A:0x7f8ac2807bb0>, :a]
$error = true
begin
  h[25] = 25
rescue => e
  puts "#{e.class}: #{e}"  #=> RuntimeError: #<A:0x7f8ac2807bb0>#hash
ensure
  $error = false
end
p h[a]                     #=> nil (BROKEN)
p h.to_a[0]                #=> [#<A:0x7f8ac2807bb0>, :a]

closed time in 15 days

shuujii

issue commentmruby/mruby

Hash content is broken if an exception occurs when rebuilding the hash buckets

If #hash works inconsistently like in this example, the Hash behavior is undefined. It may break the entire hash table. You can restore those broken hashes using #rehash.

shuujii

comment created time in 15 days

push eventmruby/mruby

Yukihiro "Matz" Matsumoto

commit sha 8b65e4b73c93f38df8960c698d9bcf34851b6764

Add test to ensure #5077

view details

Yukihiro "Matz" Matsumoto

commit sha 5bfb70e9dbc8636730bab7725b3eaf5423a2e30f

Fix `File.extname` bug; fix #5077

view details

push time in 16 days

issue closedmruby/mruby

Wrong behavior of File.extname when the filename starts or ends with a period

Behavior of File.extname is incompatible with CRuby.

In CRuby

$ irb
irb(main):001:0> File.extname('.a.rb')
=> ".rb"
irb(main):002:0> File.extname('foo.')
=> "."

In mruby

$ mirb
mirb - Embeddable Interactive Ruby Shell

> File.extname('.a.rb')
 => ""
> File.extname('foo.')
 => ".foo"

closed time in 16 days

masahino
CommitCommentEvent

push eventmruby/mruby

Yukihiro "Matz" Matsumoto

commit sha 4e158320000322f3601647332727b59a4d797cb7

Update `y.tab.c`; ref #4933

view details

push time in 18 days

push eventmruby/mruby

dearblue

commit sha 893cc2780cbf866a28a74a98128ffe8eefb20d03

Add `mrbc_cleanup_local_variables()` with `mrbc_context`; ref #4931 Clean up defined local variables.

view details

dearblue

commit sha 2bab6e197de0d6903e3cb2642af83ff277e133fb

Fix take over file scope variables with `mruby` command Resolve #4931

view details

dearblue

commit sha 25d9370f97d204524a200594faa2bb0adee0e23a

Fix take over file scope variable names with `mirb` command Ref #4931 With this change, the `_` variable is defined after the `-r` switch.

view details

dearblue

commit sha 0aa5aa1de29d61e40a0c1e9be40ee9e14fe284bd

Add test for top level local variables are in file scope; ref #4931

view details

dearblue

commit sha 9840e5352b2abf96235068f0e9d08f14b1d333cf

Isolate top-level local variables by file scope; fix #4931

view details

Yukihiro "Matz" Matsumoto

commit sha c27e45193177b6e4d09d526a248af63c0961035a

Merge pull request #4933 from dearblue/variables Fix take over file scope variables with `mruby` and `mirb` command

view details

push time in 19 days

issue closedmruby/mruby

Top level local variable is not file scope with `mruby` command

Is the following behavior intentional?

Files

# a.rb
a = 1
# b.rb
p a

mruby

$ bin/mruby -r ./a.rb b.rb
1

Ruby

$ ruby -r ./a.rb b.rb
Traceback (most recent call last):
b.rb:1:in `<main>': undefined local variable or method `a' for main:Object (NameError)

closed time in 19 days

shuujii

PR merged mruby/mruby

Fix take over file scope variables with `mruby` and `mirb` command
  • Add mrbc_cleanup_local_variables() function with MRB_API
  • In mirb command, the _ variable is defined after the -r switch
+69 -4

6 comments

7 changed files

dearblue

pr closed time in 19 days

pull request commentmruby/mruby

Embed short symbol name (<= 2 words - 2 bytes) to `struct symbol_name`

Embedded symbols are already implemented.

shuujii

comment created time in 19 days

PR closed mruby/mruby

Add non ISO Time#initialize usage test.

Didn't add ISO number since it's not specified in ruby spec draft.

+12 -0

0 comment

1 changed file

take-cheeze

pr closed time in 20 days

pull request commentmruby/mruby

Count skipped tests and print them in test result report.

The issue was addressed by #4314

take-cheeze

comment created time in 20 days

issue commentmruby/mruby

[mruby3] Using `-S` by default in mrbc phase would mess up ecosystem

It reduces RAM consumption by half for many cases. It is a significant effect on micro controllers.

udzura

comment created time in 21 days

push eventmruby/mruby

dearblue

commit sha f99c315400fe43574c165f5a49032be9e88455c5

Remove `enum call_type` It seems to be unnecessary from mruby-1.0.0 or earlier.

view details

Yukihiro "Matz" Matsumoto

commit sha c345fe432171cc2b90b614a0b44305b218090de6

Merge pull request #5076 from dearblue/call_type Remove `enum call_type`

view details

push time in 21 days

PR merged mruby/mruby

Remove `enum call_type`

It seems to be unnecessary from mruby-1.0.0 or earlier.

+0 -7

0 comment

1 changed file

dearblue

pr closed time in 21 days

PR closed mruby/mruby

use NULL instead of zero

This is a cosmetic change.

+2 -2

0 comment

2 changed files

cubicdaiya

pr closed time in 22 days

push eventmruby/mruby

Uchio Kondo

commit sha d00e4e2d2808333b2ce4933626860c9181b2fbaf

Ensure exact match for symbols like foo!/foo?/foo= e.g. symbols like "foo[]=" make invalid C codes

view details

Kondo Uchio

commit sha 351dc50d3b1f2a20000228a78fa1aa83060a629c

Exact match to allowed method/variable names

view details

Uchio Kondo

commit sha e93849078e47a02b86190149bd193ba5e6908208

Scan ruby files in directories

view details

Kondo Uchio

commit sha 119ec3a32127f9de7bf67ed584e39d9c1ae4125b

Remove duplicated pattern

view details

Yukihiro "Matz" Matsumoto

commit sha 720f8b8d821235d476b36ac1f15a352ac555ee5b

Use `MRB_INT_MAX` instead of `INT_MAX` according to variable type.

view details

Yukihiro "Matz" Matsumoto

commit sha 62eedf215c537dd3c66a6b189dc8307d85d5b12f

Adjust backslash position in multi-line macros.

view details

Yukihiro "Matz" Matsumoto

commit sha d62b43a6b290723e7c92a37861f160250476ea5e

Embed debug information to resolve Windows VC's issue.

view details

Yukihiro "Matz" Matsumoto

commit sha b7c349873c639adda553ea49817ab8cd76c0cc64

Fix `mrb_int_mul_overflow()` to check either operand being zero.

view details

Yukihiro "Matz" Matsumoto

commit sha 5d45108e55775adc98b4085ee38d6bcbb60a12f9

Use `NULL` instead of `0`; close #2467 The PR was from @cubicdaiya.

view details

push time in 22 days

push eventmruby/mruby

Yukihiro "Matz" Matsumoto

commit sha 111fc0cd06cdb5d78ceb5ae04cac89c552a67b0e

Fix `mrb_int_mul_overflow()` to check either operand being zero.

view details

push time in 22 days

push eventmruby/mruby

Yukihiro "Matz" Matsumoto

commit sha cc7beb1a4969e72cbee9a97a22f92405e0694388

Embed debug information to resolve Windows VC's issue.

view details

push time in 22 days

push eventmruby/mruby

Yukihiro "Matz" Matsumoto

commit sha 12344cc5e30a4392f4b3457e4d2fc2185093be63

Use `MRB_INT_MAX` instead of `INT_MAX` according to variable type.

view details

Yukihiro "Matz" Matsumoto

commit sha 0692e1f36b36d3b815f32dcee51eec55d7758832

Adjust backslash position in multi-line macros.

view details

push time in 22 days

issue commentmruby/mruby

[mruby3] Cannot use (some of) external mgems due to symbol resolution

I think it`s fixed by #5072

udzura

comment created time in 24 days

PR closed mruby/mruby

Skip C and Ruby comments from scan target

Keep build OK when broken codes are included in comments.

+3 -1

4 comments

1 changed file

udzura

pr closed time in 24 days

pull request commentmruby/mruby

Skip C and Ruby comments from scan target

Addressed by b2e92f60c0e

udzura

comment created time in 24 days

PR merged mruby/mruby

Scan ruby files in directories

Old patterns skip ruby files like mrblib/foo/bar.rb. I've added glob patterns to improve coverage.

+10 -6

0 comment

1 changed file

udzura

pr closed time in 24 days

push eventmruby/mruby

Uchio Kondo

commit sha f3857c1602483c3ca0f2f5d8905337def4367337

Scan ruby files in directories

view details

Uchio Kondo

commit sha cf165ebca9510ee1b42e56ca416d0e4b5a1e60b4

Ensure exact match for symbols like foo!/foo?/foo= e.g. symbols like "foo[]=" make invalid C codes

view details

Yukihiro "Matz" Matsumoto

commit sha 07298184fa50c14b502d56171df48c95df10760b

Restore old function names for compatibility; ref #5070 - `mrb_check_intern()` to return `mrb_value` - `mrb_intern_check()` to return `mrb_sym` [NEW] Other new functions: - `mrb_intern_check_cstr()` - `mrb_intern_check_str()`

view details

Kondo Uchio

commit sha d11369bb8f2d8f04f940a36b67dbc5f0f71aab94

Remove duplicated pattern

view details

Kondo Uchio

commit sha 37eae7d6a8623ceb557c28fa505530a807f6e997

Exact match to allowed method/variable names

view details

Yukihiro "Matz" Matsumoto

commit sha b2e92f60c0e1440fe68deee70bafc49e39586450

Skip C comments from scan target; close #5072 The original PR was skipping Ruby comments as well, but caused some issues in test suites.

view details

Yukihiro "Matz" Matsumoto

commit sha 3636fef813cc5369e61bdf339d575841a040f8fe

Merge branch 'handle-weird-symbols' of https://github.com/udzura/mruby into udzura-handle-weird-symbols

view details

Yukihiro "Matz" Matsumoto

commit sha 7ed033923d9c1d3743018c30c05d7d467d37db69

Merge branch 'udzura-handle-weird-symbols' into mruby3

view details

Yukihiro "Matz" Matsumoto

commit sha 954714521aed219bc78bd0656692425e2a57c3a4

Merge branch 'scan-dir-ruby' of https://github.com/udzura/mruby into udzura-scan-dir-ruby

view details

Yukihiro "Matz" Matsumoto

commit sha 51862c911e1f3c038b8fa6e1e3b7f077de194720

Merge branch 'udzura-scan-dir-ruby' into mruby3

view details

push time in 24 days

PR merged mruby/mruby

Ensure exact match for symbols like `foo!/foo?/foo=` on presym.inc generation
  • e.g. symbols like "foo[]=" make invalid C codes... even in comments!
  • https://github.com/mattn/mruby-http/blob/master/src/mrb_http.c#L652
+4 -4

0 comment

1 changed file

udzura

pr closed time in 24 days

Pull request review commentmruby/mruby

Scan ruby files in directories

 MRuby.each_target do |target| end  mkdir_p "#{MRUBY_ROOT}/build"-cfiles = (Dir.glob("#{MRUBY_ROOT}/src/*.c")+-          Dir.glob("#{MRUBY_ROOT}/mrbgems/**/*.c")+-          Dir.glob("#{MRUBY_ROOT}/build/repos/**/{src,test,core}/*.c")).uniq-rbfiles = (Dir.glob("#{MRUBY_ROOT}/{mrblib,test,test/t}/*.rb")+-           Dir.glob("#{MRUBY_ROOT}/mrbgems/*/{mrblib,test}/*.rb")+-           Dir.glob("#{MRUBY_ROOT}/build/repos/**/{mrblib,test}/*.rb")).uniq+cfiles = (+  Dir.glob("#{MRUBY_ROOT}/src/*.c")++  Dir.glob("#{MRUBY_ROOT}/mrbgems/**/*.c")++  Dir.glob("#{MRUBY_ROOT}/build/repos/**/{src,test,core}/*.c")+).uniq+rbfiles = (+  Dir.glob("#{MRUBY_ROOT}/{mrblib,test,test/t}/*.rb")++  Dir.glob("#{MRUBY_ROOT}/{mrblib,test,test/t}/**/*.rb")+

**/*.rb contains *.rb so you only need the former.

udzura

comment created time in 24 days

PullRequestReviewEvent

Pull request review commentmruby/mruby

Ensure exact match for symbols like `foo!/foo?/foo=` on presym.inc generation

 file presym_inc => presym_file do         f.print "MRB_PRESYM_CSYM(#{sym}, #{i+1})\n"       elsif op_table.key?(sym)         f.print "MRB_PRESYM_QSYM(\"#{sym}\", #{op_table[sym]}, #{i+1})\n"-      elsif /\?\Z/ =~ sym+      elsif /\A\w+\?\Z/ =~ sym

It should be [A-Za-z_]\w* instead of \w+ ([A-Za-z0-9_]+).

udzura

comment created time in 24 days

PullRequestReviewEvent

PR opened appPlant/mruby-process

Fix wrong usage of `mrb_get_args()`.

Specifier i takes mrb_int, not mrb_value.

+2 -4

0 comment

1 changed file

pr created time in 24 days

create barnchmatz/mruby-process

branch : fix-get-args

created branch time in 24 days

fork matz/mruby-process

Process module for mruby

fork in 24 days

pull request commentmruby/mruby

Skip C and Ruby comments from scan target

I understand the concept. But mere skipping does not work, since test suites contain symbols like :"#{1+2}. There are a few choices:

  • avoid using those weird symbols in test suites (they are not used in the real applications)
  • implement better code scanner
udzura

comment created time in 24 days

issue commentmruby/mruby

[mruby3] Cannot use (some of) external mgems due to symbol resolution

Thank you! And sorry for incomvienience.

udzura

comment created time in 24 days

issue closedmruby/mruby

[mruby3] Cannot use (some of) external mgems due to symbol resolution

Check out mruby3: // version is c1f5f9986ae4b5085bee6143d378182746462519

git clone https://github.com/mruby/mruby.git
cd mruby
git checkout mruby3

Create build_config.rb (or use target/*)

$ cat my_build_config.rb
MRuby::Build.new do |conf|
  toolchain :gcc
  conf.gem :github => 'mattn/mruby-onig-regexp'
  conf.gembox 'full-core'
  enable_debug
  #conf.enable_bintest
  #conf.enable_test
end

Then build,

$ MRUBY_CONFIG=`pwd`/my_build_config.rb rake

And all build is passed, but mruby would not startup due to symbol resolution in prelude.

$ ./bin/mruby -e 'puts "Hello World"'
undefined method 'FIND_NOT_EMPTY' for class String (NameError)
$ ./bin/mruby
undefined method 'FIND_NOT_EMPTY' for class String (NameError)

closed time in 24 days

udzura

issue commentmruby/mruby

[mruby3] Cannot use (some of) external mgems due to symbol resolution

Fixed by 6cd1bee574416

udzura

comment created time in 24 days

push eventmruby/mruby

Yukihiro "Matz" Matsumoto

commit sha 6cd1bee574416766987906cca8cdd4a4aad3c7b1

Scan source code lines from downloaded mrbgems; fix #5071

view details

push time in 24 days

issue closedmruby/mruby

Remain `mrb_convert_type` prototype and introduce newly named function in mruby 3

Found a breaking change in mruby 3:

https://github.com/mruby/mruby/commit/3b6b8d3a4bf84f10b1fcb295dfbb4bba2061bc1f

This affects so many mgems (including like mruby-env and mruby-process... which are referenced in many mruby products)!!

IMO I agree with your intention that current prototype requires a redundant argument such like "String", so how about introducing newly named function like mrb_convert_type_sym ?

closed time in 24 days

udzura

PR closed mruby/mruby

Adding malloc_trim call on full GC

Follow up on #5047. Does a couple things:

  • Adds a few methods to MRuby::Command::Compiler for asking about headers and functions. I took inspiration from how meson does it, which has a nice API.
  • Wraps the necessary includes and call within a #define set inside gcc.rake. That way if a user has a custom build_config.rb they can remove the define if they wish, like if they are using a different allocator than glib.
+6 -0

12 comments

1 changed file

RoryO

pr closed time in 24 days

pull request commentmruby/mruby

Adding malloc_trim call on full GC

Merged.

RoryO

comment created time in 24 days

issue commentmruby/mruby

Remain `mrb_convert_type` prototype and introduce newly named function in mruby 3

Fixed by ba1ebd3c4bf6

udzura

comment created time in 24 days

push eventmruby/mruby

Yukihiro "Matz" Matsumoto

commit sha ba1ebd3c4bf6d3b57413de9329ee1ab0357c7b34

Restore old function names for compatibility; fix #5070 Rename new functions: - `mrb_convert_type(mrb,val,type,tname,method)` => `mrb_type_convert(mrb,val,type,tname,method)` - `mrb_check_convert_type(mrb,val,type,tname,method)` => `mrb_type_convert_check(mrb,val,type,tname,method)` Old names are defined by macros (support `tname` drop and `char*` => `mrb_sym` conversion).

view details

push time in 24 days

issue commentmruby/mruby

Remain `mrb_convert_type` prototype and introduce newly named function in mruby 3

OK. I will rename mrb_convert_type() and mrb_check_convert_type() to mrb_type_convert() and mrb_type_convert_check() respectively, and prepare macros of old names with same arguments.

udzura

comment created time in 24 days

push eventmruby/mruby

Yukihiro "Matz" Matsumoto

commit sha 96ee1820500ecdbd9cbf2cc2cec1753e4a90260e

Fix warning from VC regarding implicit int conversion.

view details

Yukihiro "Matz" Matsumoto

commit sha c1f5f9986ae4b5085bee6143d378182746462519

Fix integer casting on 64 bit platforms. On platforms where `sizeof(long)` is 4, casting `(long)` can lose data or sign information.

view details

push time in 25 days

push eventmruby/mruby

Yukihiro "Matz" Matsumoto

commit sha 10cca67b4f6167753c92f7912dd26c5e14e4d30c

Use `mrb_int` extensively instead of `int`. The mixture causes warnings on 64 bit Windows (VC).

view details

Yukihiro "Matz" Matsumoto

commit sha 34ce317a627f2c8f130dfcd20e09b6f8e513deb3

Avoid `unsigned int`; Use `mrb_int` instead.

view details

Yukihiro "Matz" Matsumoto

commit sha 6b2cd76874e260824dcb6304b49c04c23080cb15

Made `Rational` overhaul. - Implement `Rational()` in `C`. - Use `float` to `rational` conversion function taken from: https://rosettacode.org/wiki/Convert_decimal_number_to_rational#C

view details

push time in 25 days

push eventmruby/mruby

Yukihiro "Matz" Matsumoto

commit sha cf5e57170709206ee4da18e907045ccd592e0218

Change some `int` variables to `mrb_int`. To silence some warnings. This change cancels part of 7ef3604134.

view details

Yukihiro "Matz" Matsumoto

commit sha 4c678a2eb030d7b9d723dfc8493580d0473b8105

Remove obsolete `MRB_WITHOUT_FLOAT` macro from `numeric.c`.

view details

Rory OConnell

commit sha acece49f60684a9c8fc94d7ceb2530e8c708caa3

Add methods for asking about compiler features

view details

Rory OConnell

commit sha 02f9d93f00cc87f1a57b2e12cf49e8bde4e92ba0

Add call to malloc_trim on a full GC

view details

Rory OConnell

commit sha 233412735085bbcd9ef01ab62140266ad24f1272

Work around removing tmp dir

view details

Rory OConnell

commit sha e49ee4ef4ad81dd0aa415c0634a40333adba2a20

Better malloc_trim define name

view details

Rory OConnell

commit sha 9461091c3e9db18337ba0d9f0997135815e7faee

Remove compiler feature detection

view details

Yukihiro "Matz" Matsumoto

commit sha 1ed03190ce756a340ff9d435d02b016e5cd927e6

Explain `MRB_USE_MALLOC_TRIM`; ref #5069

view details

Yukihiro "Matz" Matsumoto

commit sha bf10c282c5e168e4ecb3744c97d6d35c51607eef

Skip some `Math.atan2()` tests. Linux `atan2(3)` man page says: ``` If y is positive infinity (negative infinity) and x is positive infinity, +pi/4 (-pi/4) is re‐ turned. ``` But on Microsoft VC/MinGW, `atan2()` returns `NaN` if either of arguments is infinite. So we skip those tests on the platforms.

view details

Yukihiro "Matz" Matsumoto

commit sha 2c33ba2bade97e1abd6fbb5bf67c9982d0ec5c80

Remove meaningless `IO.open(1<<32)` test.

view details

Yukihiro "Matz" Matsumoto

commit sha dfc5c12a803cf4ca7479ee7f4d1b6b5a40bf2c9e

Don't use `NEXT` within `switch` statement. On non-`gcc` compatible environment, `NEXT` is translated to `break`.

view details

Yukihiro "Matz" Matsumoto

commit sha 71043c5f445d00fdbe518ad2abf14a91e15fa02f

Extract `div` code in VM and make them shared by `div` methods.

view details

Yukihiro "Matz" Matsumoto

commit sha 76d43aaa83512f7e040d11031a9c6c6ec93c34f7

Use `goto` to avoid problems with `DIRECT_THREADED`. You can now use `NEXT` within `switch` statement like 7c087eb.

view details

push time in 25 days

pull request commentmruby/mruby

Adding malloc_trim call on full GC

I will close when I push to GitHub. I am struggling with other issues. Wait for a while.

RoryO

comment created time in a month

pull request commentmruby/mruby

Adding malloc_trim call on full GC

Thank you anyway.

RoryO

comment created time in a month

pull request commentmruby/mruby

Adding malloc_trim call on full GC

Oh, you didn't have to. I did it on my side.

RoryO

comment created time in a month

pull request commentmruby/mruby

Adding malloc_trim call on full GC

Thank you! It will be merged to mruby3 branch.

RoryO

comment created time in a month

pull request commentmruby/mruby

Adding malloc_trim call on full GC

@RoryO yes. Altough it's less intelligent. I'd like to follow KISS principle here.

RoryO

comment created time in a month

push eventmruby/mruby

Yukihiro "Matz" Matsumoto

commit sha 19f49e05354ad6e5acc6a8854c4bbe2075e18d6c

Update `mrb_get_args()` keyword argument support [incompatible] * `mrb_kwargs` structure reordered (`values` and `rest` come last) * take symbols instead of C `char*`

view details

Yukihiro "Matz" Matsumoto

commit sha d3fed5d108812307f41b25871551222d6e3dcf16

Update `IO#popen` to use keyword arguments instead of `Hash` args.

view details

Yukihiro "Matz" Matsumoto

commit sha 7c1744b3b1ea550594be4f803eaaefe098547735

Remove `full-core` from `target/appveyor.rb`.

view details

push time in a month

push eventmruby/mruby

Yukihiro "Matz" Matsumoto

commit sha bf6ee303e8d6501b5c843684935c2420edecefe9

Don't compare `int' with `size_t` (from `sizeof()`).

view details

Yukihiro "Matz" Matsumoto

commit sha 031b1d36c529afa873c9259c6f2feff651833656

Add `U` prefix for `mrb_sym` dump. Since `%u` of `mrb_sym` may be its MSB turned on.

view details

Yukihiro "Matz" Matsumoto

commit sha e2342b6004049b34ce9b08ad97a5a262ff07894d

Abandon packing all lower case symbols with 6 characters. To make packed inline symbols within 31 bits, because the new method hash tables allows only 31 bits of symbols. They use top 1 bit to maek unused slots.

view details

Yukihiro "Matz" Matsumoto

commit sha 2e0fd9def17d20c3e352242a4bfc7cd8c4d5bfc5

Include `mruby/endian.h` only when `MRB_NO_FLOAT` is undefined.

view details

Yukihiro "Matz" Matsumoto

commit sha 94975441eeaad18526582f717387ca0bbca26bea

Redefine `CHECKPOINT_*` macros. By definition `mrb_assert()` called only when `MRB_DEBUG` is defined too. But make I wanted to make clear that the local variable `current_checkpoint_tag` is only accessed when `MRB_DEBUG` is set by wrapping with `DEBUG_ONLY_EXPR()`.

view details

Yukihiro "Matz" Matsumoto

commit sha 77cc28d76be7c717028521096a6ad0848f107371

Make the scope of `const struct RProc *dst` narrower.

view details

Yukihiro "Matz" Matsumoto

commit sha 889fb1403c50a4cbdccc8508f8f8dbbf3b8cad58

Separate jump destination check in `OP_R_RETURN`. In the past code, the current `callinfo (ci)` was modified, thus it was possible to pop `ci` beyond the `cibase`, that could cause out of memory bound access for the code like the following: ```ruby def m2 lambda { Proc.new { return :return # return from the method } }.call.call :never_reached end p m2 ```

view details

push time in a month

push eventmruby/mruby

Yukihiro "Matz" Matsumoto

commit sha a66d86cfc15771bd62a045572970c567f7e78637

Fix `mrb_ary_splat` to copy the array; fix #5067

view details

Yukihiro "Matz" Matsumoto

commit sha 564372d7b920049d5bcd0c120a3689402915fb7b

Fix `mrb_obj_ceqq` to avoid array copying.

view details

SiZiOUS

commit sha 510b9e7abc33843d3fae2a4d7cf0b1213bb352cc

mruby-io: Fixing compilation issue under the legacy MinGW environment Adding MRB_MINGW32_LEGACY in common.h in order to identify the legacy MinGW environment (i.e. NOT to be confused with MinGW-w64). For more info about MinGW defined macros, see: https://sourceforge.net/p/predef/wiki/Compilers/

view details

Yukihiro "Matz" Matsumoto

commit sha f08f3c34be5dc669bb298084e0bb284d2c10789b

Fix a bug introduced by the last commit. Should have handled the case `to_a` returns `nil`.

view details

Yukihiro "Matz" Matsumoto

commit sha 6b8664b951af9b8734d5127bd8a746a67fde283c

Fix the bug caused by `to_a` returning a frozen array. Reported by @shuujii.

view details

Yukihiro "Matz" Matsumoto

commit sha 705f95c983b7877113d9165b44e9f07cedd5fb36

Merge pull request #5068 from sizious/mingw32-legacy-fixes mruby-io: Fixing compilation issue under the legacy MinGW environment

view details

Yukihiro "Matz" Matsumoto

commit sha e2c628583ebf1a5986da7b2ab6d3cb228a4ca025

Fix `mrb_ary_splat()` to copy the array always.

view details

Yukihiro "Matz" Matsumoto

commit sha a98fced38e9d5e4bad8d7cfbb8ae0b602e695864

Generate a table for preallocated symbols (`presym`). `presym` are symbols used in the C source files. `gensym` rake rule scans the entire C source files and collect symbols referenced from them.

view details

Yukihiro "Matz" Matsumoto

commit sha 31c0f954b3501a4598cf4c9086ac97e1a1e3f514

Support `presym` in `symbol.c`.

view details

Yukihiro "Matz" Matsumoto

commit sha 956a5e7854bc159cad2eb4b29a462af8d3b217bd

Update Rakefile to generate presym.

view details

Yukihiro "Matz" Matsumoto

commit sha df4749426f931803226d2df6a381bc513643435d

Add `MRB_SYM()` for inline symbols.

view details

Yukihiro "Matz" Matsumoto

commit sha f59288cfbb3097df7233b86b1accc63128e835ae

Update `presym_find` to use more efficient binary search.

view details

Yukihiro "Matz" Matsumoto

commit sha b94fa8f7062b1777f4aa6806bc8bffc062bc41d7

Scan `.rb` files as well to generate `presym` table.

view details

Yukihiro "Matz" Matsumoto

commit sha b2e227d8563484365a4344ff0b9c20d0e492b383

Remove `build/presym` and `build/presym.inc` on `rake clean`.

view details

Yukihiro "Matz" Matsumoto

commit sha 3a5d51cb3812919b5eb24c06687947e8aa6ff384

Remove the temporary file from the `AF_UNIX` socket test; #4981

view details

Yukihiro "Matz" Matsumoto

commit sha e64e59ec7bcad951ea3b37e4a9c8d774b763b4c7

Avoid `snprintf` in `mruby-io` test; ref #4981

view details

Yukihiro "Matz" Matsumoto

commit sha 90fce69d85461cd488098f85f9d7cf31c6cb5057

Fix `presym_find` for strings without `NUL` terminators.

view details

Yukihiro "Matz" Matsumoto

commit sha 8a97aeeefa11258e40503966ad3d9302abc96cee

Prepend `gensym` rule to `depfiles`.

view details

Yukihiro "Matz" Matsumoto

commit sha 2112058f413ccd58c9de3abc9e06133d21361da5

Keep `build/presym` through `rake clean`.

view details

Yukihiro "Matz" Matsumoto

commit sha 563e0d8dcc68d56ffb7a2e2e8edf38d026a05a50

Run `rake gensym` before the build.

view details

push time in a month

pull request commentmruby/mruby

Adding malloc_trim call on full GC

I am wondering whether it may be better to specify manually via a macro define, e.g. MRB_USE_MALLOC_TRIM. In that case, we don't have to add a complex detection code. No worry about cross-compiling nor compiler portability.

RoryO

comment created time in a month

CommitCommentEvent

push eventmruby/mruby

Yukihiro "Matz" Matsumoto

commit sha e2c628583ebf1a5986da7b2ab6d3cb228a4ca025

Fix `mrb_ary_splat()` to copy the array always.

view details

push time in a month

more