bug-m4
[Top][All Lists]
Advanced

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

Re: possible infinite loop in m4


From: Mike Frysinger
Subject: Re: possible infinite loop in m4
Date: Tue, 6 Jul 2010 09:11:53 -0400
User-agent: KMail/1.13.1 (Linux/2.6.34; KDE/4.4.4; x86_64; ; )

On Tuesday, July 06, 2010 08:56:12 Eric Blake wrote:
> "Mike Frysinger" <address@hidden> wrote:
> > but i think m4 should be smarter about infinite loops.  this could just as
> > easily been a typo and about the only way to track it down is to literally
> > start commenting out things in the source until it stops looping forever. 
> > that's a poor development environment imo.
> 
> What you're asking for is a solution to the halting problem.  It isn't
> going to happen - that's an NP-Complete class algorithm, and the
> amount of computing power required for those is prohibitively
> expensive.  I stand by my assertion that autoconf's use of m4
> cannot reliably determine whether the user intended to cause an
> infinite loop, or just had bad input, but that if a user sticks to
> the language documented in the autoconf manual, they should not
> be triggering infinite loops due to poor quoting in the first place.

you obviously know better than i as ive never looked at the m4 internals but 
you cant even use the existing nesting-limit option ?  autoconf already runs 
m4 with --nesting-limit=1024 which means m4 was told in no uncertain terms 
that it should avoid infinite loops.  autoconf has made its intention clear.

as for the code, everyone makes mistakes.  expecting humans to always follow a 
strict spec is unreasonable, especially when the programs that interpret that 
spec get it wrong (read; general statements; not referring to m4 here).  i'm 
not saying m4 should be accepting this code, just that when wrong code is 
given, clear diagnostics are expected.
-mike

Attachment: signature.asc
Description: This is a digitally signed message part.


reply via email to

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