Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[HttpClient] Hardcoded ARG_MAX in data collector #49693

Copy link
Copy link
Closed
@DavidBadura

Description

@DavidBadura
Issue body actions

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.