Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 12 Nov 2020 19:05:19 +0000
From:      bugzilla-noreply@freebsd.org
To:        bugs@FreeBSD.org
Subject:   =?UTF-8?B?W0J1ZyAyNTEwODFdIEdyZXAgQ3Jhc2hlcyB3aXRoIGJvdGggwqst?= =?UTF-8?B?LWFmdGVyLWNvbnRleHTCuyDCqy0tbWF4LWNvdW50wrsgU3dpdGNoZXMgYXJl?= =?UTF-8?B?IFVzZWQ=?=
Message-ID:  <bug-251081-227@https.bugs.freebsd.org/bugzilla/>

index | next in thread | raw e-mail

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: bugs@FreeBSD.org
          Reporter: CrazyMihey@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.

help

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-251081-227>