Subject: Re: bug#58113: 29.0.50; [noverlay] Segmentation fault while building on macOS

From: Eli Zaretskii <[email-masked]>
Date: Tue, 27 Sep 2022 19:48:57 +0300

> From: Gerd Möllmann <[email-masked]>
> Date: Tue, 27 Sep 2022 14:43:40 +0200
> 
> Gerd Möllmann <[email-masked]> writes:
> 
> With --enable-checking:
> 
> itree.c:389: Emacs fatal error: assertion failed: tree->size == 0 || (tree->size > 0 && tree->root != &tree->null)
> /bin/sh: line 1:  2779 Abort trap: 6           '../src/emacs' -batch --no-site-file --no-site-lisp --eval "(setq load-prefer-newer t byte-compile-warnings 'all)" -f batch-byte-compile cedet/srecode/cpp.el
> make[3]: *** [cedet/srecode/cpp.elc] Error 134
> make[3]: *** Waiting for unfinished jobs....
> 
> frame #5: 0x00000001003a2814 emacs`interval_tree_remove(tree=0x0000600002c03f00, node=0x0000600002112b70) at itree.c:389:3
>    386 	  node->right = node->left = node->parent = NULL;
>    387 	  --tree->size;
>    388 	
> -> 389 	  eassert (tree->size == 0 || (tree->size > 0 && tree->root != &tree->null));
>    390 	
>    391 	  return node;
>    392 	}
> (lldb) p tree->size
> (intmax_t) $0 = 26
> (lldb) p &tree->null
> (interval_node *) $1 = 0x0000600002c03f08
> (lldb) p tree->root
> (interval_node *) $2 = 0x0000600002c03f08

What does tree->null represent?  Does it represent an empty tree?  If
so, I guess tree->size is not maintained correctly?