Bug #3471
closed
The below can be used to confirm this issue anywhere substitutions are used.
[cb:if user_id="myid"]1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890[/cb:if]
- Status changed from Assigned to Feedback
- Assignee changed from krileon to beat
Appears to be a stack overflow issue for preg_replace_callback. On windows servers it's quite small (like 1MB) while linux is significantly higher. Seams the only solution is to increase that stack overflow for apache or use smaller strings in their substitutions (maybe break it up into 3 or 4 of the same substitutions to keep them smaller). Don't see a solution we can implement without forcing the string into chunks, which could just end up breaking the substitutions if a substitution got split incorrectly.
- Target version changed from CB 1.8.1 to CB 1.9
- Status changed from Feedback to New
- Priority changed from High to Normal
- Target version changed from CB 1.9 to CB 2.1
Not really an issue in CB imho. Something to keep in mind for CB 2.0.
This is due to the massive amount of backtracking taking place. The current REGEXP will take 15,886 steps in the REGEXP engine to match a string with 7,953 characters. The proposes new REGEXP only takes 42 steps.
SEE ATTACHED FILE
The problem is the new usage can't work with IF substitutions that are side by side. This is simply early findings and of course needs further investigation, but this maybe fixable with just better REGEXP.
This is easily fixed by limiting the backtracking by fixing the [^\[] to [^\[]+. This will group up strings that it can so they're checked in chunks instead of literally character by character. It will only backtrack if it needs to from the other conditions.
- Status changed from New to Assigned
- Assignee changed from beat to krileon
- % Done changed from 0 to 100
- Status changed from Assigned to Closed
Also available in: Atom
PDF