From: ko1@... Date: 2017-01-31T09:12:48+00:00 Subject: [ruby-core:79349] [Ruby trunk Bug#4630][Closed] PROCDEBUG to non-zero values causes segmentation faults in check_env in trunk Issue #4630 has been updated by Koichi Sasada. Description updated Status changed from Assigned to Closed Now, we don't see this issue. ---------------------------------------- Bug #4630: PROCDEBUG to non-zero values causes segmentation faults in check_env in trunk https://bugs.ruby-lang.org/issues/4630#change-62772 * Author: Elise Huard * Status: Closed * Priority: Normal * Assignee: Koichi Sasada * Target version: next minor * ruby -v: - * Backport: 2.2: UNKNOWN, 2.3: UNKNOWN, 2.4: UNKNOWN ---------------------------------------- PROCDEBUG is meant to show debugging output from the vm. However, when it's activated in vm.c #define PROCDEBUG 1 The make process fails in segmentation faults. I've narrowed it down to the following variables displayed in check_env: env->block.dfp[3] and env->block.dfp[4] Commenting them out like so makes the segfaults disappear. ``` static int check_env(rb_env_t * const env) { printf("---\n"); printf("envptr: %p\n", (void *)&env->block.dfp[0]); printf("orphan: %p\n", (void *)env->block.dfp[1]); printf("inheap: %p\n", (void *)env->block.dfp[2]); /* printf("envval: %10p ", (void *)env->block.dfp[3]); dp(env->block.dfp[3]); printf("penvv : %10p ", (void *)env->block.dfp[4]); dp(env->block.dfp[4]); */ printf("lfp: %10p\n", (void *)env->block.lfp); printf("dfp: %10p\n", (void *)env->block.dfp); /* if (env->block.dfp[4]) { printf(">>\n"); check_env_value(env->block.dfp[4]); printf("<<\n"); } */ return 1; } ``` However, I'm not clued up enough on the inner workings of the VM to say why or how that should be fixed intelligently. -- https://bugs.ruby-lang.org/ Unsubscribe: