Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7081437
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T06:55:16+00:00 2026-05-28T06:55:16+00:00

I am using a REXML Ruby parser to parse an XML file. But on

  • 0

I am using a REXML Ruby parser to parse an XML file. But on a 64 bit AIX box with 64 bit Ruby, I am getting the following error:

REXML::ParseException: #<REXML::ParseException: #<RegexpError: Stack overflow in 
regexp matcher: 
/^<((?>(?:[\w:][\-\w\d.]*:)?[\w:][\-\w\d.]*))\s*((?>\s+(?:[\w:][\-\w\d.]*:)?[\w:][\-\w\d.]*\s*=\s*(["']).*?\3)*)\s*(\/)?>/mu>

The call for the same is something like this:

REXML::Document.new(File.open(actual_file_name, "r"))

Does anyone have an idea regarding how to solve this issue?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T06:55:17+00:00Added an answer on May 28, 2026 at 6:55 am

    I almost immediately found the answer.

    The first thing I did was to search in the ruby source code for the error being thrown.
    I found that regex.h was responsible for this.

    In regex.h, the code flow is something like this:

    /* Maximum number of duplicates an interval can allow.  */
    #ifndef RE_DUP_MAX
    #define RE_DUP_MAX  ((1 << 15) - 1)
    #endif
    

    Now the problem here is RE_DUP_MAX. On AIX box, the same constant has been defined somewhere in /usr/include.
    I searched for it and found in

    /usr/include/NLregexp.h
    /usr/include/sys/limits.h
    /usr/include/unistd.h
    

    I am not sure which of the three is being used(most probably NLregexp.h).
    In these headers, the value of RE_DUP_MAX has been set to 255! So there is a cap placed on the number of repetitions of a regex!

    In short, the reason is the compilation taking the system defined value than that we define in regex.h!

    This also answers my question which i had asked recently:
    Regex limit in ruby 64 bit aix compilation

    I was not able to answer it immediately as i need to have min of 100 reputation 😀 😀
    Cheers!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to parse a xml document in ruby, using rexml, that has the
How does one go about renaming an XML element using REXML or another Ruby
I try to generate such XML using REXML <root> <add key='foo' value='bar'/> </root> But
I'm using REXML to parse through some XML data sent via POST. The XML
With reXml using Ruby, I have a particular element and I want to completely
I am using Xpath in Ruby with following statement. print XPath.first(Document.new(html),//tr[@id='ctl00_c1_rr_ci_trAdd']//td[2]) The Query return
I'm using ROXML to read and automatically build Ruby objects form properly formatted XML.
I have a XML File in the following format: <?xml version='1.0' encoding='UTF-8'?> <entry xmlns='http://www.w3.org/2005/Atom'
I'm using an if elsif elsif elsif end statement and Im getting the following
I'm parsing the wikipedia XML dump using a REXML StreamListener. After a few million

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.