public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/47724] New: Regex string anchors cause segfault
@ 2011-02-13 23:27 naddiseo at gmail dot com
  2011-02-14  0:00 ` [Bug libstdc++/47724] " paolo.carlini at oracle dot com
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: naddiseo at gmail dot com @ 2011-02-13 23:27 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47724

           Summary: Regex string anchors cause segfault
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: naddiseo@gmail.com


Created attachment 23329
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=23329
Test case

Using the regex anchors "^" or "$" cause a segfault.


$ /usr/lib/gcc-snapshot/bin/gcc -v
Using built-in specs.
COLLECT_GCC=/usr/lib/gcc-snapshot/bin/gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc-snapshot/libexec/gcc/x86_64-linux-gnu/4.6.0/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu
20101004-0ubuntu1' --with-bugurl=file:///usr/share/doc/gcc-snapshot/README.Bugs
--enable-languages=c,ada,c++,fortran,objc,obj-c++
--prefix=/usr/lib/gcc-snapshot --enable-shared --enable-multiarch
--enable-linker-build-id --with-system-zlib --disable-nls --with-sysroot=/
--enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes
--enable-plugin --enable-gold --with-plugin-ld=ld.gold --enable-objc-gc
--disable-werror --with-arch-32=i686 --with-tune=generic --enable-checking=yes
--build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.6.0 20101004 (experimental) [trunk revision 164952] (Ubuntu
20101004-0ubuntu1)


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug libstdc++/47724] Regex string anchors cause segfault
  2011-02-13 23:27 [Bug libstdc++/47724] New: Regex string anchors cause segfault naddiseo at gmail dot com
@ 2011-02-14  0:00 ` paolo.carlini at oracle dot com
  2011-02-14  0:07 ` [Bug libstdc++/47724] [C++0x] " redi at gcc dot gnu.org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: paolo.carlini at oracle dot com @ 2011-02-14  0:00 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47724

Paolo Carlini <paolo.carlini at oracle dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jwakely.gcc at gmail dot
                   |                            |com

--- Comment #1 from Paolo Carlini <paolo.carlini at oracle dot com> 2011-02-13 23:36:10 UTC ---
Note, regex is work in progress, I don't know if this is supposed to work or
not. Let's ask Jon...


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug libstdc++/47724] [C++0x] Regex string anchors cause segfault
  2011-02-13 23:27 [Bug libstdc++/47724] New: Regex string anchors cause segfault naddiseo at gmail dot com
  2011-02-14  0:00 ` [Bug libstdc++/47724] " paolo.carlini at oracle dot com
@ 2011-02-14  0:07 ` redi at gcc dot gnu.org
  2011-02-14  0:40 ` paolo.carlini at oracle dot com
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: redi at gcc dot gnu.org @ 2011-02-14  0:07 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47724

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2011.02.14 00:00:37
            Summary|Regex string anchors cause  |[C++0x] Regex string
                   |segfault                    |anchors cause segfault
     Ever Confirmed|0                           |1

--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> 2011-02-14 00:00:37 UTC ---
I think that code's meant to support some basic operations, so the fact it
crashes is definitely a bug.  We access an empty std::stack in
_Compiler::_M_alternative, I'll see if I can fix it.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug libstdc++/47724] [C++0x] Regex string anchors cause segfault
  2011-02-13 23:27 [Bug libstdc++/47724] New: Regex string anchors cause segfault naddiseo at gmail dot com
  2011-02-14  0:00 ` [Bug libstdc++/47724] " paolo.carlini at oracle dot com
  2011-02-14  0:07 ` [Bug libstdc++/47724] [C++0x] " redi at gcc dot gnu.org
@ 2011-02-14  0:40 ` paolo.carlini at oracle dot com
  2011-02-14 20:56 ` redi at gcc dot gnu.org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: paolo.carlini at oracle dot com @ 2011-02-14  0:40 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47724

--- Comment #3 from Paolo Carlini <paolo.carlini at oracle dot com> 2011-02-14 00:11:06 UTC ---
Thanks Jon.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug libstdc++/47724] [C++0x] Regex string anchors cause segfault
  2011-02-13 23:27 [Bug libstdc++/47724] New: Regex string anchors cause segfault naddiseo at gmail dot com
                   ` (2 preceding siblings ...)
  2011-02-14  0:40 ` paolo.carlini at oracle dot com
@ 2011-02-14 20:56 ` redi at gcc dot gnu.org
  2011-02-17  1:50 ` redi at gcc dot gnu.org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: redi at gcc dot gnu.org @ 2011-02-14 20:56 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47724

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
         AssignedTo|unassigned at gcc dot       |redi at gcc dot gnu.org
                   |gnu.org                     |
   Target Milestone|---                         |4.6.0

--- Comment #4 from Jonathan Wakely <redi at gcc dot gnu.org> 2011-02-14 20:45:57 UTC ---
mine


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug libstdc++/47724] [C++0x] Regex string anchors cause segfault
  2011-02-13 23:27 [Bug libstdc++/47724] New: Regex string anchors cause segfault naddiseo at gmail dot com
                   ` (3 preceding siblings ...)
  2011-02-14 20:56 ` redi at gcc dot gnu.org
@ 2011-02-17  1:50 ` redi at gcc dot gnu.org
  2011-02-17  1:56 ` redi at gcc dot gnu.org
  2011-02-17  2:57 ` redi at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: redi at gcc dot gnu.org @ 2011-02-17  1:50 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47724

--- Comment #5 from Jonathan Wakely <redi at gcc dot gnu.org> 2011-02-17 01:47:25 UTC ---
Author: redi
Date: Thu Feb 17 01:47:21 2011
New Revision: 170236

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=170236
Log:
2011-02-17  Jonathan Wakely  <jwakely.gcc@gmail.com>

    PR libstdc++/47724
    * include/bits/regex_compiler.h (_Scanner::_M_advance): Do not treat
    line anchors as metacharacters.
    * testsuite/28_regex/basic_regex/ctors/47724.cc: New.


Added:
    trunk/libstdc++-v3/testsuite/28_regex/basic_regex/ctors/47724.cc
Modified:
    trunk/libstdc++-v3/ChangeLog
    trunk/libstdc++-v3/include/bits/regex_compiler.h


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug libstdc++/47724] [C++0x] Regex string anchors cause segfault
  2011-02-13 23:27 [Bug libstdc++/47724] New: Regex string anchors cause segfault naddiseo at gmail dot com
                   ` (4 preceding siblings ...)
  2011-02-17  1:50 ` redi at gcc dot gnu.org
@ 2011-02-17  1:56 ` redi at gcc dot gnu.org
  2011-02-17  2:57 ` redi at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: redi at gcc dot gnu.org @ 2011-02-17  1:56 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47724

--- Comment #6 from Jonathan Wakely <redi at gcc dot gnu.org> 2011-02-17 01:55:05 UTC ---
I've checked in a change which prevents the crash, but only by treating line
anchors as non-metacharacters.  Unfortunately our regex implementation is
incomplete, but this is better than crashing


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug libstdc++/47724] [C++0x] Regex string anchors cause segfault
  2011-02-13 23:27 [Bug libstdc++/47724] New: Regex string anchors cause segfault naddiseo at gmail dot com
                   ` (5 preceding siblings ...)
  2011-02-17  1:56 ` redi at gcc dot gnu.org
@ 2011-02-17  2:57 ` redi at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: redi at gcc dot gnu.org @ 2011-02-17  2:57 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47724

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED

--- Comment #7 from Jonathan Wakely <redi at gcc dot gnu.org> 2011-02-17 01:56:07 UTC ---
... so fixed


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2011-02-17  1:56 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-02-13 23:27 [Bug libstdc++/47724] New: Regex string anchors cause segfault naddiseo at gmail dot com
2011-02-14  0:00 ` [Bug libstdc++/47724] " paolo.carlini at oracle dot com
2011-02-14  0:07 ` [Bug libstdc++/47724] [C++0x] " redi at gcc dot gnu.org
2011-02-14  0:40 ` paolo.carlini at oracle dot com
2011-02-14 20:56 ` redi at gcc dot gnu.org
2011-02-17  1:50 ` redi at gcc dot gnu.org
2011-02-17  1:56 ` redi at gcc dot gnu.org
2011-02-17  2:57 ` redi at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).