make check failed at random timing with Segfaults or BUS error
Submitted by Hideaki Suzuki
Link to original bug (#793353)
Description
On armhf, make check in orc fails at random timing. (occasionally pass all tests)
[Environment]
- HW: Raspberry Pi3
- OS: Linux raspberrypi 4.9.79-v7+
#1091
SMP Tue Feb 6 13:18:45 GMT 2018 armv7l GNU/Linux (Raspbian Stretch) - Compiler: Both gcc6.3.0(default) and gcc4.9.3-14 are tried; the results were same.
- Builder: meson and autoconf are tried; the results were same.
- Code Tag: orc-0.4.26 to orc-0.4.28 are tried; the results were same.
I have located the code of segfaults/bus error while running benchmorc.
The errors always happen at the following code point. However, what test item fails depends on individual executions and looks like at random.
orcexecutor.c:
void
orc_executor_run (OrcExecutor *ex)
{
void (*func) (OrcExecutor *);
func = ex->program->code_exec;
} else {
OrcCode *code = (OrcCode )ex->arrays[ORC_VAR_A2];
func = code->exec;
}
if (func) {
func (ex); ****** <--- BAD THINGS WILL HAPPEN HERE *****
/ ORC_ERROR("counters %d %d %d", ex->counter1, ex->counter2, ex->counter3); */
} else {
orc_executor_emulate (ex);
}
}
if (ex->program) {Due to the failure mode, does the generated code have memory alignment issues?
I didn't observe the same issue on Raspbian Jessie. So, the kernel and glibc behaviors might be related IMHO.