]> xenbits.xensource.com Git - people/dwmw2/xen.git/commitdiff
libxl: abort on memory allocation errors
authorMarek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
Tue, 13 Dec 2022 14:23:54 +0000 (15:23 +0100)
committerJan Beulich <jbeulich@suse.com>
Tue, 13 Dec 2022 14:23:54 +0000 (15:23 +0100)
Use abort() instead of just _exit() in libxl__alloc_failed(). This
is more friendly for debugging, as it will trap into debugger,
systemd-coredump will collect coredump/backtrace etc. It's much more
useful than just "libxl: FATAL ERROR: memory allocation failure (...)"
message without context where it actually failed.

Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
Acked-by: Anthony PERARD <anthony.perard@citrix.com>
tools/libs/light/libxl_internal.c

index 86556b6113b0d6c6c4719e89694785a6393283c2..c95624933ffcdcbd5a6fba6e645d999a50091202 100644 (file)
@@ -36,7 +36,7 @@ void libxl__alloc_failed(libxl_ctx *ctx, const char *func,
     }
 
     fflush(stderr);
-    _exit(-1);
+    abort();
 #undef M_NSIZE
 #undef M_SIZE
 #undef M