octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #35683] regexp crash (named subexp/nested pare


From: anonymous
Subject: [Octave-bug-tracker] [bug #35683] regexp crash (named subexp/nested paren; maybe related to #29438)
Date: Thu, 01 Mar 2012 19:48:07 +0000
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:10.0.2) Gecko/20100101 Firefox/10.0.2

URL:
  <http://savannah.gnu.org/bugs/?35683>

                 Summary: regexp crash (named subexp/nested paren; maybe
related to #29438)
                 Project: GNU Octave
            Submitted by: None
            Submitted on: Thu 01 Mar 2012 07:48:05 PM UTC
                Category: Libraries
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Crash
                  Status: None
             Assigned to: None
         Originator Name: Philipp Kutin
        Originator Email: address@hidden
             Open/Closed: Open
         Discussion Lock: Any
                 Release: dev
        Operating System: GNU/Linux

    _______________________________________________________

Details:

The following produces a crash, after loading the attached data:


s = regexp(q(1).contents, pattern, 'names');


The pattern is well-formed as far as I can see:

(?<typestr>((char|short|int|long|signed|unsigned|float|double|int8|uint8|int16|uint16|int32|uint32|int64|uint64|int8_t|uint8_t|int16_t|uint16_t|int32_t|uint32_t|int64_t|uint64_t|BYTE|UBYTE|WORD|DWORD|QWORD)\s+)+)(?<name>[a-zA-Z_][a-zA-Z0-9_]*)\s*(?<length>\[[0-9]+\])?\s*;

(of course, invalid regexps should not cause a crash either.)

I'm using the tip of the 'stable' branch on GNU/Linux and x86.

The crash is dependent on the string to be matched, e.g.

s = regexp('qwe int asd', pattern, 'names');

works fine.

When called without output args,

regexp(q(1).contents, pattern, 'names')

the following is printed in addition to the segfault message:

terminate called after throwing an instance of 'std::logic_error'
  what():  basic_string::_S_construct null not valid


A backtrace using an optimized build is attached, too.

Finally, don't bash me for trying to parse a real language using regexps, I
know it's braindead ;)




    _______________________________________________________

File Attachments:


-------------------------------------------------------
Date: Thu 01 Mar 2012 07:48:05 PM UTC  Name: structq  Size: 4kB   By: None
structq and pattern are to be loaded with 'load'. Backtrace with optimized
build.
<http://savannah.gnu.org/bugs/download.php?file_id=25232>
-------------------------------------------------------
Date: Thu 01 Mar 2012 07:48:05 PM UTC  Name: regexp_crash_1.log  Size: 11kB  
By: None
structq and pattern are to be loaded with 'load'. Backtrace with optimized
build.
<http://savannah.gnu.org/bugs/download.php?file_id=25233>
-------------------------------------------------------
Date: Thu 01 Mar 2012 07:48:05 PM UTC  Name: pattern  Size: 409B   By: None
structq and pattern are to be loaded with 'load'. Backtrace with optimized
build.
<http://savannah.gnu.org/bugs/download.php?file_id=25234>

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?35683>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]