Bug 209387 - [exp-run] sed fix.
Summary: [exp-run] sed fix.
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Ports Framework (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Pedro F. Giffuni
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-05-09 00:41 UTC by Pedro F. Giffuni
Modified: 2016-06-28 03:14 UTC (History)
2 users (show)

See Also:


Attachments
Fix for sed issue (3.53 KB, patch)
2016-05-09 00:41 UTC, Pedro F. Giffuni
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Pedro F. Giffuni freebsd_committer freebsd_triage 2016-05-09 00:41:08 UTC
Created attachment 170127 [details]
Fix for sed issue

Hello;

The following path solves a sed issue that affects building the newer Mesa.
I want to make sure there are no side effects from the fix.
Comment 1 Antoine Brodin freebsd_committer freebsd_triage 2016-05-11 09:33:20 UTC
Exp-run results:

http://package18.nyi.freebsd.org/build.html?mastername=headamd64PR209387-default&build=2016-05-09_17h46m17s

0 new failure,  looks fine.
Comment 2 Pedro F. Giffuni freebsd_committer freebsd_triage 2016-05-11 14:26:37 UTC
(In reply to Antoine Brodin from comment #1)

Great news ...

Thanks!
Comment 3 commit-hook freebsd_committer freebsd_triage 2016-05-25 15:43:17 UTC
A commit references this bug:

Author: pfg
Date: Wed May 25 15:42:40 UTC 2016
New revision: 300684
URL: https://svnweb.freebsd.org/changeset/base/300684

Log:
  sed: convert sed to use REG_STARTEND more explicitly.

  Summarizing the findings in the OpenBSD list:

  This solves a reproduceable issue with very recent Mesa where REG_NOTBOL
  combined with a match at the begin of the string causes our regex library
  to treat the word as not begin of word.

  Thanks to Martijn van Duren and Ingo Schwarze for taking the time to
  solve this in the least invasive way.

  PR:		209352, 209387
  Taken from:     openbsd-tech (Martijn van Duren)
  MFC after:	1 month

Changes:
  head/usr.bin/sed/process.c
Comment 4 Pedro F. Giffuni freebsd_committer freebsd_triage 2016-05-25 18:43:32 UTC
The committed fix is more conservative than the original patch. and the part affecting regex is documented.

Huge thanks for the exp-run
Comment 5 commit-hook freebsd_committer freebsd_triage 2016-06-27 20:54:29 UTC
A commit references this bug:

Author: pfg
Date: Mon Jun 27 20:54:03 UTC 2016
New revision: 302228
URL: https://svnweb.freebsd.org/changeset/base/302228

Log:
  sed(1): convert sed to use REG_STARTEND more explicitly.

  Summarizing the findings in the OpenBSD list:

  This solves a reproduceable issue with very recent Mesa where REG_NOTBOL
  combined with a match at the begin of the string causes our regex library
  to treat the word as not begin of word.

  Bump __FreeBSD_version: JIC we hit the issue in recent Mesa ports.

  PR:		209352, 209387 (exp-run)
  Taken from:     openbsd-tech (Martijn van Duren)
  MFC after:	1 month

Changes:
_U  stable/10/
  stable/10/sys/sys/param.h
  stable/10/usr.bin/sed/process.c
Comment 6 Mikhail Teterin freebsd_committer freebsd_triage 2016-06-28 02:52:05 UTC
Things are broken now:

Before -- using the still-installed sed:

    echo aab | sed 's/^a//g'
    ab

after -- using the just-rebuilt executable:

    echo aab | /usr/obj/ibm/src/usr.bin/sed/sed 's/^a//g'
    b

The old behavior was correct. GNU sed does the same as we used to -- in fact, I caught this by applying GNU sed's testsuit against our sed.
Comment 7 Pedro F. Giffuni freebsd_committer freebsd_triage 2016-06-28 02:56:48 UTC
(In reply to Mikhail Teterin from comment #6)
Ooopsie ... I forgot to merge r301138, which is the cause of this.

Will fix, thanks!
Comment 8 commit-hook freebsd_committer freebsd_triage 2016-06-28 03:12:01 UTC
A commit references this bug:

Author: pfg
Date: Tue Jun 28 03:11:07 UTC 2016
New revision: 302244
URL: https://svnweb.freebsd.org/changeset/base/302244

Log:
  MFC r301138:
  sed(1): convert sed to use REG_STARTEND more explicitly.

  This is a followup to previous r302228, which only merged the
  incomplete r300684 causing a regression.

  Reported by:	mi
  PR:		209387
  Taken from:     openbsd-tech (Martijn van Duren)

Changes:
_U  stable/10/
  stable/10/usr.bin/sed/process.c
Comment 9 Pedro F. Giffuni freebsd_committer freebsd_triage 2016-06-28 03:14:08 UTC
Tested and merged.
Thanks!