tag:support.fletcherpenney.net,2013-02-12:/discussions/problems/771-completely-hangs-with-a-large-fileMultiMarkdown: Discussion 2018-02-08T02:27:50Ztag:support.fletcherpenney.net,2013-02-12:Comment/416438022016-12-31T07:31:00Z2016-12-31T07:31:01ZCompletely hangs with a "large" file<div><p>FWIW, looking through the code it looks this symptom presents
like the 'endless loop' bug that is commented about in
process_raw_block</p>
<p>--Chuck</p></div>Chucktag:support.fletcherpenney.net,2013-02-12:Comment/416438022016-12-31T11:59:25Z2016-12-31T11:59:25ZCompletely hangs with a "large" file<div><p>Chuck,</p>
<p>Happy new year!</p>
<p>That actually isn't that big of a file, so size itself isn't the
problem.</p>
<p>If you send me the file I can take a look and see if there's
anything peculiar about the structure and run MMD through a
debugger and see where it's getting hung up.</p>
<p>It's been a long time since I found a file that caused
MultiMarkdown to hang. Which version are you using?</p>
<p>Fletcher</p>
<p>Sent from my iPhone</p></div>fletchertag:support.fletcherpenney.net,2013-02-12:Comment/416438022016-12-31T18:58:24Z2016-12-31T18:58:26ZCompletely hangs with a "large" file<div><p>Hi Fletcher, file is attached</p>
<p>I managed to get yyparse debugging enabled and have a13G dump of
the output<br>
of yyparse when I'm going to crawl through if something doesn't pop
out to<br>
you. I'm using the latest version, I pulled it from github and
rebuilt from<br>
source.</p>
<p>--Chuck</p></div>Chuck McManistag:support.fletcherpenney.net,2013-02-12:Comment/416438022017-01-01T00:34:09Z2017-01-01T00:34:09ZCompletely hangs with a "large" file<div><p>Correct me if I'm misreading the file, but it's not valid HTML,
correct?<br>
I count one extra</p>
<div>for every "chunk" compared to</div>
's.
<p>FTP</p></div>fletchertag:support.fletcherpenney.net,2013-02-12:Comment/416438022017-01-01T01:09:58Z2017-01-01T01:09:59ZCompletely hangs with a "large" file<div><p>That it isn't valid HTML is certainly possible, it is the
penultimate step<br>
before my CMS system considers is ready to publish. Once the
markdown in<br>
the file has been process it is the contents value of another
template<br>
which puts things around it. Looking at the enclosing template
though it<br>
shouldn't have unmatched div's. I'll check that in my CMS code. I
also<br>
spent a lot of time bisecting the file to figure out if there was a
line<br>
that hung the parser (and eventually discovered that bisecting it
anywhere<br>
and both "halves" of the result would process.</p>
<p>--Chuck</p></div>Chuck McManistag:support.fletcherpenney.net,2013-02-12:Comment/416438022017-01-01T01:33:40Z2017-01-01T01:33:40ZCompletely hangs with a "large" file<div><p>Probably by cutting the number of divs in half, the problem of
matching openers and closers becomes more tractable.</p>
<p>PEGs don't do well in processing "almost but not quite" properly
formed text like this. ;)</p>
<p>Sent from my iPhone</p></div>fletchertag:support.fletcherpenney.net,2013-02-12:Comment/416438022017-01-01T06:31:09Z2017-01-01T06:31:10ZCompletely hangs with a "large" file<div><p>Hi Fletcher,</p>
<p>Thanks for the clue! I went back into my site generation code
and found the<br>
template that was missing the closing div. I fixed that and the
site<br>
published as expected. (and the index page went back to being legal
html at<br>
that point). So it seems like the issue was too many open</p>
<div>tags. That<br>
said, I wonder if multimarkdown could catch that and error out
rather than<br>
hang forever?
<p>--Chuck</p>
</div></div>Chuck McManistag:support.fletcherpenney.net,2013-02-12:Comment/416438022017-01-01T12:22:17Z2017-01-01T12:22:17ZCompletely hangs with a "large" file<div><p>The problem is that the way PEGs work is that it keeps trying to
find matched pairs of opening and closing tags that would represent
HTML blocks. It "knows" that each opener should have a closer but
struggles to figure out how to pair them up when the numbers are
wrong. It has to check the entire rest of the document because it's
possible there are a bunch of closers all together at the end, but
it never finds them. And it has to do that every time it finds a
new opener. And you have a lot of openers in your document.</p>
<p>I'm working on MultiMarkdown 6, which works in an entirely
different way and should be ok on this. But it's not ready yet.</p>
<p>Ftp</p>
<p>Sent from my iPhone</p></div>fletcher