From 40b45f1b856d1c4bf1336e4aa072f073eeb23668 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edwin=20T=C3=B6r=C3=B6k?= Date: Wed, 4 Feb 2026 17:32:27 +0000 Subject: [PATCH 1/2] CA-423574: Xenops_task: avoid losing stacktraces when tracing is enabled MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Edwin Török --- ocaml/xenopsd/lib/xenops_task.ml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ocaml/xenopsd/lib/xenops_task.ml b/ocaml/xenopsd/lib/xenops_task.ml index f2c3993cf39..b6aad308536 100644 --- a/ocaml/xenopsd/lib/xenops_task.ml +++ b/ocaml/xenopsd/lib/xenops_task.ml @@ -106,9 +106,10 @@ let with_tracing ~name ~task f = result with exn -> let backtrace = Printexc.get_raw_backtrace () in + Backtrace.is_important exn ; let error = (exn, backtrace) in let _ : (Span.t option, exn) result = Tracer.finish span ~error in - raise exn + Printexc.raise_with_backtrace exn backtrace ) | Error e -> D.warn "Failed to start tracing: %s" (Printexc.to_string e) ; From 3401127e6db73bf0d74b5e1e977242c5eb03c777 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edwin=20T=C3=B6r=C3=B6k?= Date: Wed, 4 Feb 2026 17:32:56 +0000 Subject: [PATCH 2/2] CA-432574: Xenopsd: avoid losing stacktraces in with_reservation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Edwin Török --- ocaml/xenopsd/xc/xenops_server_xen.ml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ocaml/xenopsd/xc/xenops_server_xen.ml b/ocaml/xenopsd/xc/xenops_server_xen.ml index d3bd53127ce..bc98189e761 100644 --- a/ocaml/xenopsd/xc/xenops_server_xen.ml +++ b/ocaml/xenopsd/xc/xenops_server_xen.ml @@ -658,7 +658,11 @@ module Mem = struct ~default:(min, ("none", min)) (reserve_memory_range dbg min max) in - try f amount id with e -> delete_reservation dbg id ; raise e + try f amount id + with e -> + let bt = Printexc.get_raw_backtrace () in + delete_reservation dbg id ; + Printexc.raise_with_backtrace e bt (** Transfer this 'reservation' to the given domain id *) let transfer_reservation_to_domain_exn dbg domid (reservation_id, amount) =