Hi, I have been trying to make use of a Ruby static blogging engine (Rassmalog http://rassmalog.rubyforge.org/output/index.html ). Unfortunately I cannot get it to work on Gentoo. I do not experience this problem on Ubuntu (Edgy/Feisty) with the same versions of software installed. I initially filed a bug with Rassmalog: http://rubyforge.org/tracker/?func=detail&atid=10555&aid=10147&group_id=2737 The developer there (Suraj) distilled the problem down to an issue with Redcloth which I believe is an issue with Redcloth/Ruby on Gentoo as it seems that this issue (for me at least) only manifests itself on Gentoo, with both ruby 1.8.5p2 and ruby 1.8.6-r1. I have not yet tried other versions from portage. I am experiencing a stack overflow in Ruby's regex library when running the following: $ ruby -ryaml -rubygems -e "require 'redcloth'; f = YAML.load_file('regexp-stack-overflow.yaml'); puts RedCloth.new(f['text']).to_html" /usr/lib/ruby/site_ruby/1.8/redcloth.rb:571:in `gsub!': Stack overflow in regexp matcher: /((?:^([#*> ])(?:[^\n]|\n+(?:\2|>)|\n(?!\n|\Z))+))|((?:[^\n]+|\n+ +|\n(?![#*\n]|\Z))+)/m (RegexpError) from /usr/lib/ruby/site_ruby/1.8/redcloth.rb:571:in `blocks' from /usr/lib/ruby/site_ruby/1.8/redcloth.rb:276:in `to_html' from -e:3 I have the following setup: $ uname -a Linux godspeed 2.6.18-gentoo-r6 #1 PREEMPT Sun Dec 31 13:52:07 GMT 2006 i686 AMD Athlon(tm) 64 Processor 3000+ AuthenticAMD GNU/Linux $ gem list --local redcloth *** LOCAL GEMS *** RedCloth (3.0.4) RedCloth is a module for using Textile and Markdown in Ruby. Textile and Markdown are text formats. A very simple text format. Another stab at making readable text that can be converted to HTML. I get this error when running it on the following YAML/redcloth file (this came from rassmalog a static blogging engine): The <SNIP's> are not part of the file.) <SNIP file="regexp-stack-overflow.yaml"> name: Version 2.0.0 date: Thu Dec 14 15:26:05 PST 2006 @18 /Internet Time/ tags: - history text: | This release adds support for L10N(Localization)/I18N(Internationalization)/M17N(Multilingualization), adds new configuration parameters, fixes some bugs, and improves the documentation. h1. Caution * Generated file names no longer have spaces in them. * Blog entry file names are now required to end with <tt>.yaml</tt> * Variables available in ERB templates have been renamed. * The _publish_ task, which uploads your blog to your website, has been renamed to _upload_ for clarity. * The _index_ parameter has been renamed to _recent_entries_ in the primary blog configuration file. h1. Details * New configuration parameters have been added to the blog configuration file: ** The _front_page_ parameter defines the name of a file in the output/ directory that should be the front page of your blog. This allows you to display an entry as your front page. ** The _summarize_entries_ parameter specifies whether entries are summarized in tag and archive pages. ** The _uploader_ parameter defines the command that uploads your blog to your website. * English text used in core of Rassmalog can now be easily translated for L10N(Localization)/I18N(Internationalization)/M17N(Multilingualization) without having to edit the source code. * A list of recent entries is now generated before the archives in the navigation menu. * Blog entry names and tags can now contain question marks and other characters in URL syntax. * Output is now correctly generated whenever the associated source file (configuration, blog entriess) changes. * Descriptions of parameters in examples and templates have been improved. * Incorrect detection of absolute URLs in RSS feed template has been fixed. * Incorrect parsing of an anchor for the table of contens has been fixed. * The content of <code> and <tt> elements is now preserved verbatim by the @String.to_html@ method. * Text that is indented in Textile (which is supposed to be pre-formatted verbatim text) is no longer processed as source code. * The <tt>README</tt> and <tt>HISTORY</tt> documentation files have been converted into blog entries. You're reading one of them now! </SNIP> Reproducible: Always Steps to Reproduce: 1. Install redcloth (3.0.4) via ruby gems: sudo gem install redcloth 2. Copy the contents between the <SNIP> tags in the bug description to a file regexp-stack-overflow.yaml. 3. Run the following: $ ruby -ryaml -rubygems -e "require 'redcloth'; f = YAML.load_file('regexp-stack-overflow.yaml'); puts RedCloth.new(f['text']).to_html" Actual Results: /usr/lib/ruby/site_ruby/1.8/redcloth.rb:571:in `gsub!': Stack overflow in regexp matcher: /((?:^([#*> ])(?:[^\n]|\n+(?:\2|>)|\n(?!\n|\Z))+))|((?:[^\n]+|\n+ +|\n(?![#*\n]|\Z))+)/m (RegexpError) from /usr/lib/ruby/site_ruby/1.8/redcloth.rb:571:in `blocks' from /usr/lib/ruby/site_ruby/1.8/redcloth.rb:276:in `to_html' from -e:3 Expected Results: To have the redcloth/yaml file turned into a string of html.
Created attachment 119674 [details] The YAML/redcloth file which generates the exception
Created attachment 119676 [details] My emerge --info
Created attachment 119679 [details] emerge --info You might want to consider an upgrade to gcc-4 This works for me on x86 & amd64 with gcc-4.1.2
Created attachment 120229 [details] emerge --info I've just upgraded to gcc 4.1.2 and set it to my default with gcc-config. I've also recompiled Ruby (and system) with it. I still experience the same error.
I'm afraid that I can't reproduce this either with gcc-4.1.1-r3 on an AMD64 system. It might be useful to try to isolate the problem further, hopefully to a single regexp that exhibits this behavior (without the use of YAML, etc). That may provide additional pointers to where the problem is located.
Since no new information came to light I'm closing this as WORKSFORME. Without a reproduceable case or a bug fix there isn't that much we can do about it. Please reopen the bug if there is more information.