[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [ft-devel] endless loops in bytecode
From: |
Roland Mainz |
Subject: |
Re: [ft-devel] endless loops in bytecode |
Date: |
Mon, 12 Sep 2016 19:52:02 +0200 |
On Mon, Sep 12, 2016 at 4:09 PM, Alexei Podtelezhnikov
<address@hidden> wrote:
> On Sat, Sep 10, 2016 at 1:38 PM, Werner LEMBERG <address@hidden> wrote:
>> do you have any ideas how to discover endless loops in bytecode that
>> don't change the nesting level?
>>
>> My only idea up to date is to count JMPR, JROT, and JROF separately,
>> using a threshold of, say, 10000.
>
> It turns out this is a famous CS topic:
> https://en.wikipedia.org/wiki/Halting_problem
>
> So your idea of counting jumps is cheap and reasonable. I would run a
> total jump count of any kind though and stop after 1000 jumps of any
> kind. Enough is enough.The bytecode length is limited to 65536 (no?).
> In the worst case scenario, 1000 jumps will produce 65 million
> instructions. Perhaps, the total jump count should be even smaller,
> like 100.
I'd go more for a limit like 0xFF or 0xFFF. IMHO a jump count of "100"
is far too small...
----
Bye,
Roland
--
__ . . __
(o.\ \/ /.o) address@hidden
\__\/\/__/ MPEG specialist, C&&JAVA&&Sun&&Unix programmer
/O /==\ O\ TEL +49 641 3992797
(;O/ \/ \O;)