Bug 196867

Summary: expr on FreeBSD doesn't bounds check certain values dealing with overflow very well
Product: Base System Reporter: Enji Cooper <ngie>
Component: binAssignee: freebsd-bugs (Nobody) <bugs>
Status: Closed FIXED    
Severity: Affects Some People CC: bde, se
Priority: --- Flags: ngie: mfc-stable10+
ngie: mfc-stable9-
ngie: mfc-stable8-
Version: CURRENT   
Hardware: Any   
OS: Any   

Description Enji Cooper freebsd_committer freebsd_triage 2015-01-19 06:02:46 UTC
It doesn't handle edgecases as well as NetBSD's copy of expr(1) does. Failing testcases from contrib/netbsd-tests coming soon..
Comment 1 Enji Cooper freebsd_committer freebsd_triage 2015-01-19 06:03:39 UTC
This is a followup to the discussion I started with bde and se offline...
Comment 2 commit-hook freebsd_committer freebsd_triage 2015-01-19 06:10:15 UTC
A commit references this bug:

Author: ngie
Date: Mon Jan 19 06:10:01 UTC 2015
New revision: 277357
URL: https://svnweb.freebsd.org/changeset/base/277357

Log:
  Expect :overflow to fail with FreeBSD's expr as it doesn't have stringent
  overflow checks like NetBSD's expr does

  MFC after: 3 days
  PR: 196867

Changes:
  head/contrib/netbsd-tests/bin/expr/t_expr.sh
Comment 3 commit-hook freebsd_committer freebsd_triage 2015-01-23 00:34:31 UTC
A commit references this bug:

Author: ngie
Date: Fri Jan 23 00:34:20 UTC 2015
New revision: 277549
URL: https://svnweb.freebsd.org/changeset/base/277549

Log:
  MFC r276671,r277357:

  r276671 (by ngie):

    Expect :arithmetic_ops_body to fail with syntax errors on FreeBSD

    Sponsored by: EMC / Isilon Storage Division

  r277357 (by ngie):

    Expect :overflow to fail with FreeBSD's expr as it doesn't have stringent
    overflow checks like NetBSD's expr does

    PR: 196867

Changes:
_U  stable/10/
  stable/10/contrib/netbsd-tests/bin/expr/t_expr.sh
Comment 4 commit-hook freebsd_committer freebsd_triage 2015-01-28 11:38:26 UTC
A commit references this bug:

Author: ngie
Date: Wed Jan 28 11:38:13 UTC 2015
New revision: 277829
URL: https://svnweb.freebsd.org/changeset/base/277829

Log:
  Revert r277357 as expr has been enhanced to better detect overflow conditions,
  and now the tests pass

  PR: 196867
  X-MFC with: r277798
  MFC after: 1 week
  Sponsored by: EMC / Isilon Storage Division

Changes:
  head/contrib/netbsd-tests/bin/expr/t_expr.sh
Comment 5 Enji Cooper freebsd_committer freebsd_triage 2015-02-05 11:13:38 UTC
*** Bug 191719 has been marked as a duplicate of this bug. ***
Comment 6 commit-hook freebsd_committer freebsd_triage 2015-05-23 09:16:39 UTC
A commit references this bug:

Author: rodrigc
Date: Sat May 23 09:16:36 UTC 2015
New revision: 283311
URL: https://svnweb.freebsd.org/changeset/base/283311

Log:
  Merge: r277829

  Revert r277357 as expr has been enhanced to better detect overflow conditions,
  and now the tests pass

  PR: 196867
  X-MFC with: r277798
  MFC after: 1 week
  Sponsored by: EMC / Isilon Storage Division

Changes:
_U  stable/10/
  stable/10/contrib/netbsd-tests/bin/expr/t_expr.sh