develooper Front page | perl.perl5.porters | Postings from November 2004

safe signals, regexps and the imminent heat death of the universe

Thread Next
From:
Nicholas Clark
Date:
November 25, 2004 15:23
Subject:
safe signals, regexps and the imminent heat death of the universe
Message ID:
20041125232323.GQ6725@plum.flirble.org
I'm singularly failing to remember how to construct a regexp that has
the correct properties to tie up the regexp engine until the heat death
of the universe, so I might be spouting rubbish here:


Before perl safe signals, I assume that it was perfectly possible to
time out an excessive regexp, in the worst case by aborting the program.

With safe signals, signals are only checked in the runloop. I infer that
this means that it's no longer possible to abort an infinite regexp engine,
because the regexp engine has its own private bytecode and runloop. Is
this a real problem, or have I missed something?

As I understand it, all the heat death regexps rely on tying the engine
up in knots with ambiguous backtracking. If there is a potential problem
with uninterruptable heat death regexps, how much of a performance hit
would it be for the regexp engine to check and fire off signal handlers
whenever it backtracks?

Nicholas Clark

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About