nobu / ruby-lang.org wrote:
>   New Revision: 53616

Hi nobu, I could not find RUBY_ASSERT_WHEN_0, so I assume you meant to use
RUBY_ASSERT_MESG_WHEN.   I hit this when I looked at ko1's CI email.

-------8<-------
Subject: [PATCH] fix build with VM_CHECK_MODE > 0

* ruby_assert.h (RUBY_ASSERT_WHEN): fix reference to macro name
* vm_core.h: include ruby_assert.h before using
---
diff --git a/ruby_assert.h b/ruby_assert.h
index de80491..3383e4f 100644
--- a/ruby_assert.h
+++ b/ruby_assert.h
@@ -31,7 +31,7 @@ NORETURN(void rb_assert_failure(const char *, int, const char *, const char *));
     RUBY_ASSERT_MESG(!(cond) || (expr), mesg)
 #endif
 #define RUBY_ASSERT(expr) RUBY_ASSERT_MESG_WHEN(!RUBY_NDEBUG+0, expr, #expr)
-#define RUBY_ASSERT_WHEN(cond, expr) RUBY_ASSERT_WHEN_0(cond, expr, #expr)
+#define RUBY_ASSERT_WHEN(cond, expr) RUBY_ASSERT_MESG_WHEN(cond, expr, #expr)
 
 #undef assert
 #define assert RUBY_ASSERT
diff --git a/vm_core.h b/vm_core.h
index 91e65fc..61647d1 100644
--- a/vm_core.h
+++ b/vm_core.h
@@ -42,6 +42,8 @@
 #define VMDEBUG 3
 #endif
 
+#include "ruby_assert.h"
+
 #if VM_CHECK_MODE > 0
 #define VM_ASSERT(expr) ( \
 	RUBY_ASSERT_WHEN(VM_CHECK_MODE > 0, expr))
@@ -61,7 +63,6 @@
 #include "method.h"
 #include "ruby_atomic.h"
 #include "ccan/list/list.h"
-#include "ruby_assert.h"
 
 #include "ruby/thread_native.h"
 #if   defined(_WIN32)


Now, I get a test failure with VM_CHECK_MODE 1:

  1) Failure:
TestProfileFrames#test_ifunc_frame [ruby/test/-ext-/debug/test_profile_frames.rb:108]:
[ruby-core:72409] [Bug #11851]
pid 21369 killed by SIGABRT (signal 6) (core dumped)
| Assertion Failed: vm_backtrace.c:1347:frame2klass:imemo_type(frame) == imemo_ment
| ruby 2.4.0dev (2016-01-24 trunk 53644) [x86_64-linux]
| 
| -- Control frame information -----------------------------------------------
| c:0007 p:---- s:0020 e:000019 CFUNC  :profile_frames
| c:0006 p:0011 s:0015 e:000014 METHOD -:5 [FINISH]
| c:0005 p:---- s:0012 e:000011 IFUNC  :x
| c:0004 p:---- s:0010 e:000009 CFUNC  :each
| c:0003 p:0022 s:0007 e:000006 METHOD -:9
| c:0002 p:0037 s:0004 E:000880 EVAL   -:11 [FINISH]
| c:0001 p:0000 s:0002 E:0012d0 (none) [FINISH]
| 
| -- Ruby level backtrace information ----------------------------------------
| -:11:in `<main>'
| -:9:in `a'
| -:9:in `each'
| -:5:in `x'
| -:5:in `profile_frames'
| 
| -- C level backtrace information -------------------------------------------
| ruby/ruby(rb_vm_bugreport+0x550) [0x55684604fb60] vm_dump.c:688
| ruby/ruby(rb_assert_failure+0x75) [0x556846027ad5] error.c:510
| ruby/ruby(frame2klass.part.3+0x20) [0x556845e7010b] vm_backtrace.c:1347
| ruby/ruby(rb_profile_frame_classpath+0xe1) [0x556845fc0c51] vm_backtrace.c:1367
| ruby/.ext/x86_64-linux/-test-/debug.so(profile_frames+0x102) [0x2ae3c9e5e442] profile_frames.c:28
| ruby/ruby(vm_call_cfunc+0x102) [0x556845fa6612] vm_insnhelper.c:1635
| ruby/ruby(vm_call_method+0xab) [0x556845fb365b] vm_insnhelper.c:2173
| ruby/ruby(vm_exec_core+0xe25) [0x556845fad6f5] insns.def:1003
| ruby/ruby(vm_exec+0x7e) [0x556845fb218e] vm.c:1645
| ruby/ruby(vm_call0_body+0x16c) [0x556845fb419c] vm_eval.c:182
| ruby/ruby(rb_funcall_with_block+0x103) [0x556845fb92f3] vm_eval.c:61
| ruby/ruby(vm_yield_with_cfunc+0x129) [0x556845fa90f9] vm_insnhelper.c:2332
| ruby/ruby(invoke_block_from_c_0+0x119) [0x556845fb2ab9] vm.c:974
| ruby/ruby(vm_yield+0x4f) [0x556845fbac5f] vm.c:983
| ruby/ruby(rb_yield+0x25) [0x556845fbad95] vm_eval.c:1008
| ruby/ruby(rb_ary_each+0x3d) [0x556845fd971d] array.c:1815
| ruby/ruby(vm_call_cfunc+0x102) [0x556845fa6612] vm_insnhelper.c:1635
| ruby/ruby(vm_call_method+0xab) [0x556845fb365b] vm_insnhelper.c:2173
| ruby/ruby(vm_exec_core+0xd5e) [0x556845fad62e] insns.def:972
| ruby/ruby(vm_exec+0x7e) [0x556845fb218e] vm.c:1645
| ruby/ruby(ruby_exec_internal+0xdf) [0x556845e7108f] eval.c:244
| ruby/ruby(ruby_run_node+0x47) [0x556845e74737] eval.c:309
| ruby/ruby(main+0x4b) [0x556845e7079b] parse.y:6593
| 

Unsubscribe: <mailto:ruby-core-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>