From 4cf6eebf94d50cd62e9bbbaedd4ece699838ed75 Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Tue, 4 Feb 2025 01:10:40 +0100 Subject: libpipe: crash verbosely if mmap was to fail --- libpipe/pq.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/libpipe/pq.c b/libpipe/pq.c index fff03e67..069b41bc 100644 --- a/libpipe/pq.c +++ b/libpipe/pq.c @@ -410,7 +410,13 @@ packet_fetch (struct packet *packet, /* Just copy the data the old fashioned way.... */ { if (*data_len < amount) - *data = mmap (0, amount, PROT_READ|PROT_WRITE, MAP_ANON, 0, 0); + { + *data = mmap (0, amount, PROT_READ|PROT_WRITE, MAP_ANON, 0, 0); + if (*data == MAP_FAILED) + assert_perror_backtrace (errno); + else + assert_backtrace (*data); + } memcpy (*data, start, amount); start += amount; -- cgit v1.2.3