[php-src] Issue #11246: cli/get_set_process_title fails on MacOS

From: Date: Tue, 16 May 2023 00:38:37 +0000
Subject: [php-src] Issue #11246: cli/get_set_process_title fails on MacOS
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-244457@lists.php.net to get a copy of this message
Issue: https://github.com/php/php-src/issues/11246
Author: lucasnetau

### Description

The following code:

```php
<?php
if (cli_set_process_title("title") === true &&
    cli_get_process_title() === "title")
  echo "Successfully set title\n";

```

Resulted in this output:
```
PHP Warning:  cli_set_process_title(): cli_set_process_title had an error: Not initialized correctly
PHP Warning:  cli_get_process_title(): cli_get_process_title had an error: Not initialized correctly
```

But I expected this output instead:
```
Successfully set title
```

What was strange with this one it works from bash shells within PHPStorm, but fails on subprocesses
(proc_open) or when php cli run from Terminal.

Tracing the issue finds that there may not be a contiguous environ strings following argv, however
comparing to the original postgres version and checking the existing source this doesn't appear
to be necessary to fail at this point.

I'll raise a PR shortly


### PHP Version

PHP 8.1, PHP8.2

### Operating System

MacOS


Thread (1 message)

  • lucasnetau
« previous php.bugs (#244457) next »