https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=251081

            Bug ID: 251081
           Summary: Grep Crashes with both «--after-context» «--max-count»
                    Switches are Used
           Product: Base System
           Version: 12.2-RELEASE
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Some People
          Priority: ---
         Component: bin
          Assignee: b...@freebsd.org
          Reporter: crazymi...@ya.ru

Created attachment 219606
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=219606&action=edit
Grep Memory Dump 12.2 x64

FreeBSD Grep Utility Crushes in a case of simultaneously specifying two
Switches: «--after-context=NUM» (-A NUM) and «--max-count=NUM» (-m NUM). This
happens when Russian Language (for Example) is Used.
The Example to ReProduce this Error (EveryOne can Try, if Brave enough):
# id -c
russian
#grep --after-context="10" --max-count="2" "" "/etc/passwd"
# $FreeBSD: releng/12.2/etc/master.passwd 359447 2020-03-30 17:07:05Z brooks $
#
Segmentation fault (стек памяти сброшен на диск)

or, without specifying the «Russian» LogIn Class (ReProduced on any System):
# env LANG="ru_RU.UTF-8" grep --after-context="10" --max-count="2" ""
"/etc/passwd" || printf "Error Number: %u (0x%.2X).\n" "${?}" "${?}"
# $FreeBSD: releng/12.2/etc/master.passwd 359447 2020-03-30 17:07:05Z brooks $
#
Segmentation fault (стек памяти сброшен на диск)
Error Number: 139 (0x8B).       # Looks like 0x80 + 0x0B: «SIGSEGV».

shows the same Result. «egrep» does the same.
# grep --version
grep (GNU grep) 2.5.1-FreeBSD
This Issue was found with these Systems:
 ● FreeBSD 11.2-RELEASE #0 r335510: Fri Jun 22 04:32:14 UTC 2018 GENERIC amd64
 ● FreeBSD 12.1-RELEASE-p2 r358570 CrazyBook i386
 ● FreeBSD 12.2-RELEASE r366954 GENERIC i386
 ● FreeBSD 12.2-RELEASE r366954 GENERIC amd64
This is not a Critical Error, but IMHO, Developers should Know about It.
Thank You and Sorry, if It is not Important.

-- 
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
freebsd-bugs@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-bugs
To unsubscribe, send any mail to "freebsd-bugs-unsubscr...@freebsd.org"

Reply via email to