bug-binutils
[Top][All Lists]
Advanced

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

[Bug ld/31009] regression: assertion fail ../../bfd/merge.c:243


From: jonny.weir at clearpool dot io
Subject: [Bug ld/31009] regression: assertion fail ../../bfd/merge.c:243
Date: Tue, 31 Oct 2023 17:04:51 +0000

https://sourceware.org/bugzilla/show_bug.cgi?id=31009

--- Comment #7 from Jonny Weir <jonny.weir at clearpool dot io> ---
I made the following change:

diff --git a/bfd/merge.c b/bfd/merge.c
index f21154dcd45..3b4ccfb86df 100644
--- a/bfd/merge.c
+++ b/bfd/merge.c
@@ -175,26 +175,43 @@ sec_merge_maybe_resize (struct sec_merge_hash *table,
unsigned added)
       uint64_t *newl;
       unsigned long alloc;

+      printf ("XXX resize 1: count=%u added=%u newnb=%lu\n", bfdtab->count,
added, newnb);
       while (bfdtab->count + added > newnb * 2 / 3)
        {
          newnb *= 2;
          if (!newnb)
-           return false;
+           {
+             printf ("false1: newnb=%lu\n", newnb);
+             return false;
+           }
        }
+      printf ("XXX resize 2: newnb=%lu\n", newnb);

       alloc = newnb * sizeof (newl[0]);
       if (alloc / sizeof (newl[0]) != newnb)
-       return false;
+       {
+         printf ("false2: alloc=%lu, newnb=%lu, sizeof(newl[0])=%lu,
alloc/sizeof(newl[0])=%lu\n", alloc, newnb, sizeof(newl[0]),
alloc/sizeof(newl[0]));;
+         return false;
+       }
       newl = objalloc_alloc ((struct objalloc *) table->table.memory, alloc);
       if (newl == NULL)
-       return false;
+       {
+         printf ("false3: newl == NULL");
+         return false;
+       }
       memset (newl, 0, alloc);
       alloc = newnb * sizeof (newv[0]);
       if (alloc / sizeof (newv[0]) != newnb)
-       return false;
+       {
+         printf ("false4: alloc=%lu, newnb=%lu, sizeof(newv[0])=%lu,
alloc/sizeof(newv[0])=%lu\n", alloc, newnb, sizeof(newv[0]),
alloc/sizeof(newv[0]));
+         return false;
+       }
       newv = objalloc_alloc ((struct objalloc *) table->table.memory, alloc);
       if (newv == NULL)
-       return false;
+       {
+         printf ("false5: newv == NULL");
+         return false;
+       }
       memset (newv, 0, alloc);


The output of which:

XXX resize 1: count=609 added=5699 newnb=16384
XXX resize 2: newnb=16384
XXX resize 1: count=1133 added=28709 newnb=32768
XXX resize 2: newnb=65536
XXX resize 1: count=114 added=9809 newnb=16384
XXX resize 2: newnb=16384
XXX resize 1: count=266 added=10658 newnb=32768
XXX resize 2: newnb=32768
XXX resize 1: count=447 added=30092 newnb=65536
XXX resize 2: newnb=65536
XXX resize 1: count=683 added=123892 newnb=131072
XXX resize 2: newnb=262144
XXX resize 1: count=1048 added=212455 newnb=524288
XXX resize 2: newnb=524288
XXX resize 1: count=1598 added=1086327410 newnb=1048576
XXX resize 2: newnb=2147483648
XXX resize 1: count=755248 added=68141 newnb=0
false1: newnb=0

-- 
You are receiving this mail because:
You are on the CC list for the bug.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]