[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH v2 3/5] xen/tools: fix grep reporting 'illegal byte sequence' in check-endbr.sh


  • To: xen-devel@xxxxxxxxxxxxxxxxxxxx
  • From: Roger Pau Monne <roger.pau@xxxxxxxxxx>
  • Date: Thu, 12 Feb 2026 15:46:16 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=ueHdDOHV4edNRfS5FCg5d5jf3XY0BH0ITR6fmeHzau4=; b=O0bGccRrT4VS3ZaDqOfdyi4ykuBB23fyXFkW9LZT4fNpkmVVRXqUWTw66pvZzXLtybrn4aLJ2uei6e+iTKqmK/5IxY+ZASwAHT7RlCWdwNBl3cNpe/ElRV5MbRENe05YCcOrNi8jhuqivN7jxbgIOsMwGcsH4f6irmpNAU8aukJqpywq7zVVcBhajyqVBa4qVlNNbywLagfUmc2B5nBgIAF+63ggMIl4Buw9WK68HK6TMds9qAjTTkrpNq8CVTmB6P9QHlXvpSpx560ukq8H/4fHg0oeX3aYgIOzBxHiDJjjNeViUKN7bGC6nG4k93D7SEH8zNhvPunmTuR+Yx3/PA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=anTxAp4C4+ud2BAcKYPF+Da+FRy3CmaniMVsxffPZt29QxqgNay+FTHdjFRJNq9UvzhZlRlx27LRcf8dDCGXF+qLy3oaPhUHgFxtZ++ck5zW4eGwrEMAsnF+cb5537VOkqVjdRdh3h+0O+JCRYQlpHddoEr7X4/MAm5HUOh3qSaBUDoDFG4lSQ0HimKqGc+IJJgbxRHTe9B/R2TkdH8rD5K8AABg5bL3Bz0uDDdCQAJCWe+XLqvuLHLYLYk6/1ykKwNjd2TogV4fUGbdtDjUBUJhleWKemX2Pl1E8irHRg90ffwniNC/QaYc5ARHgI5ZLPWLMOkuFcIGQdJoUhivkQ==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
  • Cc: Roger Pau Monne <roger.pau@xxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>
  • Delivery-date: Thu, 12 Feb 2026 14:46:38 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On macOS the default encoding is UTF-8.  The binary encoding used by the
grep matching pattern is not valid when processed as UTF-8.  Switch the
local to C just for the grep invocation to use the binary match pattern
correctly.

Suggested-by: Bertrand Marquis <bertrand.marquis@xxxxxxx>
Signed-off-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
Reviewed-by: Bertrand Marquis <bertrand.marquis@xxxxxxx>
---
 xen/tools/check-endbr.sh | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/xen/tools/check-endbr.sh b/xen/tools/check-endbr.sh
index aaaa9ebe6bd7..9346fe95c791 100755
--- a/xen/tools/check-endbr.sh
+++ b/xen/tools/check-endbr.sh
@@ -107,8 +107,9 @@ if $perl_re
 then
     LC_ALL=C grep -aobP '\xf3\x0f\x1e(\xfa|\xfb)|\x66\x0f\x1f\x01' $TEXT_BIN
 else
-    grep -aob -e "$(printf '\363\17\36\372')" -e "$(printf '\363\17\36\373')" \
-         -e "$(printf '\146\17\37\1')" $TEXT_BIN
+    LC_ALL=C grep -aob -e "$(printf '\363\17\36\372')" \
+                       -e "$(printf '\363\17\36\373')" \
+                       -e "$(printf '\146\17\37\1')" $TEXT_BIN
 fi | $AWK -F':' '{printf "%s%07x\n", "'$vma_hi'", int('$((0x$vma_lo))') + $1}' 
> $ALL
 
 # Wait for $VALID to become complete
-- 
2.51.0




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.