Page MenuHomePhorge

PHP 8.2 strlen() null issues when arc-diffing
Closed, ResolvedPublic

Description

PS. I've patched my Phorge instance to not crash on these deprecation warnings

a@c:~/builds/web(billing)$ arc diff master
Launching editor "emacsclient"...
Provide the details for a new revision, then save and exit.
Waiting for Emacs...
Linting...
No lint engine configured for this project.
Running unit tests...
No unit test engine is configured for this project.
 PUSH STAGING  Pushing changes to staging area...


Enumerating objects: 42, done.
Counting objects: 100% (42/42), done.
Delta compression using up to 32 threads
Compressing objects: 100% (31/31), done.
Writing objects: 100% (31/31), 4.74 KiB | 1.58 MiB/s, done.
Total 31 (delta 25), reused 0 (delta 0), pack-reused 0
remote: PHP Deprecated:  strlen(): Passing null to parameter #1 ($string) of type string is deprecated in /home/phd/phabricator/src/applications/diffusion/query/rawdiff/DiffusionGitRawDiffQuery.php on line 38
remote: 
remote: Deprecated: strlen(): Passing null to parameter #1 ($string) of type string is deprecated in /home/phd/phabricator/src/applications/diffusion/query/rawdiff/DiffusionGitRawDiffQuery.php on line 38
remote: PHP Deprecated:  strlen(): Passing null to parameter #1 ($string) of type string is deprecated in /home/phd/phabricator/src/applications/diffusion/query/rawdiff/DiffusionGitRawDiffQuery.php on line 38
remote: 
remote: Deprecated: strlen(): Passing null to parameter #1 ($string) of type string is deprecated in /home/phd/phabricator/src/applications/diffusion/query/rawdiff/DiffusionGitRawDiffQuery.php on line 38
remote: PHP Deprecated:  strlen(): Passing null to parameter #1 ($string) of type string is deprecated in /home/phd/phabricator/src/applications/diffusion/query/rawdiff/DiffusionGitRawDiffQuery.php on line 38
remote: 
remote: Deprecated: strlen(): Passing null to parameter #1 ($string) of type string is deprecated in /home/phd/phabricator/src/applications/diffusion/query/rawdiff/DiffusionGitRawDiffQuery.php on line 38
remote: PHP Deprecated:  strlen(): Passing null to parameter #1 ($string) of type string is deprecated in /home/phd/phabricator/src/applications/diffusion/query/rawdiff/DiffusionGitRawDiffQuery.php on line 38
remote: 
remote: Deprecated: strlen(): Passing null to parameter #1 ($string) of type string is deprecated in /home/phd/phabricator/src/applications/diffusion/query/rawdiff/DiffusionGitRawDiffQuery.php on line 38
remote: PHP Deprecated:  strlen(): Passing null to parameter #1 ($string) of type string is deprecated in /home/phd/phabricator/src/applications/diffusion/query/rawdiff/DiffusionGitRawDiffQuery.php on line 38
remote: 
remote: Deprecated: strlen(): Passing null to parameter #1 ($string) of type string is deprecated in /home/phd/phabricator/src/applications/diffusion/query/rawdiff/DiffusionGitRawDiffQuery.php on line 38
To ssh://phabricator.tdrhq.com:2222/source/web.git
 * [new tag]             d00d491f2e64b65f13f41d4a53e2c8c869b6b882 -> phabricator/base/17223
 * [new tag]             0ede473b3439a9092fbe01e789ed8d22d33466af -> phabricator/diff/17223

Related Objects

View Standalone Graph
This task is connected to more than 200 other tasks. Only direct parents and subtasks are shown here. Use View Standalone Graph to show more of the graph.

Event Timeline

Just a clarification: can we reproduce these issues? Can that repository be shared, or part of it, to reproduce this?

Thanks :)

Cigaryno renamed this task from strlen() null issues when arc-diffing with PHP 8.2 to PHP 8.2 strlen() null issues when arc-diffing.Jun 29 2023, 20:39

@arnold please tell us the steps to reproduce this error for clarification so that we can fix this bug or share part or the entire repository.

Do you need to be able to replicate it? The fault does seem rather obvious in the code -

In src/applications/diffusion/query/rawdiff/DiffusionGitRawDiffQuery.php newQueryFuture() we have:

$path = $drequest->getPath();
if (!strlen($path)) {
  $path = '.';
}

Clearly getPath is expected to return a string or a null here, so just replace the !strlen() with phutil_nonempty_string() and ask arnold to patch & test...