[php-src] Issue #11795: Segmentation fault when generating composer autoload with 50k+ classes
| From: | oprypkhantc | Date: | Tue, 25 Jul 2023 21:59:51 +0000 |
| Subject: | [php-src] Issue #11795: Segmentation fault when generating composer autoload with 50k+ classes | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-245039@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/11795
Author: oprypkhantc
### Description
Hey.
Running
composer dumpautoload --optimize-autoloader twice on a large codebase (50k+
classes it seems) with OPCache enabled in Docker results in a segmentation fault. Changing OPCache
settings doesn't seem to do anything.
This is reproducible on a x86_64, but is not reproducible on ARM MacBook. PHP 8.1.9 is also
affected.
I've prepared a small repository with reproduction: https://github.com/oprypkhantc/php-composer-segfault/tree/main
```shell
docker run -w /app -v "$PWD:/app" -it $(docker build -q .) i --ignore-platform-reqs
docker run -w /app -v "$PWD:/app" -it $(docker build -q .) dump -o
docker run -w /app -v "$PWD:/app" -it $(docker build -q .) dump -o
```
The first dump -o results in an exit code 0 and this output:
```
Generating optimized autoload files
Warning: ...
Generated optimized autoload files containing 61131 classes
```
The second dump -o results in an exit code 139 and this output (notice
missing line compared to the first run):
```
Generating optimized autoload files
Warning: ...
```
### PHP Version
8.2.8
### Operating System
Ubuntu 20.04