[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 2/2] xen/gunzip: Allow perform_gunzip() to be called multiple times



Hi Jan,

On 07/04/2021 11:39, Jan Beulich wrote:
On 02.04.2021 17:21, Julien Grall wrote:
--- a/xen/common/inflate.c
+++ b/xen/common/inflate.c
@@ -238,6 +238,12 @@ STATIC const ush mask_bits[] = {
  static unsigned long INITDATA malloc_ptr;
  static int INITDATA malloc_count;
+static void init_allocator(void)
+{
+    malloc_ptr = free_mem_ptr;
+    malloc_count = 0;
+}
+
  static void *INIT malloc(int size)
  {
      void *p;

I'm sorry for noticing this only now, but I'm afraid this may break
the build in certain environments / configurations.

You actually mentioned it on the original thread that reported the bug. But I forgot to add INIT. Sorry for that :(.

Iirc clang is
relatively likely to not inline functions in debug builds even when
they're used just once. Yet when the new function doesn't end up
getting inlined, it needs INIT added or else the cmd_obj_init_o
checking would find a non-empty .text section. (If there's no actual
build breakage anywhere, I can also address this in my to-be-re-based
"gunzip: drop INIT{,DATA} and STATIC", which is intended to go in as
soon as the tree is fully open again.)

The pipeline actually reported some failure. But I initially didn't notice them. I think we want to fix it because your rework, so I will send a patch.

Sorry for the breakage.

Cheers,

--
Julien Grall



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.