<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - [i386] Assertion failed: (Elements + Grow <= Nodes * Capacity && "Not enough room for elements"), function distribute, file llvm/lib/Support/IntervalMap.cpp, line 123."
   href="https://bugs.llvm.org/show_bug.cgi?id=47359">47359</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>[i386] Assertion failed: (Elements + Grow <= Nodes * Capacity && "Not enough room for elements"), function distribute, file llvm/lib/Support/IntervalMap.cpp, line 123.
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>new-bugs
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>11.0
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>new bugs
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>dimitry@andric.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>htmldeveloper@gmail.com, llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Building the FreeBSD x11-toolkits/py-wxPython40 port on a i386 host (i.e.
32-bit x86, not x86_64) fails with an assertion [1]:

Assertion failed: (Elements + Grow <= Nodes * Capacity && "Not enough room for
elements"), function distribute, file
/usr/src/contrib/llvm-project/llvm/lib/Support/IntervalMap.cpp, line 123.
PLEASE submit a bug report to <a href="https://bugs.freebsd.org/submit/">https://bugs.freebsd.org/submit/</a> and include the
crash backtrace, preprocessed source, and associated run script.
Stack dump:
0.      Program arguments: clang -cc1 -triple i386-unknown-freebsd13.0
-emit-obj -disable-free -main-file-name sip_ribbonwxRibbonMSWArtProvider.cpp
-mrelocation-model pic -pic-level 2 -mframe-pointer=all -relaxed-aliasing
-fno-rounding-math -mconstructor-aliases -munwind-tables -target-cpu i686
-fno-split-dwarf-inlining -debug-info-kind=standalone -dwarf-version=4
-debugger-tuning=gdb -U NDEBUG -D SIP_MODULE_NAME=wx.siplib -D
SIP_MODULE_BASENAME=siplib -D
PYTHONDIR="/usr/local/lib/python3.8/site-packages" -D
PYTHONARCHDIR="/usr/local/lib/python3.8/site-packages" -D HAVE_PYEXT=1 -D
HAVE_PYTHON_H=1 -D HAVE_WX=1 -D HAVE_WXADV=1 -D HAVE_WXSTC=1 -D HAVE_WXHTML=1
-D HAVE_WXGL=1 -D HAVE_WXWEBVIEW=1 -D HAVE_WXXML=1 -D HAVE_WXXRC=1 -D
HAVE_WXRICHTEXT=1 -D HAVE_WXMEDIA=1 -D HAVE_WXRIBBON=1 -D HAVE_WXPROPGRID=1 -D
HAVE_WXAUI=1 -D _FILE_OFFSET_BITS=64 -D WXUSINGDLL -D __WXGTK__ -D _THREAD_SAFE
-O2 -fdeprecated-macro -ferror-limit 19 -pthread -stack-protector 2
-fgnuc-version=4.2.1 -fcxx-exceptions -fexceptions -vectorize-loops
-vectorize-slp -faddrsig -x c++ sip_ribbonwxRibbonMSWArtProvider-c1d103.cpp
1.      <eof> parser at end of file
2.      Code generation
3.      Running pass 'Function Pass Manager' on module
'sip_ribbonwxRibbonMSWArtProvider-c1d103.cpp'.
4.      Running pass 'Live DEBUG_VALUE analysis' on function
'@_ZN22wxRibbonMSWArtProvideraSERKS_'

I have tried to reproduce this on one of my regular x86_64 hosts, but
unfortunately it *only* occurs with a 32-bit version of clang 11.0!

Minimized test case:

// clang -cc1 -triple i386-- -S -mframe-pointer=all -debug-info-kind=standalone
-O2 sip_ribbonwxRibbonMSWArtProvider-min.cpp
class g {
public:
  void operator=(g &h) {
    if (this != &h)
      i(h);
  }
  void i(g &);
};
struct j : g {};
struct k : j {};
struct l : g {};
struct aa : l {};
struct ad : g {};
struct J : ad {};
struct cw : g {};
struct cx : cw {};
struct cy : g {};
struct da : cy {};
struct m {
  J n;
  J o;
  J b;
  aa p;
  aa c;
  aa q;
  aa r;
  aa s;
  aa t;
  aa ab;
  aa u;
  aa v;
  aa w;
  aa x;
  aa y;
  aa z;
  aa e;
  aa ac;
  aa d;
  aa ae;
  aa af;
  aa ag;
  aa ah;
  aa ai;
  aa aj;
  aa ak;
  aa al;
  aa am;
  aa an;
  aa ao;
  aa ap;
  aa aq;
  aa ar;
  aa as;
  aa at;
  aa au;
  aa av;
  aa aw;
  aa a;
  aa ax;
  aa ay;
  aa az;
  aa ba;
  aa bb;
  aa bc;
  aa bd;
  aa be;
  aa bf;
  aa bg;
  aa bh;
  aa bi;
  aa bj;
  aa bk;
  aa bl;
  aa bm;
  aa bn;
  aa bo;
  aa bp;
  aa bq;
  aa br;
  aa bs;
  aa bt;
  aa bu;
  aa bv;
  aa bw;
  aa bx;
  aa by;
  da bz;
  da ca;
  da f;
  da cb;
  da cc;
  da cd;
  da ce;
  da cf;
  da cg;
  da ch;
  k ci;
  k cj;
  k ck;
  cx cl;
  cx cq;
  cx cm;
  cx cn;
  cx co;
  cx cp;
  cx cv;
  cx cr;
  cx cs;
  cx ct;
  cx cu;
  int cz;
} * a;
void db() { a[0] = *reinterpret_cast<m *>(0); }


It seems that something is going wrong in llvm::IntervalMapImpl::distribute(),
but I'm still digging around. The first thing I tried is a 32-bit build of
clang with -fsanitize=undefined, but it did not trigger on any undefined
behavior, unfortunately.

[1] (IPv6-only)
<a href="http://beefy17.nyi.freebsd.org/data/head-i386-default/p546309_s364850/logs/errors/py37-wxPython40-4.0.7_1.log">http://beefy17.nyi.freebsd.org/data/head-i386-default/p546309_s364850/logs/errors/py37-wxPython40-4.0.7_1.log</a></pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>