Ticket #8 (closed defect: fixed)

Opened 7 years ago

Last modified 7 years ago

Stack overflow in regexp matcher for StrictBlockRegex

Reported by: deveiant Owned by: deveiant
Milestone: Previous Releases Component: MarkdownSyntax
Version: 0.0.4b Severity: normal
Keywords: regexp overflow bug Cc:

Description (last modified by deveiant) (diff)

Instiki 0.8.9 (or rather Bluecloth) gives me

Please correct the error that caused this error in rendering:
/var/instiki/instiki-0.8.9/app/models/../../libraries/bluecloth.rb:342:in `gsub!':

  Stack overflow in regexp matcher:

 / ^ # Start of line 
  <(p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script) # Start tag: \2
 \b # word break
 (.*\n)*? # Any number of lines, minimal match
 <\/\1> # Matching end tag
 [ ]* # trailing spaces
 (?=\n+|\Z) # End of line or document
 /ix

on the input below. Any ideas?

[input trimmed]

Change History

comment:1 Changed 7 years ago by deveiant

  • Status changed from new to assigned
  • Description modified (diff)

Thanks to an input file from Ian Macdonald, I'm finally able to reproduce this bug, and will begin trying to find a minimal test case to post to ruby-core. Since this bug happens in Ruby itself rather than in BlueCloth's code, I'll probably end up just searching for a workaround for those using current versions of Ruby.

comment:2 Changed 7 years ago by deveiant

  • Description modified (diff)

comment:3 Changed 7 years ago by deveiant

  • Status changed from assigned to closed
  • Resolution set to fixed

Date: 2004-08-31 01:27
Sender: Michael Granger
Logged In: YES
user_id=158

Fixed the one in one case in Rev 61 and a second case in changeset:68. Will be in 1.0.0.

Also made minimal test cases for the Ruby bug which triggers this, which can be found in the subversion repository under source:trunk/experiments/re-overflow.rb and experiments/re-overflow2.rb.

Note: See TracTickets for help on using tickets.