[xml2rfc] text.py: endless loop in function paginate

Roger Price <roger@rogerprice.org> Fri, 08 January 2021 10:51 UTC

Return-Path: <roger@rogerprice.org>
X-Original-To: xml2rfc@ietfa.amsl.com
Delivered-To: xml2rfc@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 218063A00E5 for <xml2rfc@ietfa.amsl.com>; Fri, 8 Jan 2021 02:51:55 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.919
X-Spam-Level:
X-Spam-Status: No, score=-1.919 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id d43lpWHO2Xf4 for <xml2rfc@ietfa.amsl.com>; Fri, 8 Jan 2021 02:51:53 -0800 (PST)
Received: from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net [217.70.183.199]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 7FD003A00D8 for <xml2rfc@ietf.org>; Fri, 8 Jan 2021 02:51:52 -0800 (PST)
X-Originating-IP: 78.243.124.66
Received: from maria (unknown [78.243.124.66]) (Authenticated sender: mailbox@rogerprice.org) by relay9-d.mail.gandi.net (Postfix) with ESMTPSA id B11CDFF808 for <xml2rfc@ietf.org>; Fri, 8 Jan 2021 10:51:49 +0000 (UTC)
Date: Fri, 08 Jan 2021 11:51:48 +0100
From: Roger Price <roger@rogerprice.org>
X-X-Sender: rprice@maria.rogerprice.org
To: xml2rfc Mailing List <xml2rfc@ietf.org>
Message-ID: <alpine.DEB.2.20.2101081026540.26613@maria.rogerprice.org>
User-Agent: Alpine 2.20 (DEB 67 2015-01-07)
X-Message-Flag: Supplemental report to reaper.nsa.gov. rc=0
MIME-Version: 1.0
Content-Type: text/plain; format="flowed"; charset="US-ASCII"
Archived-At: <https://mailarchive.ietf.org/arch/msg/xml2rfc/eqMnH3ddTEmKDoCNx-iDNdnkm4c>
Subject: [xml2rfc] text.py: endless loop in function paginate
X-BeenThere: xml2rfc@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: <xml2rfc.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/xml2rfc>, <mailto:xml2rfc-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/xml2rfc/>
List-Post: <mailto:xml2rfc@ietf.org>
List-Help: <mailto:xml2rfc-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/xml2rfc>, <mailto:xml2rfc-request@ietf.org?subject=subscribe>
X-List-Received-Date: Fri, 08 Jan 2021 10:51:55 -0000

Function paginate got into an endless loop so I added some calls to print, let 
it run and stopped the loop with a Ctl-c. I saw the attached output.

The source document is still "work in progress" but is structurally correct.
I hesitate to attach it since it's 1500 lines.

Roger

text.py: start_lineno=0 textlen=999 page=1
text.py: break_lineno=52 break_target=52
text.py: olen=7 wlen=1 blen=8 elem.tag=t
text.py: start_lineno=45 textlen=999 page=2
text.py: break_lineno=93 break_target=93
text.py: olen=4 wlen=119 blen=123 elem.tag=t
text.py: start_lineno=93 textlen=999 page=3
text.py: break_lineno=141 break_target=141
text.py: olen=52 wlen=71 blen=123 elem.tag=t
text.py: start_lineno=141 textlen=999 page=4
text.py: break_lineno=189 break_target=189
text.py: olen=100 wlen=23 blen=123 elem.tag=t
text.py: start_lineno=189 textlen=999 page=5
text.py: break_lineno=237 break_target=237
text.py: olen=0 wlen=6 blen=6 elem.tag=section
text.py: range(block.beg=237, break_target=237)
text.py: start_lineno=237 textlen=999 page=6
text.py: break_lineno=285 break_target=285
text.py: olen=6 wlen=1 blen=7 elem.tag=section
text.py: range(block.beg=279, break_target=285)
text.py: start_lineno=279 textlen=999 page=7
text.py: break_lineno=327 break_target=327
text.py: olen=0 wlen=4 blen=4 elem.tag=section
text.py: range(block.beg=327, break_target=327)
text.py: start_lineno=327 textlen=999 page=8
text.py: break_lineno=375 break_target=375
text.py: block=None
text.py: start_lineno=374 textlen=999 page=9
text.py: break_lineno=422 break_target=422
text.py: block=None
text.py: start_lineno=423 textlen=999 page=10
text.py: break_lineno=471 break_target=471
text.py: block=None
text.py: start_lineno=472 textlen=999 page=11
text.py: break_lineno=520 break_target=520
text.py: olen=0 wlen=1 blen=1 elem.tag=dt
text.py: start_lineno=520 textlen=999 page=12
text.py: break_lineno=568 break_target=568
text.py: olen=32 wlen=78 blen=110 elem.tag=section
text.py: range(block.beg=536, break_target=568)
text.py: start_lineno=536 textlen=999 page=13
text.py: break_lineno=584 break_target=584
text.py: olen=48 wlen=62 blen=110 elem.tag=section
text.py: range(block.beg=536, break_target=584)
text.py: start_lineno=536 textlen=999 page=14
text.py: break_lineno=584 break_target=584
text.py: olen=48 wlen=62 blen=110 elem.tag=section
text.py: range(block.beg=536, break_target=584)
text.py: start_lineno=536 textlen=999 page=15
text.py: break_lineno=584 break_target=584
text.py: olen=48 wlen=62 blen=110 elem.tag=section
text.py: range(block.beg=536, break_target=584)
text.py: start_lineno=536 textlen=999 page=16
...
text.py: break_lineno=584 break_target=584
text.py: olen=48 wlen=62 blen=110 elem.tag=section
text.py: range(block.beg=536, break_target=584)
text.py: start_lineno=536 textlen=999 page=9621
text.py: break_lineno=584 break_target=584
text.py: olen=48 wlen=62 blen=110 elem.tag=section
text.py: range(block.beg=536, break_target=584)
Traceback (most recent call last):
   File "/usr/bin/xml2rfc", line 11, in <module>
     sys.exit(main())
   File "/mnt/home/rprice/.local/lib/python3.5/site-packages/xml2rfc/run.py",
        line 739, in main writer.write(filename)
   File "/mnt/home/rprice/.local/lib/python3.5/site-packages/xml2rfc/writers/text.py",
        line 343, in write text = self.process()
   File "/mnt/home/rprice/.local/lib/python3.5/site-packages/xml2rfc/writers/text.py",
        line 305, in process lines = self.paginate(lines)
   File "/mnt/home/rprice/.local/lib/python3.5/site-packages/xml2rfc/writers/text.py",
        line 461, in paginate paginated += lines[start_lineno:break_lineno]
KeyboardInterrupt