From 5b4cb838afbe9e700139f810a1c4c9b0e91c511c Mon Sep 17 00:00:00 2001 From: Sverker Eriksson Date: Wed, 29 Oct 2014 17:11:31 +0100 Subject: erts: Fix bug in beam_ranges Symptom: VM on OSX (darwin11.4.2) with +Meamin running sasl tests, crashing when init:reboot() does erlang:purge_module(installer). Problem: Off-by-one bug in beam_ranges:find_range, returning the wrong range if the 'end' of one module is the 'start' of the next. This is only possible if using sys_alloc (+Meamin) as our own allocators always put block headers between allocated payload data. --- erts/emulator/beam/beam_ranges.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'erts') diff --git a/erts/emulator/beam/beam_ranges.c b/erts/emulator/beam/beam_ranges.c index 0f2d5d0c2a..cb6470638f 100644 --- a/erts/emulator/beam/beam_ranges.c +++ b/erts/emulator/beam/beam_ranges.c @@ -282,7 +282,7 @@ find_range(BeamInstr* pc) while (low < high) { if (pc < mid->start) { high = mid; - } else if (pc > RANGE_END(mid)) { + } else if (pc >= RANGE_END(mid)) { low = mid + 1; } else { erts_smp_atomic_set_nob(&r[active].mid, (erts_aint_t) mid); -- cgit v1.2.3