From e4f6fca3559ff8c6ea9b658013e785c97b9a4799 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josef=20S=C3=B6ntgen?= Date: Mon, 16 Mar 2015 13:07:49 +0100 Subject: [PATCH] packet_allocator: catch expection when calling free() If a client acknowledges the same packet more than once, the packet also gets freed more than once. At the second attempt the underlaying Bit_array will throw an 'Invalid_clear' exception, which results in an uncaught exception that leads to an abort() call in the freeing component. Fixes #1462. --- repos/os/include/os/packet_allocator.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/repos/os/include/os/packet_allocator.h b/repos/os/include/os/packet_allocator.h index f03a1f09f..910b34150 100644 --- a/repos/os/include/os/packet_allocator.h +++ b/repos/os/include/os/packet_allocator.h @@ -129,7 +129,7 @@ class Genode::Packet_allocator : public Genode::Range_allocator addr_t i = (((addr_t)addr) - _base) / _block_size; size_t cnt = (size % _block_size) ? size / _block_size + 1 : size / _block_size; - _array->clear(i, cnt); + try { _array->clear(i, cnt); } catch(...) { } _next = i; }