Skip to content

linux: environment variable values grow beyond MAX_ARG_STRLEN, making exec fail #33237

@haampie

Description

@haampie

Currently py-scipy fails to build in gitlab ci, due the following:

  • py-pythran generates 256 include dirs, which are set as a colon-seperated string in the SPACK_INCLUDE_DIRS environment variable;
  • due to install path padding each path is at least 512 bytes in size

This results in a string of at least 128KB, which is at least MAX_ARG_STRLEN = 32 * PAGE_SIZE = 32 * 4KB = 128KB.

And this makes exec syscalls fail, since they have a limit on the argument length (env variables are just arguments after argv):

https://github.com/torvalds/linux/blob/49da070062390094112b423ba443ea193527b2e4/fs/exec.c#L291-L294

https://github.com/torvalds/linux/blob/49da070062390094112b423ba443ea193527b2e4/fs/exec.c#L535-L541

resulting in E2BIG or Argument list too long, which is the build error we see.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions