From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 2AF6A3847813; Fri, 10 Sep 2021 19:40:55 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2AF6A3847813 From: "mehmetgelisin at aol dot com" To: glibc-bugs-regex@sourceware.org Subject: [Bug regex/25322] regex mishandles back-references inside interval expressions Date: Fri, 10 Sep 2021 19:40:55 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: glibc X-Bugzilla-Component: regex X-Bugzilla-Version: 2.30 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: mehmetgelisin at aol dot com X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: security- X-Bugzilla-Changed-Fields: cc Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: glibc-bugs-regex@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Glibc-bugs-regex mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Sep 2021 19:40:56 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D25322 Mehmet gelisin changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |mehmetgelisin at aol dot c= om --- Comment #40 from Mehmet gelisin --- Glibc regular expression code mishandles regular expressions such as: .*((.)\2){2}$ http://www-look-4.com/ as it does not backtrack enough to find a match that satisfies the back-references when they are used twice. To reproduce the problem, compile and run the attached file backrefbug.c. It will exit with status 2, whereas the correct exit status is 0.=20 http://www.compilatori.com/ This bug was originally reported against GNU 'grep' here: http://www.wearelondonmade.com/ and you can find more test cases by reading=20 Now, let's try to debug this: ... $ gdb --args gdb -batch test.c http://www.jopspeech.com/ Reading symbols from /home/vries/gdb_versions/devel/gdb... (gdb) start Temporary breakpoint 1 at 0x417f36: file /home/vries/gdb_versions/devel/src/gdb/gdb.c, line 28. Starting program: /home/vries/gdb_versions/devel/gdb -data-directory /home/vries/gdb_versions/devel/build/gdb/testsuite/../data-directory -q -nw= -nx -batch test.c [Thread debugging using libthread_db enabled] http://joerg.li/ Using host libthread_db library "/lib64/libthread_db.so.1". Temporary breakpoint 1, main (argc=3D8, argv=3D0x7fffffffdbf8) at /home/vries/gdb_versions/devel/src/gdb/gdb.c:28 28 memset (&args, 0, sizeof args); (gdb) n 29 args.argc =3D argc; http://connstr.net/ (gdb) n 30 args.argv =3D argv; (gdb) n 31 args.interpreter_p =3D INTERP_CONSOLE; (gdb) n 32 return gdb_main (&args); http://embermanchester.uk/ (gdb) n [New Thread 0x7fffefc75700 (LWP 11712)] [New Thread 0x7fffef474700 (LWP 11713)] [New Thread 0x7fffeec73700 (LWP 11714)] [Detaching after vfork from child process 11715] http://www.slipstone.co.uk/ [New Thread 0x7fffee156700 (LWP 11716)] [New Thread 0x7fffe7fff700 (LWP 11717)] [New Thread 0x7fffed955700 (LWP 11718)] http://www.logoarts.co.uk/ [New Thread 0x7fffed154700 (LWP 11719)] /home/vries/gdb_versions/devel/src/gdb/infrun.c:6384: internal-error: void process_event_stop_test(execution_control_state*): http://www.acpirateradio.co.uk/ Assertion `ecs->event_thread->control.exception_resume_breakpoint !=3D NUL= L' failed. A problem internal to GDB has been detected, further debugging may prove unreliable. https://waytowhatsnext.com/ Quit this debugging session? [New Thread 0x7fffefc75700 (LWP 11712)] [New Thread 0x7fffef474700 (LWP 11713)] [New Thread 0x7fffeec73700 (LWP 11714)] https://www.webb-dev.co.uk/ [Detaching after vfork from child process 11715] [New Thread 0x7fffefc75700 (LWP 11712)] [New Thread 0x7fffef474700 (LWP 11713)] [New Thread 0x7fffeec73700 (LWP 11714)] http://www.iu-bloomington.com/ [Detaching after vfork from child process 11715] [New Thread 0x7fffefc75700 (LWP 11712)] [New Thread 0x7fffef474700 (LWP 11713)] [New Thread 0x7fffeec73700 (LWP 11714)] [Detaching after vfork from child process 11715] --=20 You are receiving this mail because: You are on the CC list for the bug.=