bugGNU Octave - Bugs: bug #31056, regexpi gets stuck into infintite...

 
 

bug #31056: regexpi gets stuck into infintite loop?

Submitter:  None
Submitted:  Fri 17 Sep 2010 10:03:16 AM UTC
   
 
Category:  Libraries Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Segfault, Bus Error, etc.
Status:  Fixed Assigned to:  None
Originator Name:  Vlatko Becanovic Originator Email:  -email is unavailable-
Open/Closed:  * Closed Release:  * 3.2.4
Operating System:  * Microsoft Windows Fixed Release:  None
Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

  Spam posted by anonymous
Mon 20 Sep 2010 03:23:06 PM UTC, comment #6: 

I checked in the following change:

  http://hg.savannah.gnu.org/hgweb/octave/rev/2538d03489cc

John W. Eaton <jwe>
Group administrator
Sat 18 Sep 2010 11:49:26 AM UTC, comment #5: 

I have pcre 7.8-2 installed and I don't have this problem. So I imaagine that something changed in the behavior of PCRE between my version and yours.

Your fix seems fine to me. If idx points beyond the buffer at the end of the loop then yes we should break.

D.

David Bateman <dbateman>
Group Member
Sat 18 Sep 2010 12:43:52 AM UTC, comment #4: 

I'm attaching a diff that appears to fix the problem for me.  I'm not sure whether this is the right or best fix.

I'm also attaching a transcript of a gdb session showing a trace of the execution path without this change.

(file #21481, file #21482)

John W. Eaton <jwe>
Group administrator
Fri 17 Sep 2010 08:52:12 PM UTC, comment #3: 

I  can duplicate the problem with the current sources.  I have

  octave> octave_config_info ("REGEX_LIBS")
  ans = -L/usr/lib -lpcre

and

  $ dpkg -l '*pcre*'
  ...
  ii  libpcre3       8.02-1.1       Perl 5 Compatible Regular Expression Library
  ii  libpcre3-dev   8.02-1.1       Perl 5 Compatible Regular Expression Library
  ii  libpcrecpp0    8.02-1.1       Perl 5 Compatible Regular Expression Library

This is on a current Debian amd64 testing system.

John W. Eaton <jwe>
Group administrator
Fri 17 Sep 2010 08:17:21 PM UTC, comment #2: 

In particular what does

octave_config_info ("REGEX_LIBS")

give? You might not have pcre installed whereas I think Jaroslav probably does

D.

David Bateman <dbateman>
Group Member
Fri 17 Sep 2010 07:42:50 PM UTC, comment #1: 

I can't reproduce this problem. I'm afraid you'll have to provide more info about your configuration.

Jaroslav Hajek <highegg>
Fri 17 Sep 2010 10:03:16 AM UTC, original submission:  

The command regexpi() will not work with the filter '.*' instead it gets stuck:

   regexpi('.svn','.*')

will freeze Octave. According to the Matlab standard its meaning is:
  
"    Metacharacter   Meaning
    ---------------  --------------------------------
                .    Any character

    metacharacter or grouped subexpression may be matched:
   
     Metacharacter   Meaning
    ---------------  --------------------------------
               *     Match zero or more occurrences "

Thank you for your time and effort!

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #21481:  diffs added by jwe (333B - application/octet-stream)
file #21482:  gdb-trace added by jwe (5KiB - application/octet-stream)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by jwe (Posted a comment)
  • -email is unavailable- added by dbateman (Posted a comment)
  • -email is unavailable- added by highegg (Posted a comment)
  • -email is unavailable- added by None (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2010-09-20 jwe StatusWorks For Me Fixed
        Open/ClosedOpen Closed
    2010-09-18 jwe Attached File- Added diffs, #21481
        Attached File- Added gdb-trace, #21482
    2010-09-17 highegg StatusNone Works For Me

    Back to the top

    Powered by Savane 3.13-caa5.
    Corresponding source code