Page MenuHomePhorge

PHP 8.1 fix PhutilUTF8StringTruncator::truncateString(NULL) called at [<arcanist>/src/ref/ArcanistRefView.php:103]
Closed, ResolvedPublic

Description

As reported by @ton:

Encountered a PHP 8.1 error from https://we.phorge.it/T15351#8287

Reported here:

$ arc look remotes
 <!> Arcventure

You follow a wide, straight path to the north and arrive in a grove of fruit
trees after a few minutes of walking. The grass underfoot is thick and small
insects flit through the air.

At the far edge of the grove, you see remotes:

[2023-05-08 00:46:54] EXCEPTION: (RuntimeException) strlen(): Passing null to parameter #1 ($string) of type string is deprecated at [<arcanist>/src/error/PhutilErrorHandler.php:261]
arcanist(head=master, ref.master=d47289622650)
  #0 PhutilErrorHandler::handleError(integer, string, string, integer) called at [<arcanist>/src/utils/PhutilUTF8StringTruncator.php:90]
  #1 PhutilUTF8StringTruncator::truncateString(NULL) called at [<arcanist>/src/ref/ArcanistRefView.php:103]
  #2 ArcanistRefView::newLines(integer) called at [<arcanist>/src/ref/ArcanistRefView.php:66]
  #3 ArcanistRefView::newTerminalString() called at [<arcanist>/src/xsprintf/PhutilTerminalString.php:36]
  #4 PhutilTerminalString::escapeStringValue(ArcanistRefView, boolean) called at [<arcanist>/src/xsprintf/tsprintf.php:31]
  #5 xsprintf_terminal(NULL, string, integer, ArcanistRefView, integer) called at [<arcanist>/src/xsprintf/xsprintf.php:82]
  #6 xsprintf(string, NULL, array) called at [<arcanist>/src/xsprintf/tsprintf.php:19]
  #7 tsprintf(string, ArcanistRefView) called at [<arcanist>/src/workflow/ArcanistLookWorkflow.php:200]
  #8 ArcanistLookWorkflow::lookRemotes() called at [<arcanist>/src/workflow/ArcanistLookWorkflow.php:41]
  #9 ArcanistLookWorkflow::runWorkflow(PhutilArgumentParser) called at [<arcanist>/src/workflow/ArcanistWorkflow.php:227]
  #10 ArcanistWorkflow::executeWorkflow(PhutilArgumentParser) called at [<arcanist>/src/toolset/ArcanistPhutilWorkflow.php:21]
  #11 ArcanistPhutilWorkflow::execute(PhutilArgumentParser) called at [<arcanist>/src/parser/argument/PhutilArgumentParser.php:492]
  #12 PhutilArgumentParser::parseWorkflowsFull(array) called at [<arcanist>/src/runtime/ArcanistRuntime.php:171]
  #13 ArcanistRuntime::executeCore(array) called at [<arcanist>/src/runtime/ArcanistRuntime.php:37]
  #14 ArcanistRuntime::execute(array) called at [<arcanist>/support/init/init-arcanist.php:6]
  #15 require_once(string) called at [<arcanist>/bin/arc:10]

Event Timeline

valerio.bozzolan triaged this task as Normal priority.
valerio.bozzolan created this object in space S1 Public.

Hi @aklapper. Are you affected by this as well?

If ask not just because your fix would be landed much faster than usual... thanks to our ping-pong established. But also out of personal curiosity :D

Hi @aklapper. Are you affected by this as well?

OK don't worry, just created D25206

But, I think you may find the command "arc look" quite interesting at least