Description
Symfony version(s) affected
6.2.6
Description
The HTTP Client Data Collector still throws fatal errors if the payload for escapeshellarg
is too large. This has already been tried to be fixed with the following pull request: #46700
In our Docker environment, the error still happens. I ran the following command to see what our limit is:
getconf ARG_MAX
131072
We use alpine
docker image and there are different limits. You can find this out quite easily:
# alpine
docker run -it alpine getconf ARG_MAX
131072
# ubuntu
docker run -it ubuntu getconf ARG_MAX
2097152
# debian
docker run -it debian getconf ARG_MAX
2097152
# macos
getconf ARG_MAX
1048576
I did a little research, I think in php it's not that easy to find out the limit without executing a shell command.
And also getconf ARG_MAX
is unfortunately not the maximum that is available in the user space (php?). There is an article about it here: https://www.in-ulm.de/~mascheck/various/argmax/
By the way, just because it was possible to create the "copy-curl" string doesn't mean that you can actually execute it somewhere, since it depends on ARG_MAX there too. 😅
How to reproduce
Start symfony in an alpine
docker container and create a big http client payload (between 131072 and 256000 bytes) with enabled profiler.
Possible Solution
- Keep lowering the limit and we hope it's enough.
- Try to get the correct ARG_MAX value at runtime from the underlying system.
Additional Context
No response