SEGV in tpike during build
Imported from http://bugzilla.roxen.com/bugzilla/show_bug.cgi?id=3646
Reported by Jakub Bogusz, email@example.com
I tried to build Pike 7.4.44 on sparc-linux, it failed on precompilation - tpike caught SEGV. SEGV occurred in sparc_flush_instruction_cache() (src/code/sparc.c). I found that size passed to this function is multiplied by sizeof(PIKE_OPCODE_T) twice (the first time in program.c, as sizeof(p->program), and the second in sparc.h, as sizeof(PIKE_OPCODE_T). Removing the second one avoids SEGV, pike builds successfully.
--- Pike-v7.4.44/src/code/sparc.h.orig 2002-11-08 17:37:00.000000000 +0000 +++ Pike-v7.4.44/src/code/sparc.h 2004-04-15 21:15:42.000000000 +0000 @@ -72,7 +72,7 @@ extern const unsigned INT32 sparc_flush_instruction_cache; #define FLUSH_INSTRUCTION_CACHE(ADDR, LEN) \ (((void (*)(void *,size_t))sparc_flush_instruction_cache) \ - (ADDR, (LEN)*sizeof(PIKE_OPCODE_T))) + (ADDR, (LEN))) struct dynamic_buffer_s;
(...or maybe it should be (LEN)+sizeof(PIKE_OPCODE_T), as I found in CVS history about 2001, before changing it to macro?)