From owner-freebsd-stable@freebsd.org Sun Nov 6 01:23:35 2016 Return-Path: Delivered-To: freebsd-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7B553C30B99 for ; Sun, 6 Nov 2016 01:23:35 +0000 (UTC) (envelope-from gcr+freebsd-stable@tharned.org) Received: from roadkill.tharned.org (gcrivers-1-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:107f::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1CC8CF0E for ; Sun, 6 Nov 2016 01:23:35 +0000 (UTC) (envelope-from gcr+freebsd-stable@tharned.org) Received: from [2001:470:1f11:107f:b8e5:d5d8:b3c8:4edb] ([IPv6:2001:470:1f11:107f:b8e5:d5d8:b3c8:4edb]) (authenticated bits=0) by roadkill.tharned.org (8.15.2/8.15.2) with ESMTPSA id uA61NPe9001521 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Sat, 5 Nov 2016 20:23:33 -0500 (CDT) (envelope-from gcr+freebsd-stable@tharned.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tharned.org; s=2016; t=1478395413; bh=US5bQ/uznwxrke69Dh2e6HG/sT9Sq1w+CD3cND1lTck=; h=Date:From:To:Subject; b=eQYBxucA4sX592N+X8AJK4q/AgImolfLOwb0G7tKg0bdzb0XRx54qIixpHcnT3CTb keM8e/4FHRDiJ/E0ijHRC0lzwjkrnYTqUAjf2rT8fKjmSmwrGqFMNHvuL1bhW9Azbd picEID2bg2ct8sHLHQU4ac5mVhYT7Hdm4nNJG1Z8sApuSCic0OiKEmNDaw+FDt0irc 6VU0n4V6Okqj1AcLYrqdO/EC/37z09d3c72eNYfAS2y/LS58faxwnLefKVl6iS1yq9 T5PtK6ZgwO1UHVRNu0ud5Lcak39RLDHRG88L1sWh3QqGw4MoS8Kr2UWGNOGyxwD0Ml H1AOAzl7Tb89Q== X-Authentication-Warning: roadkill.tharned.org: Host [IPv6:2001:470:1f11:107f:b8e5:d5d8:b3c8:4edb] claimed to be [2001:470:1f11:107f:b8e5:d5d8:b3c8:4edb] Date: Sat, 5 Nov 2016 20:23:25 -0500 (CDT) From: Greg Rivers To: freebsd-stable@freebsd.org Subject: Uppercase RE matching problems in FreeBSD 11 Message-ID: User-Agent: Alpine 2.20 (BSF 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset=US-ASCII X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (roadkill.tharned.org [IPv6:2001:470:1f10:107f:0:0:0:2]); Sat, 05 Nov 2016 20:23:33 -0500 (CDT) X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Nov 2016 01:23:35 -0000 I happened to run an old script today that uses sed(1) to extract the system boot time from the kern.boottime sysctl MIB. On 11.0 this no longer works as expected: $ sysctl kern.boottime kern.boottime: { sec = 1478380714, usec = 145351 } Sat Nov 5 16:18:34 2016 $ sysctl kern.boottime | sed -e 's/.*\([A-Z].*\)$/\1/' v 5 16:18:34 2016 sed passes over 'S' and 'N' until it hits 'v', which it considers uppercase apparently. This is with LANG=en_US.UTF-8. If I set LANG=C, it works as expected: $ sysctl kern.boottime | LANG=C sed -e 's/.*\([A-Z].*\)$/\1/' Nov 5 16:18:34 2016 Testing every lowercase character separately gives even more inconsistent results: $ cat < a > b > c > d > e > f > g > h > i > j > k > l > m > n > o > p > q > r > s > t > u > v > w > x > y > z > ! b c d e f g h i j k l m n o p q r s t u v w x y z Here sed thinks every lowercase character except for 'a' is uppercase! This differs from the first test where sed did not think 'o' is uppercase. Again, the above behaves as expected with LANG=C. Does anyone have any insight into this? This is likely to break a lot of existing code. -- Greg