Bug 210573 - Random "egrep" or "grep -E" behaviour of bsdgrep
Summary: Random "egrep" or "grep -E" behaviour of bsdgrep
Status: Closed Not Accepted
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: CURRENT
Hardware: amd64 Any
: --- Affects Many People
Assignee: freebsd-bugs mailing list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-06-25 14:48 UTC by dmilith
Modified: 2016-06-26 00:22 UTC (History)
4 users (show)

See Also:
op: mfc-stable10?


Attachments
colorful shell example of bsdgrep bug (178.39 KB, image/png)
2016-06-25 14:51 UTC, dmilith
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description dmilith 2016-06-25 14:48:42 UTC
https://gist.github.com/dmilith/6475ce7870881f1d63b36ae978d876a4
or http://s.verknowsys.com/fd63fa3af0ad3c7eac54f19c4db1c636.png

Command:

echo '1.0.2' | grep -E '^1.0.[0-9]+$'

or

echo '1.0.2' | egrep '^1.0.[0-9]+$'


bsdgrep installed as main grep (WITH_BSD_GREP=1):

grep (BSD grep) 2.5.1-FreeBSD
Comment 1 dmilith 2016-06-25 14:51:52 UTC
Created attachment 171790 [details]
colorful shell example of bsdgrep bug
Comment 2 dmilith 2016-06-25 14:52:54 UTC
[1466841140] bh:/var/sofin λ uname -a
FreeBSD bh 11.0-ALPHA4-HBSD FreeBSD 11.0-ALPHA4-HBSD #10: Fri Jun 24 02:47:49 CEST 2016     root@bh:/usr/obj/usr/src/sys/VERKNOWSYS  amd64
Comment 3 dmilith 2016-06-25 14:54:18 UTC
Also you can read all my src.conf, make.conf and kernel configuration here: https://github.com/VerKnowSys/ServeD-OS/tree/master/etc - it's all open, all BSD licensed as well. Hope it helps :)
Comment 4 dmilith 2016-06-25 15:01:20 UTC
Ok. Problem isn't FreeBSD issue, but HardenedBSD one (ASLR bug). Closing it here.
Comment 5 op 2016-06-25 23:59:58 UTC
Please reopen this bug, since this is a bsdgrep issue:

23:35 <@Zer0P> ==48224== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)
23:35 <@Zer0P> ==48224== 
23:35 <@Zer0P> ==48224== 1 errors in context 1 of 1:
23:35 <@Zer0P> ==48224== Conditional jump or move depends on uninitialised value(s)
23:35 <@Zer0P> ==48224==    at 0x4EB04FF: regexec (in /lib/libc.so.7)
23:35 <@Zer0P> ==48224==    by 0x10DDF2: procfile (in /usr/src/usr.bin/grep/bsdgrep)
23:35 <@Zer0P> ==48224==    by 0x10D2EF: main (in /usr/src/usr.bin/grep/bsdgrep)
23:35 <@Zer0P> ==48224==  Uninitialised value was created by a stack allocation
23:35 <@Zer0P> ==48224==    at 0x10DB2D: procfile (in /usr/src/usr.bin/grep/bsdgrep)
23:35 <@Zer0P> ==48224== 
23:35 <@Zer0P> ==48224== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)
Comment 6 op 2016-06-26 00:08:27 UTC
Btw, it's not an ASLR bug, it's an ASLR triggered bug in bsdgrep.