[pmwiki-users] Strange behavior of include directive -- was: PITS/00361

Patrick R. Michaud pmichaud at pobox.com
Wed Feb 15 11:17:50 CST 2006


On Wed, Feb 15, 2006 at 05:17:38PM +0100, Christian Bartolomaeus wrote:
> nearly one year ago I opened a PITS entry (#361) regarding the include
> directive. 

> As a workaround I began to split my large "story page" (Page2) in
> separate shorter pages. I didn't investigate much further in the
> problem and PITS/361 was closed in September 2005.

I closed PITS #00361 in September, somewhat assuming that the
other changes I made to #include had fixed the bug.  Apparently it
didn't.  :-|

> Today I took some time to see, whether the problem was really solved.
> It turned out, it wasn't. I moved two sample pages to pmwiki.org and
> the problem showed up again. You can see the examples at
> 
>   http://www.pmwiki.org/wiki/Test/BugWithInclude1  ## Page1
>   http://www.pmwiki.org/wiki/Test/BugWithInclude2  ## Page2

This example is *exactly* what I needed to find the bug.  After
some testing, I think the bug may actually be in PCRE!  Either
that or I'm totally misunderstanding the pattern I've been using
in the (:include:) code.

However, I fiddled with the matching pattern a bit, and ultimately
came up with a more optimized version that seems to be working now.
(See http://www.pmwiki.org/wiki/Test/BugWithInclude1 .)  The
new version of the include code will be in the beta26 release.

> So I guess the problem has something to do with the number of lines,
> the number of characters or with the length of single paragraphs of
> the pages, containing the anchors. 

I think it may have had something to do with the placement of the newlines
in the string that confuses the regular expression engine.  It might
also have to do with the length, or perhaps the stack is being blown
somehow.

Anyway, we'll try the new version and see if the problem persists.
Many thanks for the excellent test case and diagnostics!

Pm




More information about the pmwiki-users mailing list