Re: PR 30308 more unbounded recursion

Jan Beulich <[email protected]> Thu, 30 Jul 2026 09:46:00 +0200
Newsgroups gmane.comp.gnu.binutils
Message-ID <[email protected]>
On 30.07.2026 09:34, Alan Modra wrote:
> Commit 85fb82cc8c had some errors.  The extra places marking and
> clearing syms as resolving didn't take into account that the sym might
> already be so marked and thus should not be cleared.  Fixing that
> cured the first testcase addition, but not the second.  Even worse is
> that fact that marking X_add_symbol when trying to simplify
> X_op_symbol would make it impossible to simplify x==x or other such
> expressions where the symbols are the same (or the same via equates,
> making a test for X_add_symbol != X_op_symbol harder).  So commit
> 85fb82cc8c needs reverting.
> 
> When I analysed what was going on with the second testcase addition,
> and reanalysed the testcase added in commit 85fb82cc8c, I decided a
> better fix was to immediately fail on hitting a symbol loop;  It was
> the simplification done in i386_intel_simplify_symbol after hitting a
> symbol loop that made the "resolving" mark set on syms insufficient.
> 
> I won't be at all surprised if oss-fuzz and other fuzzing projects
> find other ways to make this code recurse until stack overflow.  If so
> I'm fast reaching the limit of my interest in these functions..

Understandably, and thanks for taking the time nevertheless. All of
this is far from pretty. And much of this shouldn't really be needed
if generic expression handling was doing better.

Jan